java.lang.Object
org.apache.lucene.internal.hppc.AbstractIterator<E>
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
CharHashSet.EntryIterator,CharObjectHashMap.EntryIterator,CharObjectHashMap.KeysIterator,CharObjectHashMap.ValuesIterator,FloatArrayList.ValueIterator,IntArrayList.ValueIterator,IntDoubleHashMap.EntryIterator,IntDoubleHashMap.KeysIterator,IntDoubleHashMap.ValuesIterator,IntFloatHashMap.EntryIterator,IntFloatHashMap.KeysIterator,IntFloatHashMap.ValuesIterator,IntHashSet.EntryIterator,IntIntHashMap.EntryIterator,IntIntHashMap.KeysIterator,IntIntHashMap.ValuesIterator,IntObjectHashMap.EntryIterator,IntObjectHashMap.KeysIterator,IntObjectHashMap.ValuesIterator,LongArrayList.ValueIterator,LongFloatHashMap.EntryIterator,LongFloatHashMap.KeysIterator,LongFloatHashMap.ValuesIterator,LongHashSet.EntryIterator,LongIntHashMap.EntryIterator,LongIntHashMap.KeysIterator,LongIntHashMap.ValuesIterator,LongObjectHashMap.EntryIterator,LongObjectHashMap.KeysIterator,LongObjectHashMap.ValuesIterator
Simplifies the implementation of iterators a bit. Modeled loosely after Google Guava's API.
Forked from com.carrotsearch.hppc.AbstractIterator
-
Field Details
-
NOT_CACHED
private static final int NOT_CACHED- See Also:
-
CACHED
private static final int CACHED- See Also:
-
AT_END
private static final int AT_END- See Also:
-
state
private int stateCurrent iterator state. -
nextElement
The next element to be returned fromnext()if fetched.
-
-
Constructor Details
-
AbstractIterator
public AbstractIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()Default implementation throwsUnsupportedOperationException. -
fetch
Fetch next element. The implementation must returndone()when all elements have been fetched.- Returns:
- Returns the next value for the iterator or chain-calls
done().
-
done
Call when done.- Returns:
- Returns a unique sentinel value to indicate end-of-iteration.
-