FIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING
Constructor and Description |
---|
AndroidSQLiteCursor(android.database.Cursor cursor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the cursor and release all resource associated
|
java.lang.String |
columnName(int index)
Returns the column name at the given zero-based column index
|
int |
columnType(int index)
Returns data type of the given column's value.
|
byte[] |
getBlob(int index)
Returns the value of the requested column as a byte array.
|
int |
getColumnCount()
Return total number of columns
|
int |
getColumnIndex(java.lang.String columnName)
Returns the zero-based index for the given column name, or -1 if the column doesn't exist.
|
int |
getColumnIndexOrThrow(java.lang.String columnName)
Returns the zero-based index for the given column name, or throws
IllegalArgumentException if the column doesn't exist. |
int |
getCount() |
float |
getFloat(int index)
Returns the value of the requested column as a float.
|
int |
getInt(int index)
Returns the value of the requested column as a long.
|
long |
getLong(int index)
Returns the value of the requested column as a long.
|
java.lang.String |
getString(int index)
Returns the value of the requested column as a String.
|
boolean |
isAfterLast()
Returns whether the cursor is pointing to the position after the last row.
|
boolean |
moveToFirst()
Move the cursor to the first row.
|
boolean |
moveToNext()
Move the cursor to the next row.
|
public int columnType(int index)
Cursor
columnType
in interface Cursor
public java.lang.String columnName(int index)
Cursor
columnName
in interface Cursor
public boolean moveToFirst()
Cursor
moveToFirst
in interface Cursor
public java.lang.String getString(int index)
Cursor
public int getInt(int index)
Cursor
public long getLong(int index)
Cursor
public float getFloat(int index)
Cursor
public byte[] getBlob(int index)
Cursor
public boolean isAfterLast()
Cursor
isAfterLast
in interface Cursor
public boolean moveToNext()
Cursor
moveToNext
in interface Cursor
public void close()
Cursor
public int getColumnCount()
Cursor
getColumnCount
in interface Cursor
public int getColumnIndex(java.lang.String columnName)
Cursor
Cursor.getColumnIndexOrThrow(String)
instead, which
will make the error more clear.getColumnIndex
in interface Cursor
columnName
- the name of the target column.Cursor.getColumnIndexOrThrow(String)
public int getColumnIndexOrThrow(java.lang.String columnName) throws java.lang.IllegalArgumentException
Cursor
IllegalArgumentException
if the column doesn't exist. If you're not sure if
a column will exist or not use Cursor.getColumnIndex(String)
and check for -1, which
is more efficient than catching the exceptions.getColumnIndexOrThrow
in interface Cursor
columnName
- the name of the target column.java.lang.IllegalArgumentException
- if the column does not existCursor.getColumnIndex(String)