Package com.usatiuk.objects.iterators
Class TombstoneSkippingIterator<K extends Comparable<K>,V>
java.lang.Object
com.usatiuk.objects.iterators.ReversibleKvIterator<K,V>
com.usatiuk.objects.iterators.TombstoneSkippingIterator<K,V>
- Type Parameters:
K- the type of the keysV- the type of the values
- All Implemented Interfaces:
CloseableKvIterator<K,,V> AutoCloseable,Iterator<org.apache.commons.lang3.tuple.Pair<K,V>>
A key-value iterator that skips tombstones.
-
Field Summary
Fields inherited from class com.usatiuk.objects.iterators.ReversibleKvIterator
_goingForward -
Constructor Summary
ConstructorsConstructorDescriptionTombstoneSkippingIterator(IteratorStart start, K startKey, List<CloseableKvIterator<K, MaybeTombstone<V>>> iterators) Constructs a TombstoneSkippingIterator with the specified start position, start key, and list of iterators. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected booleanhasImpl()Checks if there is a next element in the iterator, depending on the current direction.nextImpl()Returns the next element in the iterator, depending on the current direction.protected KpeekImpl()Fills the next element in the iterator, depending on the current direction.protected voidreverse()Reverses the current direction of the iterator.protected voidskipImpl()Skips the next element in the iterator, depending on the current direction.toString()Methods inherited from class com.usatiuk.objects.iterators.ReversibleKvIterator
hasNext, hasPrev, next, peekNextKey, peekPrevKey, prev, skip, skipPrevMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.usatiuk.objects.iterators.CloseableKvIterator
reversedMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
TombstoneSkippingIterator
public TombstoneSkippingIterator(IteratorStart start, K startKey, List<CloseableKvIterator<K, MaybeTombstone<V>>> iterators) Constructs a TombstoneSkippingIterator with the specified start position, start key, and list of iterators. LikeMappingKvIterator, iterators have a priority depending on their order in the list.- Parameters:
start- the starting position relative to the startKeystartKey- the starting keyiterators- the list of iterators to merge
-
-
Method Details
-
reverse
protected void reverse()Description copied from class:ReversibleKvIteratorReverses the current direction of the iterator.- Specified by:
reversein classReversibleKvIterator<K extends Comparable<K>,V>
-
peekImpl
Description copied from class:ReversibleKvIteratorFills the next element in the iterator, depending on the current direction.- Specified by:
peekImplin classReversibleKvIterator<K extends Comparable<K>,V>
-
skipImpl
protected void skipImpl()Description copied from class:ReversibleKvIteratorSkips the next element in the iterator, depending on the current direction.- Specified by:
skipImplin classReversibleKvIterator<K extends Comparable<K>,V>
-
hasImpl
protected boolean hasImpl()Description copied from class:ReversibleKvIteratorChecks if there is a next element in the iterator, depending on the current direction.- Specified by:
hasImplin classReversibleKvIterator<K extends Comparable<K>,V> - Returns:
- true if there is a next element, false otherwise
-
nextImpl
Description copied from class:ReversibleKvIteratorReturns the next element in the iterator, depending on the current direction.- Specified by:
nextImplin classReversibleKvIterator<K extends Comparable<K>,V> - Returns:
- the next element
-
close
public void close() -
toString
-