Package org.roaringbitmap
Class ReverseIntIteratorFlyweight
- java.lang.Object
-
- org.roaringbitmap.ReverseIntIteratorFlyweight
-
- All Implemented Interfaces:
java.lang.Cloneable
,IntIterator
public class ReverseIntIteratorFlyweight extends java.lang.Object implements IntIterator
Fast iterator minimizing the stress on the garbage collector. You can create one reusable instance of this class and thenwrap(RoaringBitmap)
This iterator enumerates the stored values in reverse (starting from the end).
-
-
Field Summary
Fields Modifier and Type Field Description private ReverseArrayContainerCharIterator
arrIter
private ReverseBitmapContainerCharIterator
bitmapIter
private int
hs
private CharIterator
iter
private short
pos
private RoaringBitmap
roaringBitmap
private ReverseRunContainerCharIterator
runIter
-
Constructor Summary
Constructors Constructor Description ReverseIntIteratorFlyweight()
Creates an instance that is not ready for iteration.ReverseIntIteratorFlyweight(RoaringBitmap r)
Creates an instance that is ready for iteration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntIterator
clone()
Creates a copy of the iterator.boolean
hasNext()
int
next()
private void
nextContainer()
void
wrap(RoaringBitmap r)
Prepares a bitmap for iteration
-
-
-
Field Detail
-
hs
private int hs
-
iter
private CharIterator iter
-
arrIter
private ReverseArrayContainerCharIterator arrIter
-
bitmapIter
private ReverseBitmapContainerCharIterator bitmapIter
-
runIter
private ReverseRunContainerCharIterator runIter
-
pos
private short pos
-
roaringBitmap
private RoaringBitmap roaringBitmap
-
-
Constructor Detail
-
ReverseIntIteratorFlyweight
public ReverseIntIteratorFlyweight()
Creates an instance that is not ready for iteration. You must first callwrap(RoaringBitmap)
.
-
ReverseIntIteratorFlyweight
public ReverseIntIteratorFlyweight(RoaringBitmap r)
Creates an instance that is ready for iteration.- Parameters:
r
- bitmap to be iterated over
-
-
Method Detail
-
clone
public IntIterator clone()
Description copied from interface:IntIterator
Creates a copy of the iterator.- Specified by:
clone
in interfaceIntIterator
- Overrides:
clone
in classjava.lang.Object
- 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
-
nextContainer
private void nextContainer()
-
wrap
public void wrap(RoaringBitmap r)
Prepares a bitmap for iteration- Parameters:
r
- bitmap to be iterated over
-
-