Class Long2LongHashMap.AbstractIterator
java.lang.Object
org.agrona.collections.Long2LongHashMap.AbstractIterator
- Direct Known Subclasses:
Long2LongHashMap.EntryIterator, Long2LongHashMap.KeyIterator, Long2LongHashMap.ValueIterator
- Enclosing class:
Long2LongHashMap
Base iterator implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIs current position valid.private intprivate intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidfindNext()Advance to the next entry.booleanhasNext()Check if there are more elements remaining.protected final intReturns position of the key of the current entry.intNumber of remaining elements.voidremove()Removes from the underlying collection the last element returned by this iterator.(package private) final voidreset()
-
Field Details
-
isPositionValid
protected boolean isPositionValidIs current position valid. -
remaining
private int remaining -
positionCounter
private int positionCounter -
stopCounter
private int stopCounter
-
-
Constructor Details
-
AbstractIterator
AbstractIterator()
-
-
Method Details
-
reset
final void reset() -
keyPosition
protected final int keyPosition()Returns position of the key of the current entry.- Returns:
- key position.
-
remaining
public int remaining()Number of remaining elements.- Returns:
- number of remaining elements.
-
hasNext
public boolean hasNext()Check if there are more elements remaining.- Returns:
trueifremaining > 0.
-
findNext
protected final void findNext()Advance to the next entry.- Throws:
NoSuchElementException- if no more entries available.
-
remove
public void remove()Removes from the underlying collection the last element returned by this iterator.
-