Class Int2ObjectHashMap.AbstractIterator<T>

java.lang.Object
org.agrona.collections.Int2ObjectHashMap.AbstractIterator<T>
Type Parameters:
T - type of elements.
All Implemented Interfaces:
Iterator<T>
Direct Known Subclasses:
Int2ObjectHashMap.EntryIterator, Int2ObjectHashMap.KeyIterator, Int2ObjectHashMap.ValueIterator
Enclosing class:
Int2ObjectHashMap<V>

abstract class Int2ObjectHashMap.AbstractIterator<T> extends Object implements Iterator<T>
Base iterator implementation that contains basic logic of traversing the element in the backing array.
  • Field Details

    • posCounter

      private int posCounter
    • stopCounter

      private int stopCounter
    • remaining

      private int remaining
    • isPositionValid

      boolean isPositionValid
  • Constructor Details

    • AbstractIterator

      AbstractIterator()
  • Method Details

    • position

      protected final int position()
      Position of the current element.
      Returns:
      position of the current element.
    • remaining

      public int remaining()
      Number of remaining elements.
      Returns:
      number of remaining elements.
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • findNext

      protected final void findNext()
      Find the next element.
      Throws:
      NoSuchElementException - if no more elements.
    • next

      public abstract T next()
      Specified by:
      next in interface Iterator<T>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>
    • reset

      final void reset()