Package tkrzw
Class IndexIterator
Object
IndexIterator
Iterator for each record of the secondary index.
- Note:
- An iterator is made by the "makeIterator" method of Index. Every unused iterator object should be destructed explicitly by the "destruct" method to free resources.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destruct()
Destructs the object and releases resources.void
first()
Initializes the iterator to indicate the first record.byte[][]
get()
Gets the key and the value of the current record of the iterator.String[]
Gets the key and the value of the current record of the iterator.void
jump
(byte[] key, byte[] value) Initializes the iterator to indicate a specific range.void
Initializes the iterator to indicate a specific range, with string data.void
last()
Initializes the iterator to indicate the last record.void
next()
Moves the iterator to the next record.void
previous()
Moves the iterator to the previous record.toString()
Gets a string representation of the iterator.
-
Method Details
-
destruct
public void destruct()Destructs the object and releases resources. -
first
public void first()Initializes the iterator to indicate the first record. -
last
public void last()Initializes the iterator to indicate the last record. -
jump
public void jump(byte[] key, byte[] value) Initializes the iterator to indicate a specific range.- Parameters:
key
- The key of the lower bound.value
- The value of the lower bound.
-
jump
Initializes the iterator to indicate a specific range, with string data.- Parameters:
key
- The key of the lower bound.value
- The value of the lower bound.
-
next
public void next()Moves the iterator to the next record. -
previous
public void previous()Moves the iterator to the previous record. -
get
public byte[][] get()Gets the key and the value of the current record of the iterator.- Returns:
- A pair of the key and the value of the current record, or null on failure.
-
getString
Gets the key and the value of the current record of the iterator.- Returns:
- A pair of the key and the value of the current record, or null on failure.
-
toString
Gets a string representation of the iterator.
-