Class Long2ObjectCache.AbstractIterator<T>

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

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

    • remaining

      private int remaining
    • position

      private int position
  • Constructor Details

    • AbstractIterator

      AbstractIterator()
  • Method Details

    • position

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

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

      protected final void findNext()
      Find next element.
    • next

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

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

      void reset()