Class WrappedImmutableRoaringBitmap
- java.lang.Object
-
- org.apache.druid.collections.bitmap.WrappedImmutableRoaringBitmap
-
- All Implemented Interfaces:
ImmutableBitmap
public class WrappedImmutableRoaringBitmap extends Object implements ImmutableBitmap
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
WrappedImmutableRoaringBitmap(ByteBuffer byteBuffer)
WrappedImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap immutableRoaringBitmap)
Wrap an ImmutableRoaringBitmap
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.roaringbitmap.BatchIterator
batchIterator()
boolean
get(int value)
Returns true if the bit at position value is setorg.roaringbitmap.buffer.ImmutableRoaringBitmap
getBitmap()
ImmutableBitmap
intersection(ImmutableBitmap otherBitmap)
Compute the bitwise-and of this bitmap with another bitmap.boolean
isEmpty()
org.roaringbitmap.IntIterator
iterator()
org.roaringbitmap.PeekableIntIterator
peekableIterator()
int
size()
byte[]
toBytes()
String
toString()
-
-
-
Constructor Detail
-
WrappedImmutableRoaringBitmap
protected WrappedImmutableRoaringBitmap(ByteBuffer byteBuffer)
-
WrappedImmutableRoaringBitmap
public WrappedImmutableRoaringBitmap(org.roaringbitmap.buffer.ImmutableRoaringBitmap immutableRoaringBitmap)
Wrap an ImmutableRoaringBitmap- Parameters:
immutableRoaringBitmap
- bitmap to be wrapped
-
-
Method Detail
-
getBitmap
public org.roaringbitmap.buffer.ImmutableRoaringBitmap getBitmap()
-
toBytes
public byte[] toBytes()
- Specified by:
toBytes
in interfaceImmutableBitmap
-
iterator
public org.roaringbitmap.IntIterator iterator()
- Specified by:
iterator
in interfaceImmutableBitmap
- Returns:
- an iterator over the set bits of this bitmap
-
peekableIterator
public org.roaringbitmap.PeekableIntIterator peekableIterator()
- Specified by:
peekableIterator
in interfaceImmutableBitmap
- Returns:
- a peekable iterator which can skip to a position
-
batchIterator
public org.roaringbitmap.BatchIterator batchIterator()
- Specified by:
batchIterator
in interfaceImmutableBitmap
- Returns:
- a batched iterator over the set bits of this bitmap
-
size
public int size()
- Specified by:
size
in interfaceImmutableBitmap
- Returns:
- The number of bits set to true in this bitmap
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceImmutableBitmap
- Returns:
- True if this bitmap is empty (contains no set bit)
-
get
public boolean get(int value)
Description copied from interface:ImmutableBitmap
Returns true if the bit at position value is set- Specified by:
get
in interfaceImmutableBitmap
- Parameters:
value
- the position to check- Returns:
- true if bit is set
-
intersection
public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
Description copied from interface:ImmutableBitmap
Compute the bitwise-and of this bitmap with another bitmap. A new bitmap is generated. Note that the other bitmap should be of the same class instance.- Specified by:
intersection
in interfaceImmutableBitmap
- Parameters:
otherBitmap
- other bitmap
-
-