Class Int2IntHashMap.EntryIterator

java.lang.Object
org.agrona.collections.Int2IntHashMap.EntryIterator
All Implemented Interfaces:
Iterator<Map.Entry<Integer,Integer>>, Map.Entry<Integer,Integer>
Enclosing class:
Int2IntHashMap

public final class Int2IntHashMap.EntryIterator extends Object implements Iterator<Map.Entry<Integer,Integer>>, Map.Entry<Integer,Integer>
Iterator over entries which supports access to unboxed keys and values.
  • Field Details

    • isPositionValid

      protected boolean isPositionValid
      Is current position valid.
  • Constructor Details

    • EntryIterator

      public EntryIterator()
      Create a new instance.
  • Method Details

    • getKey

      public Integer getKey()
      Specified by:
      getKey in interface Map.Entry<Integer,Integer>
    • getIntKey

      public int getIntKey()
      Returns the key of the current entry.
      Returns:
      the key.
    • getValue

      public Integer getValue()
      Specified by:
      getValue in interface Map.Entry<Integer,Integer>
    • getIntValue

      public int getIntValue()
      Returns the value of the current entry.
      Returns:
      the value.
    • setValue

      public Integer setValue(Integer value)
      Specified by:
      setValue in interface Map.Entry<Integer,Integer>
    • setValue

      public int setValue(int value)
      Sets the value of the current entry.
      Parameters:
      value - to be set.
      Returns:
      previous value of the entry.
    • next

      public Map.Entry<Integer,Integer> next()
      Specified by:
      next in interface Iterator<Map.Entry<Integer,Integer>>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map.Entry<Integer,Integer>
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map.Entry<Integer,Integer>
      Overrides:
      equals in class Object
    • 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:
      true if remaining > 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.