Build 1.0_r1(from source)

android.database
Class AbstractWindowedCursor

java.lang.Object
  extended by android.database.AbstractCursor
      extended by android.database.AbstractWindowedCursor
All Implemented Interfaces:
CrossProcessCursor, Cursor
Direct Known Subclasses:
BulkCursorToCursorAdaptor, SQLiteCursor

public abstract class AbstractWindowedCursor
extends AbstractCursor

A base class for Cursors that store their data in CursorWindows.


Nested Class Summary
 
Nested classes/interfaces inherited from class android.database.AbstractCursor
AbstractCursor.SelfContentObserver
 
Field Summary
protected  CursorWindow mWindow
          This needs be updated in AbstractCursor.onMove(int, int) by subclasses, and needs to be set to NULL when the contents of the cursor change.
 
Fields inherited from class android.database.AbstractCursor
mClosed, mContentObservable, mContentResolver, mCurrentRowID, mDataSetObservable, mPos, mRowIdColumnIndex, mUpdatedRows
 
Constructor Summary
AbstractWindowedCursor()
           
 
Method Summary
protected  void checkPosition()
          This function throws CursorIndexOutOfBoundsException if the cursor position is out of bounds.
 void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer)
          Retrieves the requested column text and stores it in the buffer provided.
 byte[] getBlob(int columnIndex)
          Returns the value of the requested column as a byte array.
 double getDouble(int columnIndex)
          Returns the value of the requested column as a double.
 float getFloat(int columnIndex)
          Returns the value of the requested column as a float.
 int getInt(int columnIndex)
          Returns the value of the requested column as an int.
 long getLong(int columnIndex)
          Returns the value of the requested column as a long.
 short getShort(int columnIndex)
          Returns the value of the requested column as a short.
 String getString(int columnIndex)
          Returns the value of the requested column as a String.
 CursorWindow getWindow()
          returns a pre-filled window, return NULL if no such window
 boolean hasWindow()
           
 boolean isBlob(int columnIndex)
           
 boolean isNull(int columnIndex)
          Returns true if the value in the indicated column is null.
 void setWindow(CursorWindow window)
          Set a new cursor window to cursor, usually set a remote cursor window
 
Methods inherited from class android.database.AbstractCursor
abortUpdates, close, commitUpdates, commitUpdates, deactivate, deactivateInternal, deleteRow, fillWindow, finalize, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getColumnNames, getCount, getExtras, getPosition, getUpdatedField, getWantsAllOnMoveCalls, hasUpdates, isAfterLast, isBeforeFirst, isClosed, isFieldUpdated, isFirst, isLast, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, onChange, onMove, registerContentObserver, registerDataSetObserver, requery, respond, setNotificationUri, supportsUpdates, unregisterContentObserver, unregisterDataSetObserver, update, updateBlob, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNull
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mWindow

protected CursorWindow mWindow
This needs be updated in AbstractCursor.onMove(int, int) by subclasses, and needs to be set to NULL when the contents of the cursor change.

Constructor Detail

AbstractWindowedCursor

public AbstractWindowedCursor()
Method Detail

getBlob

public byte[] getBlob(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a byte array.

If the native content of that column is not blob exception may throw

Specified by:
getBlob in interface Cursor
Overrides:
getBlob in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a byte array.

getString

public String getString(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a String.

If the native content of that column is not text the result will be the result of passing the column value to String.valueOf(x).

Specified by:
getString in interface Cursor
Specified by:
getString in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a String.

copyStringToBuffer

public void copyStringToBuffer(int columnIndex,
                               CharArrayBuffer buffer)
Description copied from interface: Cursor
Retrieves the requested column text and stores it in the buffer provided. If the buffer size is not sufficient, a new char buffer will be allocated and assigned to CharArrayBuffer.data

Specified by:
copyStringToBuffer in interface Cursor
Overrides:
copyStringToBuffer in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column. if the target column is null, return buffer
buffer - the buffer to copy the text into.

getShort

public short getShort(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a short.

If the native content of that column is not numeric the result will be the result of passing the column value to Short.valueOf(x).

Specified by:
getShort in interface Cursor
Specified by:
getShort in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a short.

getInt

public int getInt(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as an int.

If the native content of that column is not numeric the result will be the result of passing the column value to Integer.valueOf(x).

Specified by:
getInt in interface Cursor
Specified by:
getInt in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as an int.

getLong

public long getLong(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a long.

If the native content of that column is not numeric the result will be the result of passing the column value to Long.valueOf(x).

Specified by:
getLong in interface Cursor
Specified by:
getLong in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a long.

getFloat

public float getFloat(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a float.

If the native content of that column is not numeric the result will be the result of passing the column value to Float.valueOf(x).

Specified by:
getFloat in interface Cursor
Specified by:
getFloat in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a float.

getDouble

public double getDouble(int columnIndex)
Description copied from interface: Cursor
Returns the value of the requested column as a double.

If the native content of that column is not numeric the result will be the result of passing the column value to Double.valueOf(x).

Specified by:
getDouble in interface Cursor
Specified by:
getDouble in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
the value of that column as a double.

isNull

public boolean isNull(int columnIndex)
Description copied from interface: Cursor
Returns true if the value in the indicated column is null.

Specified by:
isNull in interface Cursor
Specified by:
isNull in class AbstractCursor
Parameters:
columnIndex - the zero-based index of the target column.
Returns:
whether the column value is null.

isBlob

public boolean isBlob(int columnIndex)

checkPosition

protected void checkPosition()
Description copied from class: AbstractCursor
This function throws CursorIndexOutOfBoundsException if the cursor position is out of bounds. Subclass implementations of the get functions should call this before attempting to retrieve data.

Overrides:
checkPosition in class AbstractCursor

getWindow

public CursorWindow getWindow()
Description copied from class: AbstractCursor
returns a pre-filled window, return NULL if no such window

Specified by:
getWindow in interface CrossProcessCursor
Overrides:
getWindow in class AbstractCursor

setWindow

public void setWindow(CursorWindow window)
Set a new cursor window to cursor, usually set a remote cursor window

Parameters:
window - cursor window

hasWindow

public boolean hasWindow()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature