public interface Cursor implements Closeable
Class OverviewThis interface provides random read-write access to the result set returned by a database query.
Public Methods
abstract void
close()
Closes the Cursor, releasing all of its resources and making it completely invalid.
abstract int
getColumnCount()
Return total number of columns
abstract int
getColumnIndex(String columnName)
Returns the zero-based index for the given column name, or -1 if the column doesn't exist.
abstract int
getColumnIndexOrThrow(String columnName)
Returns the zero-based index for the given column name, or throws IllegalArgumentException if the column doesn't exist.
abstract String
getColumnName(int columnIndex)
Returns the column name at the given zero-based column index.
abstract 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.
abstract int
getCount()
Returns the numbers of rows in the cursor.
abstract int
getPosition()
Returns the current position of the cursor in the row set.
abstract String
getString(int columnIndex)
Returns the value of the requested column as a String.
abstract float
getFloat(int columnIndex)
Returns the value of the requested column as a float.
abstract int
getType(int columnIndex)
Returns data type of the given column's value.
abstract boolean
move(int offset)
Move the cursor by a relative amount, forward or backward, from the current position.
从当前位置向前或向后移动光标一定距离
abstract boolean
moveToFirst()
Move the cursor to the first row.
abstract boolean
moveToNext()
Move the cursor to the next row.
abstract boolean
moveToPosition(int position)
Move the cursor to an absolute position.