Package org.agrona.collections
Class Int2IntHashMap.ValueIterator
java.lang.Object
org.agrona.collections.Int2IntHashMap.ValueIterator
- Enclosing class:
- Int2IntHashMap
Iterator over values which supports access to unboxed values.
-
Field Summary
Fields -
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.next()intReturn next value.intNumber of remaining elements.voidremove()Removes from the underlying collection the last element returned by this iterator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, remove
-
Field Details
-
isPositionValid
protected boolean isPositionValidIs current position valid.
-
-
Constructor Details
-
ValueIterator
public ValueIterator()Create a new instance.
-
-
Method Details
-
next
-
nextValue
public int nextValue()Return next value.- Returns:
- next value.
-
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.
-