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 |
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 |
---|
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, isString
abortUpdates, 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, setNotificationUri, unregisterContentObserver, unregisterDataSetObserver, update, updateBlob, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNull
protected 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 AbstractCursor
public SQLiteDatabase getDatabase()
public boolean onMove(int oldPosition, int newPosition)
AbstractCursor
onMove
in class AbstractCursor
oldPosition
- the position that we're moving fromnewPosition
- the position that we're moving topublic int getCount()
getCount
in class AbstractCursor
public int getColumnIndex(java.lang.String columnName)
getColumnIndex
in class AbstractCursor
public boolean deleteRow()
deleteRow
in class AbstractCursor
public java.lang.String[] getColumnNames()
getColumnNames
in class AbstractCursor
public boolean supportsUpdates()
supportsUpdates
in class AbstractCursor
public boolean commitUpdates(java.util.Map<? extends java.lang.Long,? extends java.util.Map<java.lang.String,java.lang.Object>> additionalValues)
commitUpdates
in class AbstractCursor
public void deactivate()
deactivate
in class AbstractCursor
public void close()
close
in class AbstractCursor
public boolean requery()
requery
in class AbstractCursor
public void setWindow(CursorWindow window)
AbstractWindowedCursor
setWindow
in class AbstractWindowedCursor
window
- cursor windowpublic void setSelectionArguments(java.lang.String[] selectionArgs)
protected void finalize()
finalize
in class AbstractCursor
public void fillWindow(int startPos, android.database.CursorWindow window)
AbstractCursor
fillWindow
in class AbstractCursor
startPos
- start position of data