Android

android.database.sqlite.SQLiteCursor

java.lang.Object
android.database.AbstractCursor CrossProcessCursor
android.database.AbstractWindowedCursor
android.database.sqlite.SQLiteCursor

A Cursor implementation that exposes results from a query on a SQLiteDatabase.

Summary

Fields inherited from class android.database.AbstractWindowedCursor
Fields inherited from class android.database.AbstractCursor

Public Constructors

            SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, SQLiteQuery query)
Execute a query and provide access to its result set through a Cursor interface.

Public Methods

          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 requery() is called.
          int  getColumnIndex(String columnName)
Returns the zero-based index for the given column name.
          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.
          boolean  requery()
Performs the query that created the cursor again, refreshing its contents.
          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

Protected Methods

          void  finalize()
Release the native resources, if they haven't been released yet.
Methods inherited from class android.database.AbstractWindowedCursor
Methods inherited from class android.database.AbstractCursor
Methods inherited from class java.lang.Object
Methods inherited from interface android.database.CrossProcessCursor
Methods inherited from interface android.database.Cursor

Details

Public Constructors

public SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, SQLiteQuery query)

Execute a query and provide access to its result set through a Cursor interface. For a query such as: 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.

Parameters

db a reference to a Database object that is already constructed and opened
editTable the name of the table used for this query
query the rest of the query terms cursor is finalized

Public Methods

public void close()

Closes the Cursor, releasing all of its resources and making it completely invalid. Unlike deactivate() a call to requery() will not make the Cursor valid again.

public void deactivate()

Deactivates the Cursor, making all calls on it fail until requery() is called. Inactive Cursors use fewer resources than active Cursors. Calling requery() will make the cursor active again.

public int getColumnIndex(String columnName)

Returns the zero-based index for the given column name.

public 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.

public int getCount()

Returns the numbers of rows in the cursor.

public SQLiteDatabase getDatabase()

Returns

  • the SQLiteDatabase that this cursor is associated with.

public 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. If it returns false the move function will also do so and the cursor will scroll to the beforeFirst position.

Parameters

oldPosition the position that we're moving from
newPosition the position that we're moving to

Returns

  • true if the move is successful, false otherwise

public boolean requery()

Performs the query that created the cursor again, refreshing its contents. This may be done at any time, including after a call to deactivate().

public void setSelectionArguments(String[] selectionArgs)

Changes the selection arguments. The new values take effect after a call to requery().

public void setWindow(CursorWindow window)

Set a new cursor window to cursor, usually set a remote cursor window

Parameters

window cursor window

Protected Methods

protected void finalize()

Release the native resources, if they haven't been released yet.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56