com.neomades.database.Cursor |
This interface provides random read-write access to the result set returned by a database query. Cursor implementations are not required to be synchronized so code using a Cursor from multiple threads should perform its own synchronization when using the Cursor.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
close()
Closes the Cursor, releasing all of its resources and making it completely
invalid.
| ||||||||||
abstract int |
getCount()
Gets the number of rows in the cursor.
| ||||||||||
abstract Database |
getDatabase()
Gets the database that this cursor is associated with.
| ||||||||||
abstract boolean |
move(int offset)
Moves the cursor by a relative amount, forward or backward, from the current
position.
| ||||||||||
abstract boolean |
moveToFirst()
Moves the cursor to the first row.
| ||||||||||
abstract boolean |
moveToLast()
Moves the cursor to the last row.
| ||||||||||
abstract boolean |
moveToNext()
Moves the cursor to the next row.
| ||||||||||
abstract boolean |
moveToPosition(int row)
Moves the cursor to an absolute position.
| ||||||||||
abstract boolean |
moveToPrevious()
Move the cursor to the previous row.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Closes the Cursor, releasing all of its resources and making it completely invalid.
Gets the number of rows in the cursor.
Gets the database that this cursor is associated with.
Moves the cursor by a relative amount, forward or backward, from the current position.
Positive offsets move forwards, negative offsets move backwards. If the final position is outside of the bounds of the result set then the resultant position will be pinned to -1 or count() depending on whether the value is off the front or end of the set, respectively.
This method will return true if the requested destination was reachable, otherwise, it returns false. For example, if the cursor is at currently on the second entry in the result set and move(-5) is called, the position will be pinned at -1, and false will be returned.
offset | the offset to be applied from the current position. |
---|
Moves the cursor to the first row.
This method will return false if the cursor is empty.
Moves the cursor to the last row.
This method will return false if the cursor is empty.
Moves the cursor to the next row.
This method will return false if the cursor is empty.
Moves the cursor to an absolute position.
The valid range of values is -1 <= position <= count.
This method will return true if the request destination was reachable, otherwise, it returns false.
row | the zero-based position to move to. |
---|
Move the cursor to the previous row.
This method will return false if the cursor is empty.