Package org.agrona.collections
Class Long2LongHashMap.EntryIterator
java.lang.Object
org.agrona.collections.Long2LongHashMap.EntryIterator
- Enclosing class:
- Long2LongHashMap
public final class Long2LongHashMap.EntryIterator
extends Object
implements Iterator<Map.Entry<Long,Long>>, Map.Entry<Long,Long>
Iterator over entries which supports access to unboxed keys and values.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected final voidfindNext()Advance to the next entry.getKey()longReturns the key of the current entry.longReturns the value of the current entry.getValue()inthashCode()booleanhasNext()Check if there are more elements remaining.protected final intReturns position of the key of the current entry.next()intNumber of remaining elements.voidremove()Removes from the underlying collection the last element returned by this iterator.longsetValue(long value) Sets the value of the current entry.Methods inherited from class java.lang.Object
clone, finalize, getClass, 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
-
EntryIterator
public EntryIterator()Create a new instance.
-
-
Method Details
-
getKey
-
getLongKey
public long getLongKey()Returns the key of the current entry.- Returns:
- the key.
-
getValue
-
getLongValue
public long getLongValue()Returns the value of the current entry.- Returns:
- the value.
-
setValue
-
setValue
public long setValue(long value) Sets the value of the current entry.- Parameters:
value- to be set.- Returns:
- previous value of the entry.
-
next
-
hashCode
public int hashCode() -
equals
-
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.
-