K - type of the keyV - type of the valuepublic interface SeekingIterator<K,V> extends Closeable
| Modifier and Type | Method and Description |
|---|---|
K |
key()
Return the key for the current entry.
|
boolean |
next()
Moves to the next entry in the source.
|
boolean |
prev()
Moves to the previous entry in the source.
|
boolean |
seek(K key)
Position at the first key in the source that is at or past target.
|
boolean |
seekToFirst()
Position at the first key in the source.
|
boolean |
seekToLast()
Position at the last key in the source.
|
boolean |
valid()
An iterator is either positioned at a key/value pair, or
not valid.
|
V |
value()
Return the value for the current entry.
|
boolean valid()
boolean seekToFirst()
valid()
after this call if the source is not empty.true if iterator is valid, same value will be return by valid() after this callboolean seekToLast()
valid() after this call if the source is not empty.true if iterator is valid, same value will be return by valid() after this callboolean seek(K key)
valid() after this call if the source contains
an entry that comes at or past target.true if iterator is valid, same value will be return by valid() after this callboolean next()
valid() is
true if the iterator was not positioned at the last entry in the source.
In the case seek(Object), seekToLast() or seekToLast() where not called
first call to this method should position iterator on the first entry.true if iterator is valid, same value will be return by valid() after this callboolean prev()
true if iterator is valid, same value will be return by valid() after this callK key()
NoSuchElementException - if iterator is not in valid stateV value()
NoSuchElementException - if iterator is not in valid stateCopyright © 2011–2020. All rights reserved.