K - type of the keyV - type of the valuepublic abstract class ASeekingIterator<K,V> extends Object implements SeekingIterator<K,V>
| Constructor and Description |
|---|
ASeekingIterator() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
internalClose() |
protected abstract K |
internalKey() |
protected abstract boolean |
internalNext(boolean switchDirection) |
protected abstract boolean |
internalPrev(boolean switchDirection) |
protected abstract boolean |
internalSeek(K key) |
protected abstract boolean |
internalSeekToFirst() |
protected abstract boolean |
internalSeekToLast() |
protected abstract V |
internalValue() |
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.
|
public final boolean valid()
SeekingIteratorvalid in interface SeekingIterator<K,V>public final boolean seekToFirst()
SeekingIteratorSeekingIterator.valid()
after this call if the source is not empty.seekToFirst in interface SeekingIterator<K,V>true if iterator is valid, same value will be return by SeekingIterator.valid() after this callpublic final boolean seekToLast()
SeekingIteratorSeekingIterator.valid() after this call if the source is not empty.seekToLast in interface SeekingIterator<K,V>true if iterator is valid, same value will be return by SeekingIterator.valid() after this callpublic final boolean seek(K key)
SeekingIteratorSeekingIterator.valid() after this call if the source contains
an entry that comes at or past target.seek in interface SeekingIterator<K,V>true if iterator is valid, same value will be return by SeekingIterator.valid() after this callpublic final boolean next()
SeekingIteratorSeekingIterator.valid() is
true if the iterator was not positioned at the last entry in the source.
In the case SeekingIterator.seek(Object), SeekingIterator.seekToLast() or SeekingIterator.seekToLast() where not called
first call to this method should position iterator on the first entry.next in interface SeekingIterator<K,V>true if iterator is valid, same value will be return by SeekingIterator.valid() after this callpublic final boolean prev()
SeekingIteratorprev in interface SeekingIterator<K,V>true if iterator is valid, same value will be return by SeekingIterator.valid() after this callpublic final K key()
SeekingIteratorkey in interface SeekingIterator<K,V>public final V value()
SeekingIteratorvalue in interface SeekingIterator<K,V>public final void close()
close in interface Closeableclose in interface AutoCloseableprotected abstract void internalClose()
throws IOException
IOExceptionprotected abstract boolean internalSeek(K key)
protected abstract boolean internalNext(boolean switchDirection)
protected abstract boolean internalPrev(boolean switchDirection)
protected abstract boolean internalSeekToFirst()
protected abstract boolean internalSeekToLast()
protected abstract V internalValue()
protected abstract K internalKey()
Copyright © 2011–2020. All rights reserved.