public interface KvStoreResultSet
KvStore database.
The result set is created by using the getResultSet method in the DeviceKvStore class.
This interface also provides methods for moving the data read position in the result set.
SystemCapability.Data#DATA_DISTRIBUTEDDATAMGR| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Entry |
getEntry() |
Obtains a key-value pair.
|
int |
getRowCount() |
Obtains the number of lines in a result set.
|
int |
getRowIndex() |
Obtains the current read position in a result set.
|
boolean |
goToFirstRow() |
Moves the read position to the first line.
|
boolean |
goToLastRow() |
Moves the read position to the last line.
|
boolean |
goToNextRow() |
Moves the read position to the next line.
|
boolean |
goToPreviousRow() |
Moves the read position to the previous line.
|
boolean |
goToRow(int rowIndex) |
Moves the read position from
0 to an absolute position. |
boolean |
isAtFirstRow() |
Checks whether the read position is the first line.
|
boolean |
isAtLastRow() |
Checks whether the read position is the last line.
|
boolean |
isEnded() |
Checks whether the read position is after the last line.
|
boolean |
isStarted() |
Checks whether the read position is before the first line.
|
boolean |
skipRow(int offset) |
Moves the read position by a relative offset to the current position.
|
int getRowCount()
int getRowIndex()
0.boolean goToFirstRow()
If the result set is empty, false is returned.
true if the operation succeeds; return false otherwise.boolean goToLastRow()
If the result set is empty, false is returned.
true if the operation succeeds; return false otherwise.boolean goToNextRow()
If the result set is empty or the data in the last line is being read, false is returned.
true if the operation succeeds; return false otherwise.boolean goToPreviousRow()
If the result set is empty or the data in the first line is being read, false is returned.
true if the operation succeeds; return false otherwise.boolean skipRow(int offset)
offset - Indicates the relative offset to the current position.
A negative offset indicates moving backwards, and a positive offset indicates moving forewards.
For example,
if the current position is entry 1 and this offset is 2, the destination position will be entry 3;
if the current position is entry 3 and this offset is -2, the destination position will be entry 1.
The valid final position after moving forwards starts with 0.
If the final position is invalid, false will be returned.true if the operation succeeds; return false otherwise.boolean goToRow(int rowIndex)
0 to an absolute position.rowIndex - Indicates the absolute position.true if the operation succeeds; return false otherwise.boolean isAtFirstRow()
true if the read position is the first line; returns false otherwise.boolean isAtLastRow()
true if the read position is the last line; returns false otherwise.boolean isStarted()
true if the read position is before the first line; returns false otherwise.boolean isEnded()
true if the read position is after the last line; returns false otherwise.Entry getEntry()