Package org.agrona.collections
Class Int2IntHashMap.AbstractIterator
java.lang.Object
org.agrona.collections.Int2IntHashMap.AbstractIterator
- Direct Known Subclasses:
Int2IntHashMap.EntryIterator
,Int2IntHashMap.KeyIterator
,Int2IntHashMap.ValueIterator
- Enclosing class:
Int2IntHashMap
Base iterator implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Is current position valid.private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
findNext()
Advance to the next entry.boolean
hasNext()
Check if there are more elements remaining.protected final int
Returns position of the key of the current entry.int
Number of remaining elements.void
remove()
Removes from the underlying collection the last element returned by this iterator.(package private) final void
reset()
-
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:
true
ifremaining > 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.
-