public class CursorWindow
extends android.database.CursorWindow
Modifier and Type | Field and Description |
---|---|
static |
CREATOR |
Constructor and Description |
---|
CursorWindow(boolean localWindow)
Creates a new empty window.
|
CursorWindow(Parcel source,
int foo) |
Modifier and Type | Method and Description |
---|---|
boolean |
allocRow()
Allocate a row in cursor window
|
void |
clear()
Clears out the existing contents of the window, making it safe to reuse
for new data.
|
void |
close()
Cleans up the native resources associated with the window.
|
void |
copyStringToBuffer(int row,
int col,
CharArrayBuffer buffer)
copy the text for the given field in the provided char array.
|
int |
describeContents() |
protected void |
finalize() |
void |
freeLastRow()
Free the last row
|
byte[] |
getBlob(int row,
int col)
Returns a byte array for the given field.
|
double |
getDouble(int row,
int col)
Returns a double for the given field.
|
float |
getFloat(int row,
int col)
Returns a float for the given field.
|
int |
getInt(int row,
int col)
Returns an int for the given field.
|
long |
getLong(int row,
int col)
Returns a long for the given field.
|
int |
getNumRows()
Returns the number of rows in this window.
|
short |
getShort(int row,
int col)
Returns a short for the given field.
|
int |
getStartPosition()
Returns the starting position of this window within the entire
Cursor's result set.
|
java.lang.String |
getString(int row,
int col)
Returns a String for the given field.
|
int |
getType(int row,
int col)
Returns data type of the given column's value.
|
boolean |
isBlob(int row,
int col)
Deprecated.
use
getType(int, int) instead |
boolean |
isFloat(int row,
int col)
Deprecated.
use
getType(int, int) instead |
boolean |
isLong(int row,
int col)
Deprecated.
use
getType(int, int) instead |
boolean |
isNull(int row,
int col)
Returns
true if given field is NULL . |
boolean |
isString(int row,
int col)
Deprecated.
use
getType(int, int) instead |
static CursorWindow |
newFromParcel(Parcel p) |
protected void |
onAllReferencesReleased() |
boolean |
putBlob(byte[] value,
int row,
int col)
copy byte array to cursor window
|
boolean |
putDouble(double value,
int row,
int col)
Copy double to cursor window
|
boolean |
putLong(long value,
int row,
int col)
Copy integer to cursor window
|
boolean |
putNull(int row,
int col)
Set the [row, col] value to NULL
|
boolean |
putString(java.lang.String value,
int row,
int col)
Copy String to cursor window
|
boolean |
setNumColumns(int columnNum)
Set number of Columns
|
void |
setStartPosition(int pos)
Set the start position of cursor window
|
void |
writeToParcel(Parcel dest,
int flags) |
public CursorWindow(boolean localWindow)
localWindow
- true if this window will be used in this process onlypublic CursorWindow(Parcel source, int foo)
public int getStartPosition()
public void setStartPosition(int pos)
pos
- public int getNumRows()
public boolean setNumColumns(int columnNum)
columnNum
- public boolean allocRow()
public void freeLastRow()
public boolean putBlob(byte[] value, int row, int col)
value
- row
- col
- public boolean putString(java.lang.String value, int row, int col)
value
- row
- col
- public boolean putLong(long value, int row, int col)
value
- row
- col
- public boolean putDouble(double value, int row, int col)
value
- row
- col
- public boolean putNull(int row, int col)
row
- col
- public boolean isNull(int row, int col)
true
if given field is NULL
.row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read fromtrue
if given field is NULL
public byte[] getBlob(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic int getType(int row, int col)
Returned column types are
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic boolean isBlob(int row, int col)
getType(int, int)
insteadrow
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read fromtrue
if given field is NULL
or a blobpublic boolean isLong(int row, int col)
getType(int, int)
insteadrow
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read fromtrue
if given field is a longpublic boolean isFloat(int row, int col)
getType(int, int)
insteadrow
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read fromtrue
if given field is a floatpublic boolean isString(int row, int col)
getType(int, int)
insteadrow
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read fromtrue
if given field is NULL
or a Stringpublic java.lang.String getString(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic void copyStringToBuffer(int row, int col, CharArrayBuffer buffer)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frombuffer
- the CharArrayBuffer to copy the text into,
If the requested string is larger than the buffer
a new char buffer will be created to hold the string. and assigne to
CharArrayBuffer.datapublic long getLong(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic double getDouble(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic short getShort(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic int getInt(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic float getFloat(int row, int col)
row
- the row to read from, row - getStartPosition() being the actual row in the windowcol
- the column to read frompublic void clear()
public void close()
protected void finalize()
public static CursorWindow newFromParcel(Parcel p)
public int describeContents()
public void writeToParcel(Parcel dest, int flags)
protected void onAllReferencesReleased()