Package org.apache.lucene.util.hppc
Class IntIntHashMap.AbstractIterator<E>
java.lang.Object
org.apache.lucene.util.hppc.IntIntHashMap.AbstractIterator<E>
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
IntIntHashMap.EntryIterator
,IntIntHashMap.KeysIterator
,IntIntHashMap.ValuesIterator
- Enclosing class:
- IntIntHashMap
public abstract static class IntIntHashMap.AbstractIterator<E>
extends Object
implements Iterator<E>
Simplifies the implementation of iterators a bit. Modeled loosely after Google Guava's API.
-
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.
-