Class ReverseIntIteratorFlyweight

java.lang.Object
org.roaringbitmap.ReverseIntIteratorFlyweight
All Implemented Interfaces:
Cloneable, IntIterator

public class ReverseIntIteratorFlyweight extends Object implements IntIterator
Fast iterator minimizing the stress on the garbage collector. You can create one reusable instance of this class and then wrap(RoaringBitmap) This iterator enumerates the stored values in reverse (starting from the end).
  • Field Details

  • Constructor Details

    • ReverseIntIteratorFlyweight

      public ReverseIntIteratorFlyweight()
      Creates an instance that is not ready for iteration. You must first call wrap(RoaringBitmap).
    • ReverseIntIteratorFlyweight

      public ReverseIntIteratorFlyweight(RoaringBitmap r)
      Creates an instance that is ready for iteration.
      Parameters:
      r - bitmap to be iterated over
  • Method Details

    • clone

      public IntIterator clone()
      Description copied from interface: IntIterator
      Creates a copy of the iterator.
      Specified by:
      clone in interface IntIterator
      Overrides:
      clone in class Object
      Returns:
      a clone of the current iterator
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface IntIterator
      Returns:
      whether there is another value
    • next

      public int next()
      Specified by:
      next in interface IntIterator
      Returns:
      next integer value
    • nextContainer

      private void nextContainer()
    • wrap

      public void wrap(RoaringBitmap r)
      Prepares a bitmap for iteration
      Parameters:
      r - bitmap to be iterated over