|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
android.content.ContentQueryMap
public class ContentQueryMap
Caches the contents of a cursor into a Map of String->ContentValues and optionally keeps the cache fresh by registering for updates on the content backing the cursor. The column of the database that is to be used as the key of the map is user-configurable, and the ContentValues contains all columns other than the one that is designated the key.
The cursor data is accessed by row key and column name via getValue().
| Constructor Summary | |
|---|---|
ContentQueryMap(Cursor cursor,
String columnNameOfKey,
boolean keepUpdated,
Handler handlerForUpdateNotifications)
Creates a ContentQueryMap that caches the content backing the cursor |
|
| Method Summary | |
|---|---|
void |
close()
|
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
Map<String,ContentValues> |
getRows()
|
ContentValues |
getValues(String rowName)
Access the ContentValues for the row specified by rowName |
void |
requery()
Requeries the cursor and reads the contents into the cache |
void |
setKeepUpdated(boolean keepUpdated)
Change whether or not the ContentQueryMap will register with the cursor's ContentProvider for change notifications. |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentQueryMap(Cursor cursor,
String columnNameOfKey,
boolean keepUpdated,
Handler handlerForUpdateNotifications)
cursor - the cursor whose contents should be cachedcolumnNameOfKey - the column that is to be used as the key of the values mapkeepUpdated - true if the cursor's ContentProvider should be monitored for changes and
the map updated when changes do occurhandlerForUpdateNotifications - the Handler that should be used to receive
notifications of changes (if requested). Normally you pass null here, but if
you know that the thread that is creating this isn't a thread that can receive
messages then you can create your own handler and use that here.| Method Detail |
|---|
public void setKeepUpdated(boolean keepUpdated)
keepUpdated - if true the ContentQueryMap should be registered with the cursor's
ContentProvider, false otherwisepublic ContentValues getValues(String rowName)
rowName - which row to read
public void requery()
public Map<String,ContentValues> getRows()
public void close()
protected void finalize()
throws Throwable
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class ObjectThrowable - The virtual machine ignores any exceptions which are
thrown during finalization.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||