Class WrappedConciseBitmap
- java.lang.Object
-
- org.apache.druid.collections.bitmap.WrappedConciseBitmap
-
- All Implemented Interfaces:
ImmutableBitmap
,MutableBitmap
public class WrappedConciseBitmap extends Object implements MutableBitmap
-
-
Constructor Summary
Constructors Constructor Description WrappedConciseBitmap()
Create a new WrappedConciseBitmap wrapping an empty ConciseSetWrappedConciseBitmap(ConciseSet conciseSet)
Create a bitmap wrapping the given bitmap
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int entry)
Add the specified integer to the bitmap.void
clear()
Empties the content of this bitmap.boolean
get(int value)
Returns true if the bit at position value is setConciseSet
getBitmap()
int
getSizeInBytes()
Return the size in bytes for the purpose of serialization to a ByteBuffer.ImmutableBitmap
intersection(ImmutableBitmap otherBitmap)
Compute the bitwise-and of this bitmap with another bitmap.boolean
isEmpty()
org.roaringbitmap.IntIterator
iterator()
void
or(MutableBitmap mutableBitmap)
Compute the bitwise-or of this bitmap with another bitmap.org.roaringbitmap.PeekableIntIterator
peekableIterator()
void
remove(int entry)
Remove the specified integer to the bitmap.int
size()
byte[]
toBytes()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.collections.bitmap.ImmutableBitmap
batchIterator
-
-
-
-
Constructor Detail
-
WrappedConciseBitmap
public WrappedConciseBitmap()
Create a new WrappedConciseBitmap wrapping an empty ConciseSet
-
WrappedConciseBitmap
public WrappedConciseBitmap(ConciseSet conciseSet)
Create a bitmap wrapping the given bitmap- Parameters:
conciseSet
- bitmap to be wrapped
-
-
Method Detail
-
getBitmap
public ConciseSet getBitmap()
-
toBytes
public byte[] toBytes()
- Specified by:
toBytes
in interfaceImmutableBitmap
-
clear
public void clear()
Description copied from interface:MutableBitmap
Empties the content of this bitmap.- Specified by:
clear
in interfaceMutableBitmap
-
or
public void or(MutableBitmap mutableBitmap)
Description copied from interface:MutableBitmap
Compute the bitwise-or of this bitmap with another bitmap. The current bitmap is modified whereas the other bitmap is left intact. Note that the other bitmap should be of the same class instance.- Specified by:
or
in interfaceMutableBitmap
- Parameters:
mutableBitmap
- other bitmap
-
getSizeInBytes
public int getSizeInBytes()
Description copied from interface:MutableBitmap
Return the size in bytes for the purpose of serialization to a ByteBuffer. Note that this is distinct from the memory usage.- Specified by:
getSizeInBytes
in interfaceMutableBitmap
- Returns:
- the total set in bytes
-
add
public void add(int entry)
Description copied from interface:MutableBitmap
Add the specified integer to the bitmap. This is equivalent to setting the ith bit to the value 1.- Specified by:
add
in interfaceMutableBitmap
- Parameters:
entry
- integer to be added
-
size
public int size()
- Specified by:
size
in interfaceImmutableBitmap
- Returns:
- The number of bits set to true in this bitmap
-
remove
public void remove(int entry)
Description copied from interface:MutableBitmap
Remove the specified integer to the bitmap. This is equivalent to setting the ith bit to the value 1.- Specified by:
remove
in interfaceMutableBitmap
- Parameters:
entry
- integer to be remove
-
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
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceImmutableBitmap
- Returns:
- True if this bitmap is empty (contains no set bit)
-
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
-
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
-
-