Package org.agrona.collections
Class Object2LongHashMap.EntryIterator
java.lang.Object
org.agrona.collections.Object2LongHashMap.EntryIterator
- Enclosing class:
- Object2LongHashMap<K>
Iterator over entries which can provide unboxed access and optionally avoid allocation.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected final voidfindNext()Find next element.getKey()longGet long value without boxing.getValue()inthashCode()booleanhasNext()next()protected final intposition()Position of the current element.voidremove()longsetValue(long value) Set value at current position without boxing.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
EntryIterator
public EntryIterator()Create a new instance.
-
-
Method Details
-
next
-
getKey
-
getLongValue
public long getLongValue()Get long value without boxing.- Returns:
- value.
-
getValue
-
setValue
-
setValue
public long setValue(long value) Set value at current position without boxing.- Parameters:
value- to be set.- Returns:
- old value.
- Throws:
IllegalArgumentException- ifmissingValue == value.
-
hashCode
public int hashCode() -
equals
-
position
protected final int position()Position of the current element.- Returns:
- position of the element in the array.
-
hasNext
public boolean hasNext() -
findNext
protected final void findNext()Find next element.- Throws:
NoSuchElementException- if no more elements.
-
remove
public void remove()
-