Package org.apache.cassandra.utils.btree
Class LeafBTreeSearchIterator<K,V>
- java.lang.Object
-
- org.apache.cassandra.utils.btree.LeafBTreeSearchIterator<K,V>
-
- All Implemented Interfaces:
java.util.Iterator<V>,BTreeSearchIterator<K,V>,IndexedSearchIterator<K,V>,SearchIterator<K,V>
public class LeafBTreeSearchIterator<K,V> extends java.lang.Object implements BTreeSearchIterator<K,V>
-
-
Constructor Summary
Constructors Constructor Description LeafBTreeSearchIterator(java.lang.Object[] btree, java.util.Comparator<? super K> comparator, BTree.Dir dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vcurrent()booleanhasNext()intindexOfCurrent()Vnext()Vnext(K key)Searches "forwards" (in direction of travel) in the iterator for the required key; if this or any key greater has already been returned by the iterator, the method may choose to return null, the correct or incorrect output, or fail an assertion.voidrewind()Reset this Iterator to its starting position
-
-
-
Method Detail
-
rewind
public void rewind()
Description copied from interface:BTreeSearchIteratorReset this Iterator to its starting position- Specified by:
rewindin interfaceBTreeSearchIterator<K,V>
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIndexedSearchIterator<K,V>- Specified by:
hasNextin interfacejava.util.Iterator<K>- Returns:
- true if iterator has any elements left, false otherwise
-
next
public V next(K key)
Description copied from interface:SearchIteratorSearches "forwards" (in direction of travel) in the iterator for the required key; if this or any key greater has already been returned by the iterator, the method may choose to return null, the correct or incorrect output, or fail an assertion. it is permitted to search past the end of the iterator, i.e.!hasNext() => next(?) == null- Specified by:
nextin interfaceSearchIterator<K,V>- Parameters:
key- to search for- Returns:
- value associated with key, if present in direction of travel
-
current
public V current()
- Specified by:
currentin interfaceIndexedSearchIterator<K,V>- Returns:
- the value just recently returned by next()
-
indexOfCurrent
public int indexOfCurrent()
- Specified by:
indexOfCurrentin interfaceIndexedSearchIterator<K,V>- Returns:
- the index of the value returned by current(), and just returned by next()
-
-