Class Int2IntHashMap.KeyIterator

java.lang.Object
org.agrona.collections.Int2IntHashMap.KeyIterator
All Implemented Interfaces:
Iterator<Integer>
Enclosing class:
Int2IntHashMap

public final class Int2IntHashMap.KeyIterator extends Object implements Iterator<Integer>
Iterator over keys which supports access to unboxed keys via nextValue().
  • Field Details

    • isPositionValid

      protected boolean isPositionValid
      Is current position valid.
  • Constructor Details

    • KeyIterator

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

    • next

      public Integer next()
      Specified by:
      next in interface Iterator<Integer>
    • nextValue

      public int nextValue()
      Return next key.
      Returns:
      next key.
    • 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.