java.lang.Object | ||
↳ | android.database.AbstractCursor | |
↳ | android.database.AbstractWindowedCursor |
Known Direct Subclasses |
A base class for Cursors that store their data in CursorWindow
s.
The cursor owns the cursor window it uses. When the cursor is closed, its window is also closed. Likewise, when the window used by the cursor is changed, its old window is closed. This policy of strict ownership ensures that cursor windows are not leaked.
Subclasses are responsible for filling the cursor window with data during
onMove(int, int)
, allocating a new cursor window if necessary.
During requery()
, the existing cursor window should be cleared and
filled with new data.
If the contents of the cursor change or become invalid, the old window must be closed (because it is owned by the cursor) and set to null.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.database.Cursor
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mWindow | The cursor window owned by this cursor. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.database.AbstractCursor
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the requested column text and stores it in the buffer provided.
| |||||||||||
Returns the value of the requested column as a byte array.
| |||||||||||
Returns the value of the requested column as a double.
| |||||||||||
Returns the value of the requested column as a float.
| |||||||||||
Returns the value of the requested column as an int.
| |||||||||||
Returns the value of the requested column as a long.
| |||||||||||
Returns the value of the requested column as a short.
| |||||||||||
Returns the value of the requested column as a String.
| |||||||||||
Returns data type of the given column's value.
| |||||||||||
If the cursor is backed by a
CursorWindow , returns a pre-filled
window with the contents of the cursor, otherwise null. | |||||||||||
Returns true if the cursor has an associated cursor window.
| |||||||||||
This method was deprecated
in API level 11.
Use
getType(int)
| |||||||||||
This method was deprecated
in API level 11.
Use
getType(int)
| |||||||||||
This method was deprecated
in API level 11.
Use
getType(int)
| |||||||||||
Returns
true if the value in the indicated column is null. | |||||||||||
This method was deprecated
in API level 11.
Use
getType(int)
| |||||||||||
Sets a new cursor window for the cursor to use.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This function throws CursorIndexOutOfBoundsException if
the cursor position is out of bounds.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.database.AbstractCursor
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.database.CrossProcessCursor
| |||||||||||
From interface
android.database.Cursor
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.lang.AutoCloseable
|
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
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. |
Returns the value of the requested column as a byte array.
The result and whether this method throws an exception when the column value is null or the column type is not a blob type is implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as a double.
The result and whether this method throws an exception when the
column value is null, the column type is not a floating-point type, or the
floating-point value is not representable as a double
value is
implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as a float.
The result and whether this method throws an exception when the
column value is null, the column type is not a floating-point type, or the
floating-point value is not representable as a float
value is
implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as an int.
The result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Integer.MIN_VALUE
,
Integer.MAX_VALUE
] is implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as a long.
The result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Long.MIN_VALUE
,
Long.MAX_VALUE
] is implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as a short.
The result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Short.MIN_VALUE
,
Short.MAX_VALUE
] is implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns the value of the requested column as a String.
The result and whether this method throws an exception when the column value is null or the column type is not a string type is implementation-defined.
columnIndex | the zero-based index of the target column. |
---|
Returns data type of the given column's value.
The preferred type of the column is returned but the data may be converted to other types
as documented in the get-type methods such as getInt(int)
, getFloat(int)
etc.
Returned column types are
columnIndex | the zero-based index of the target column. |
---|
If the cursor is backed by a CursorWindow
, returns a pre-filled
window with the contents of the cursor, otherwise null.
Returns true if the cursor has an associated cursor window.
Returns true
if the value in the indicated column is null.
columnIndex | the zero-based index of the target column. |
---|
Sets a new cursor window for the cursor to use.
The cursor takes ownership of the provided cursor window; the cursor window will be closed when the cursor is closed or when the cursor adopts a new cursor window.
If the cursor previously had a cursor window, then it is closed when the new cursor window is assigned.
window | The new cursor window, typically a remote cursor window. |
---|
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.