public class Cursor
extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Visitor visitor,
boolean writable,
boolean step)
Accept a visitor to the current record.
|
DB |
db()
Get the database object.
|
void |
disable()
Disable the cursor.
|
Error |
error()
Get the last happened error.
|
protected void |
finalize()
Release resources.
|
String |
get_key_str(boolean step)
Get the key of the current record.
|
byte[] |
get_key(boolean step)
Get the key of the current record.
|
String[] |
get_str(boolean step)
Get a pair of the key and the value of the current record.
|
String |
get_value_str(boolean step)
Get the value of the current record.
|
byte[] |
get_value(boolean step)
Get the value of the current record.
|
byte[][] |
get(boolean step)
Get a pair of the key and the value of the current record.
|
boolean |
jump_back()
Jump the cursor to the last record for backward scan.
|
boolean |
jump_back(byte[] key)
Jump the cursor to a record for backward scan.
|
boolean |
jump_back(String key)
Jump the cursor to a record for backward scan.
|
boolean |
jump()
Jump the cursor to the first record for forward scan.
|
boolean |
jump(byte[] key)
Jump the cursor to a record for forward scan.
|
boolean |
jump(String key)
Jump the cursor to a record for forward scan.
|
boolean |
remove()
Remove the current record.
|
String[] |
seize_str()
Get a pair of the key and the value of the current record and remove it atomically.
|
byte[][] |
seize()
Get a pair of the key and the value of the current record and remove it atomically.
|
boolean |
set_value(byte[] value,
boolean step)
Set the value of the current record.
|
boolean |
set_value(String value,
boolean step)
Set the value of the current record.
|
boolean |
step_back()
Step the cursor to the previous record.
|
boolean |
step()
Step the cursor to the next record.
|
String |
toString()
Get the string expression.
|
public Cursor(DB db)
public boolean accept(Visitor visitor, boolean writable, boolean step)
visitor
- a visitor object which implements the Visitor interface.writable
- true for writable operation, or false for read-only operation.step
- true to move the cursor to the next record, or false for no move.public DB db()
public void disable()
public Error error()
protected void finalize()
finalize
in class Object
public String get_key_str(boolean step)
get_key(boolean)
public byte[] get_key(boolean step)
step
- true to move the cursor to the next record, or false for no move.public String[] get_str(boolean step)
get(boolean)
public String get_value_str(boolean step)
get_value(boolean)
public byte[] get_value(boolean step)
step
- true to move the cursor to the next record, or false for no move.public byte[][] get(boolean step)
step
- true to move the cursor to the next record, or false for no move.public boolean jump_back()
public boolean jump_back(byte[] key)
key
- the key of the destination record.public boolean jump_back(String key)
jump_back(byte[])
public boolean jump()
public boolean jump(byte[] key)
key
- the key of the destination record.public boolean jump(String key)
jump(byte[])
public boolean remove()
public String[] seize_str()
get(boolean)
public byte[][] seize()
public boolean set_value(byte[] value, boolean step)
value
- the value.step
- true to move the cursor to the next record, or false for no move.public boolean set_value(String value, boolean step)
set_value(byte[], boolean)
public boolean step_back()
public boolean step()
public String toString()
toString
in class Object