public class SQLiteCursor extends AbstractWindowedCursor
SQLiteDatabase.
SQLiteCursor is not internally synchronized so code using a SQLiteCursor from multiple
threads should perform its own synchronization when using the SQLiteCursor.| Modifier and Type | Class and Description |
|---|---|
protected class |
SQLiteCursor.MainThreadNotificationHandler |
AbstractCursor.SelfContentObserver| Modifier and Type | Field and Description |
|---|---|
protected SQLiteCursor.MainThreadNotificationHandler |
mNotificationHandler |
mWindowmClosed, mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRowsFIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING| Constructor and Description |
|---|
SQLiteCursor(SQLiteDatabase db,
SQLiteCursorDriver driver,
java.lang.String editTable,
SQLiteQuery query)
Execute a query and provide access to its result set through a Cursor
interface.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
commitUpdates(java.util.Map<? extends java.lang.Long,? extends java.util.Map<java.lang.String,java.lang.Object>> additionalValues)
Deprecated.
|
void |
deactivate() |
boolean |
deleteRow()
Deprecated.
|
void |
fillWindow(int startPos,
android.database.CursorWindow window)
Copy data from cursor to CursorWindow
|
protected void |
finalize()
Release the native resources, if they haven't been released yet.
|
int |
getColumnIndex(java.lang.String columnName) |
java.lang.String[] |
getColumnNames() |
int |
getCount() |
SQLiteDatabase |
getDatabase() |
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.
|
void |
registerDataSetObserver(DataSetObserver observer) |
boolean |
requery() |
void |
setLoadStyle(int initialRead,
int maxRead)
support for a cursor variant that doesn't always read all results
initialRead is the initial number of items that cursor window reads
if query contains more than this number of items, a thread will be
created and handle the left over items so that caller can show
results as soon as possible
|
void |
setSelectionArguments(java.lang.String[] selectionArgs)
Changes the selection arguments.
|
void |
setWindow(CursorWindow window)
Set a new cursor window to cursor, usually set a remote cursor window
|
boolean |
supportsUpdates()
Deprecated.
|
checkPosition, copyStringToBuffer, getBlob, getDouble, getFloat, getInt, getLong, getShort, getString, getType, getWindow, hasWindow, isBlob, isFloat, isLong, isNull, isStringabortUpdates, commitUpdates, deactivateInternal, getColumnCount, getColumnIndexOrThrow, getColumnName, getDataSetObservable, getExtras, getNotificationUri, getPosition, getUpdatedField, getWantsAllOnMoveCalls, hasUpdates, isAfterLast, isBeforeFirst, isClosed, isFieldUpdated, isFirst, isLast, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, notifyDataSetChange, onChange, registerContentObserver, respond, setExtras, setNotificationUri, unregisterContentObserver, unregisterDataSetObserver, update, updateBlob, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNullprotected SQLiteCursor.MainThreadNotificationHandler mNotificationHandler
public SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver, java.lang.String editTable, SQLiteQuery query)
SELECT name, birth, phone FROM
myTable WHERE ... LIMIT 1,20 ORDER BY... the column names (name, birth,
phone) would be in the projection argument and everything from
FROM onward would be in the params argument. This constructor
has package scope.db - a reference to a Database object that is already constructed
and openededitTable - the name of the table used for this queryquery - the rest of the query terms
cursor is finalizedpublic void setLoadStyle(int initialRead,
int maxRead)
initialRead - initial number of items that cursor readmaxRead - leftover items read at maxRead items per timepublic void registerDataSetObserver(DataSetObserver observer)
registerDataSetObserver in class AbstractCursorpublic SQLiteDatabase getDatabase()
public boolean onMove(int oldPosition,
int newPosition)
AbstractCursoronMove in class AbstractCursoroldPosition - the position that we're moving fromnewPosition - the position that we're moving topublic int getCount()
getCount in class AbstractCursorpublic int getColumnIndex(java.lang.String columnName)
getColumnIndex in class AbstractCursorpublic boolean deleteRow()
deleteRow in class AbstractCursorpublic java.lang.String[] getColumnNames()
getColumnNames in class AbstractCursorpublic boolean supportsUpdates()
supportsUpdates in class AbstractCursorpublic boolean commitUpdates(java.util.Map<? extends java.lang.Long,? extends java.util.Map<java.lang.String,java.lang.Object>> additionalValues)
commitUpdates in class AbstractCursorpublic void deactivate()
deactivate in class AbstractCursorpublic void close()
close in class AbstractCursorpublic boolean requery()
requery in class AbstractCursorpublic void setWindow(CursorWindow window)
AbstractWindowedCursorsetWindow in class AbstractWindowedCursorwindow - cursor windowpublic void setSelectionArguments(java.lang.String[] selectionArgs)
protected void finalize()
finalize in class AbstractCursorpublic void fillWindow(int startPos,
android.database.CursorWindow window)
AbstractCursorfillWindow in class AbstractCursorstartPos - start position of data