Package org.agrona.collections
Class LongHashSet.LongIterator
- java.lang.Object
-
- org.agrona.collections.LongHashSet.LongIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Long>
- Enclosing class:
- LongHashSet
public final class LongHashSet.LongIterator extends java.lang.Object implements java.util.Iterator<java.lang.Long>
Iterator which supports unboxed access to the values vianextValue()
.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isPositionValid
private int
positionCounter
private int
remaining
private int
stopCounter
-
Constructor Summary
Constructors Constructor Description LongIterator()
Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
findNext()
boolean
hasNext()
java.lang.Long
next()
long
nextValue()
Strongly typed alternative ofIterator.next()
to avoid boxing.private int
position(long[] values)
int
remaining()
Returns number of remaining (not yet visited) elements.void
remove()
(package private) LongHashSet.LongIterator
reset()
-
-
-
Method Detail
-
reset
LongHashSet.LongIterator reset()
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<java.lang.Long>
-
remaining
public int remaining()
Returns number of remaining (not yet visited) elements.- Returns:
- number of remaining elements.
-
next
public java.lang.Long next()
- Specified by:
next
in interfacejava.util.Iterator<java.lang.Long>
-
nextValue
public long nextValue()
Strongly typed alternative ofIterator.next()
to avoid boxing.- Returns:
- the next long value.
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<java.lang.Long>
-
findNext
private void findNext()
-
position
private int position(long[] values)
-
-