Class BufferReverseIntIteratorFlyweight

  • All Implemented Interfaces:
    Cloneable, IntIterator

    public class BufferReverseIntIteratorFlyweight
    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(ImmutableRoaringBitmap) This iterator enumerates the stored values in reverse (starting from the end).
    Author:
    Borislav Ivanov
    • Constructor Detail

      • BufferReverseIntIteratorFlyweight

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

        public BufferReverseIntIteratorFlyweight​(ImmutableRoaringBitmap r)
        Creates an instance that is ready for iteration.
        Parameters:
        r - bitmap to be iterated over
    • Method Detail

      • 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
      • wrap

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