Class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator

java.lang.Object
it.unimi.dsi.sux4j.util.EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator
All Implemented Interfaces:
it.unimi.dsi.fastutil.BidirectionalIterator<Long>, it.unimi.dsi.fastutil.BigListIterator<Long>, it.unimi.dsi.fastutil.longs.LongBidirectionalIterator, it.unimi.dsi.fastutil.longs.LongBigListIterator, it.unimi.dsi.fastutil.longs.LongIterator, it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<Long>, it.unimi.dsi.fastutil.objects.ObjectIterator<Long>, Iterator<Long>, PrimitiveIterator<Long,LongConsumer>, PrimitiveIterator.OfLong
Direct Known Subclasses:
EliasFanoIndexedMonotoneLongBigList.EliasFanoIndexedMonotoneLongBigListIterator, EliasFanoPrefixSumLongBigList.EliasFanoPrefixSumLongBigListIterator
Enclosing class:
EliasFanoMonotoneLongBigList

public class EliasFanoMonotoneLongBigList.EliasFanoMonotoneLongBigListIterator extends Object implements it.unimi.dsi.fastutil.longs.LongBigListIterator
A list iterator over the values of this EliasFanoMonotoneLongBigList.

Forward iteration will be faster than iterated calls to getLong(). Backward iteration is available, but it will perform similarly to getLong().

Additional unsafe methods nextLongUnsafe() and previousLongUnsafe() iterate without checking for the existence of a next element.

  • Field Details

    • index

      protected long index
      The index of the next element to return.
    • word

      protected int word
      The current word in the array of upper bits.
    • window

      protected long window
      The current window.
    • lowerBitsPosition

      protected long lowerBitsPosition
      The current position in the array of lower bits.
  • Constructor Details

    • EliasFanoMonotoneLongBigListIterator

      protected EliasFanoMonotoneLongBigListIterator(long from)
  • Method Details

    • previousIndex

      public long previousIndex()
      Specified by:
      previousIndex in interface it.unimi.dsi.fastutil.BigListIterator<Long>
    • nextIndex

      public long nextIndex()
      Specified by:
      nextIndex in interface it.unimi.dsi.fastutil.BigListIterator<Long>
    • hasPrevious

      public boolean hasPrevious()
      Specified by:
      hasPrevious in interface it.unimi.dsi.fastutil.BidirectionalIterator<Long>
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Long>
    • nextLong

      public long nextLong()
      Specified by:
      nextLong in interface it.unimi.dsi.fastutil.longs.LongIterator
      Specified by:
      nextLong in interface PrimitiveIterator.OfLong
    • nextLongUnsafe

      public long nextLongUnsafe()
      Returns the same element as nextLong(), if hasNext() is true; otherwise, behavior is undefined.
      Returns:
      the same element as nextLong(), if hasNext() is true; otherwise, behavior is undefined.
    • previousLong

      public long previousLong()
      Specified by:
      previousLong in interface it.unimi.dsi.fastutil.longs.LongBidirectionalIterator
    • previousLongUnsafe

      public long previousLongUnsafe()
      Returns the same element as previousLong(), if hasPrevious() is true; otherwise, behavior is undefined.
      Returns:
      the same element as previousLong(), if hasPrevious() is true; otherwise, behavior is undefined.