Package org.agrona.collections
Class Object2IntHashMap.AbstractIterator<T>
- java.lang.Object
-
- org.agrona.collections.Object2IntHashMap.AbstractIterator<T>
-
- Type Parameters:
T
- type of elements.
- All Implemented Interfaces:
java.util.Iterator<T>
- Direct Known Subclasses:
Object2IntHashMap.EntryIterator
,Object2IntHashMap.KeyIterator
,Object2IntHashMap.ValueIterator
- Enclosing class:
- Object2IntHashMap<K>
abstract class Object2IntHashMap.AbstractIterator<T> extends java.lang.Object implements java.util.Iterator<T>
Base iterator implementation that contains basic logic of traversing the element in the backing array.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isPositionValid
private int
posCounter
private int
remaining
private int
stopCounter
-
Constructor Summary
Constructors Constructor Description AbstractIterator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
findNext()
Find next element.boolean
hasNext()
abstract T
next()
protected int
position()
Position of the current element.void
remove()
(package private) void
reset()
-
-
-
Method Detail
-
position
protected final int position()
Position of the current element.- Returns:
- position of the element in the array.
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
findNext
protected final void findNext()
Find next element.- Throws:
java.util.NoSuchElementException
- if no more elements.
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
reset
final void reset()
-
-