Package org.roaringbitmap.buffer
Class BufferReverseIntIteratorFlyweight
java.lang.Object
org.roaringbitmap.buffer.BufferReverseIntIteratorFlyweight
- All Implemented Interfaces:
Cloneable
,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 Summary
ConstructorsConstructorDescriptionCreates an instance that is not ready for iteration.Creates an instance that is ready for iteration. -
Method Summary
-
Constructor Details
-
BufferReverseIntIteratorFlyweight
public BufferReverseIntIteratorFlyweight()Creates an instance that is not ready for iteration. You must first callwrap(ImmutableRoaringBitmap)
. -
BufferReverseIntIteratorFlyweight
Creates an instance that is ready for iteration.- Parameters:
r
- bitmap to be iterated over
-
-
Method Details
-
clone
Description copied from interface:IntIterator
Creates a copy of the iterator.- Specified by:
clone
in interfaceIntIterator
- Overrides:
clone
in classObject
- Returns:
- a clone of the current iterator
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIntIterator
- Returns:
- whether there is another value
-
next
public int next()- Specified by:
next
in interfaceIntIterator
- Returns:
- next integer value
-
wrap
Prepares a bitmap for iteration- Parameters:
r
- bitmap to be iterated over
-