public final class BulkCursorToCursorAdaptor extends AbstractWindowedCursor
IBulkCursor
to a Cursor
for use in the local process.
AbstractCursor.SelfContentObserver
mWindow
mClosed, mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRows
FIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING
Constructor and Description |
---|
BulkCursorToCursorAdaptor() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the Cursor, releasing all of its resources and making it completely invalid.
|
void |
deactivate()
Deactivates the Cursor, making all calls on it fail until
Cursor.requery() is called. |
String[] |
getColumnNames()
Returns a string array holding the names of all of the columns in the
result set in the order in which they were listed in the result.
|
int |
getCount()
Returns the numbers of rows in the cursor.
|
Bundle |
getExtras()
Returns a bundle of extra values.
|
IContentObserver |
getObserver()
Gets a SelfDataChangeOberserver that can be sent to a remote
process to receive change notifications over IPC.
|
void |
initialize(BulkCursorDescriptor d)
Initializes the adaptor.
|
boolean |
onMove(int oldPosition,
int newPosition)
This function is called every time the cursor is successfully scrolled
to a new position, giving the subclass a chance to update any state it
may have.
|
boolean |
requery()
Performs the query that created the cursor again, refreshing its
contents.
|
Bundle |
respond(Bundle extras)
This is an out-of-band way for the the user of a cursor to communicate with the cursor.
|
checkPosition, clearOrCreateWindow, closeWindow, copyStringToBuffer, getBlob, getDouble, getFloat, getInt, getLong, getShort, getString, getType, getWindow, hasWindow, isBlob, isFloat, isLong, isNull, isString, onDeactivateOrClose, setWindow
fillWindow, finalize, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getNotificationUri, getPosition, getUpdatedField, getWantsAllOnMoveCalls, isAfterLast, isBeforeFirst, isClosed, isFieldUpdated, isFirst, isLast, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, onChange, registerContentObserver, registerDataSetObserver, setExtras, setNotificationUri, setNotificationUri, unregisterContentObserver, unregisterDataSetObserver
public void initialize(BulkCursorDescriptor d)
public IContentObserver getObserver()
public int getCount()
Cursor
getCount
in interface Cursor
getCount
in class AbstractCursor
public boolean onMove(int oldPosition, int newPosition)
AbstractCursor
onMove
in interface CrossProcessCursor
onMove
in class AbstractCursor
oldPosition
- the position that we're moving fromnewPosition
- the position that we're moving topublic void deactivate()
Cursor
Cursor.requery()
is called.
Inactive Cursors use fewer resources than active Cursors.
Calling Cursor.requery()
will make the cursor active again.deactivate
in interface Cursor
deactivate
in class AbstractCursor
public void close()
Cursor
Cursor.deactivate()
a call to Cursor.requery()
will not make the Cursor valid
again.close
in interface Cursor
close
in interface Closeable
close
in interface AutoCloseable
close
in class AbstractCursor
public boolean requery()
Cursor
Cursor.deactivate()
.
Since this method could execute a query on the database and potentially take
a while, it could cause ANR if it is called on Main (UI) thread.
A warning is printed if this method is being executed on Main thread.requery
in interface Cursor
requery
in class AbstractCursor
public String[] getColumnNames()
Cursor
getColumnNames
in interface Cursor
getColumnNames
in class AbstractCursor
public Bundle getExtras()
Cursor
These values may only change when requery is called.
getExtras
in interface Cursor
getExtras
in class AbstractCursor
Bundle.EMPTY
if there
are no values. Never null
.public Bundle respond(Bundle extras)
Cursor
One use of this is to tell a cursor that it should retry its network request after it reported an error.
respond
in interface Cursor
respond
in class AbstractCursor
extras
- extra values, or Bundle.EMPTY
.
Never null
.Bundle.EMPTY
.
Never null
.