|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.database.AbstractCursor
android.database.AbstractWindowedCursor
android.database.sqlite.SQLiteCursor
public class SQLiteCursor
A Cursor implementation that exposes results from a query on a
SQLiteDatabase.
| Nested Class Summary | |
|---|---|
protected class |
SQLiteCursor.MainThreadNotificationHandler
|
| Nested classes/interfaces inherited from class android.database.AbstractCursor |
|---|
AbstractCursor.SelfContentObserver |
| Field Summary | |
|---|---|
protected SQLiteCursor.MainThreadNotificationHandler |
mNotificationHandler
|
(package private) static int |
NO_COUNT
|
(package private) static String |
TAG
|
| Fields inherited from class android.database.AbstractWindowedCursor |
|---|
mWindow |
| Fields inherited from class android.database.AbstractCursor |
|---|
mClosed, mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRows |
| Constructor Summary | |
|---|---|
SQLiteCursor(SQLiteDatabase db,
SQLiteCursorDriver driver,
String editTable,
SQLiteQuery query)
Execute a query and provide access to its result set through a Cursor interface. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the Cursor, releasing all of its resources and making it completely invalid. |
boolean |
commitUpdates(Map<? extends Long,? extends Map<String,Object>> additionalValues)
Deprecated. |
void |
deactivate()
Deactivates the Cursor, making all calls on it fail until Cursor.requery() is called. |
boolean |
deleteRow()
Deprecated. |
protected void |
finalize()
Release the native resources, if they haven't been released yet. |
int |
getColumnIndex(String columnName)
Returns the zero-based index for the given column name, or -1 if the column doesn't exist. |
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. |
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)
Register an observer that is called when changes happen to the contents of the this cursors data set, for example, when the data set is changed via Cursor.requery(), Cursor.deactivate(), or Cursor.close(). |
boolean |
requery()
Performs the query that created the cursor again, refreshing its contents. |
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(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. |
| Methods inherited from class android.database.AbstractWindowedCursor |
|---|
checkPosition, copyStringToBuffer, getBlob, getDouble, getFloat, getInt, getLong, getShort, getString, getWindow, hasWindow, isBlob, isNull |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final String TAG
static final int NO_COUNT
protected SQLiteCursor.MainThreadNotificationHandler mNotificationHandler
| Constructor Detail |
|---|
public SQLiteCursor(SQLiteDatabase db,
SQLiteCursorDriver driver,
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 finalized| Method Detail |
|---|
public 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)
CursorCursor.requery(), Cursor.deactivate(), or Cursor.close().
registerDataSetObserver in interface CursorregisterDataSetObserver in class AbstractCursorobserver - the object that gets notified when the cursors data set changes.Cursor.unregisterDataSetObserver(DataSetObserver)public SQLiteDatabase getDatabase()
public boolean onMove(int oldPosition,
int newPosition)
AbstractCursor
onMove in interface CrossProcessCursoronMove in class AbstractCursoroldPosition - the position that we're moving fromnewPosition - the position that we're moving to
public int getCount()
Cursor
getCount in interface CursorgetCount in class AbstractCursorpublic int getColumnIndex(String columnName)
CursorCursor.getColumnIndexOrThrow(String) instead, which
will make the error more clear.
getColumnIndex in interface CursorgetColumnIndex in class AbstractCursorcolumnName - the name of the target column.
Cursor.getColumnIndexOrThrow(String)public boolean deleteRow()
CursorThe query must have the row ID column in its selection, otherwise this call will fail.
deleteRow in interface CursordeleteRow in class AbstractCursorpublic String[] getColumnNames()
Cursor
getColumnNames in interface CursorgetColumnNames in class AbstractCursorpublic boolean supportsUpdates()
Cursortrue if the cursor supports updates.
supportsUpdates in interface CursorsupportsUpdates in class AbstractCursorpublic boolean commitUpdates(Map<? extends Long,? extends Map<String,Object>> additionalValues)
CursorCursor.requery() before reading data from the cursor again.
commitUpdates in interface CursorcommitUpdates in class AbstractCursoradditionalValues - A map from row IDs to Maps associating column names with
updated values. A null value indicates the field should be
removed.
public void deactivate()
CursorCursor.requery() is called.
Inactive Cursors use fewer resources than active Cursors.
Calling Cursor.requery() will make the cursor active again.
deactivate in interface Cursordeactivate in class AbstractCursorpublic void close()
CursorCursor.deactivate() a call to Cursor.requery() will not make the Cursor valid
again.
close in interface Cursorclose in class AbstractCursorpublic boolean requery()
CursorCursor.deactivate().
requery in interface Cursorrequery in class AbstractCursorpublic void setWindow(CursorWindow window)
AbstractWindowedCursor
setWindow in class AbstractWindowedCursorwindow - cursor windowpublic void setSelectionArguments(String[] selectionArgs)
protected void finalize()
finalize in class AbstractCursor
|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||