Class WrappedConciseBitmap
java.lang.Object
org.apache.druid.collections.bitmap.WrappedConciseBitmap
- All Implemented Interfaces:
ImmutableBitmap,MutableBitmap
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new WrappedConciseBitmap wrapping an empty ConciseSetWrappedConciseBitmap(ConciseSet conciseSet) Create a bitmap wrapping the given bitmap -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int entry) Add the specified integer to the bitmap.voidclear()Empties the content of this bitmap.booleanget(int value) Returns true if the bit at position value is setintReturn the size in bytes for the purpose of serialization to a ByteBuffer.intersection(ImmutableBitmap otherBitmap) Compute the bitwise-and of this bitmap with another bitmap.booleanisEmpty()org.roaringbitmap.IntIteratoriterator()voidor(MutableBitmap mutableBitmap) Compute the bitwise-or of this bitmap with another bitmap.org.roaringbitmap.PeekableIntIteratorvoidremove(int entry) Remove the specified integer to the bitmap.intsize()byte[]toBytes()toString()union(ImmutableBitmap otherBitmap) Compute the bitwise-or of this bitmap with another bitmap.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.collections.bitmap.ImmutableBitmap
batchIterator
-
Constructor Details
-
WrappedConciseBitmap
public WrappedConciseBitmap()Create a new WrappedConciseBitmap wrapping an empty ConciseSet -
WrappedConciseBitmap
Create a bitmap wrapping the given bitmap- Parameters:
conciseSet- bitmap to be wrapped
-
-
Method Details
-
getBitmap
-
toBytes
public byte[] toBytes()- Specified by:
toBytesin interfaceImmutableBitmap
-
clear
public void clear()Description copied from interface:MutableBitmapEmpties the content of this bitmap.- Specified by:
clearin interfaceMutableBitmap
-
or
Description copied from interface:MutableBitmapCompute 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:
orin interfaceMutableBitmap- Parameters:
mutableBitmap- other bitmap
-
getSizeInBytes
public int getSizeInBytes()Description copied from interface:MutableBitmapReturn the size in bytes for the purpose of serialization to a ByteBuffer. Note that this is distinct from the memory usage.- Specified by:
getSizeInBytesin interfaceMutableBitmap- Returns:
- the total set in bytes
-
add
public void add(int entry) Description copied from interface:MutableBitmapAdd the specified integer to the bitmap. This is equivalent to setting the ith bit to the value 1.- Specified by:
addin interfaceMutableBitmap- Parameters:
entry- integer to be added
-
size
public int size()- Specified by:
sizein interfaceImmutableBitmap- Returns:
- The number of bits set to true in this bitmap
-
toString
-
remove
public void remove(int entry) Description copied from interface:MutableBitmapRemove the specified integer to the bitmap. This is equivalent to setting the ith bit to the value 1.- Specified by:
removein interfaceMutableBitmap- Parameters:
entry- integer to be remove
-
iterator
public org.roaringbitmap.IntIterator iterator()- Specified by:
iteratorin interfaceImmutableBitmap- Returns:
- an iterator over the set bits of this bitmap
-
peekableIterator
public org.roaringbitmap.PeekableIntIterator peekableIterator()- Specified by:
peekableIteratorin interfaceImmutableBitmap- Returns:
- a peekable iterator which can skip to a position
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceImmutableBitmap- Returns:
- True if this bitmap is empty (contains no set bit)
-
intersection
Description copied from interface:ImmutableBitmapCompute 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:
intersectionin interfaceImmutableBitmap- Parameters:
otherBitmap- other bitmap
-
union
Description copied from interface:ImmutableBitmapCompute the bitwise-or 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:
unionin interfaceImmutableBitmap- Parameters:
otherBitmap- other bitmap
-
get
public boolean get(int value) Description copied from interface:ImmutableBitmapReturns true if the bit at position value is set- Specified by:
getin interfaceImmutableBitmap- Parameters:
value- the position to check- Returns:
- true if bit is set
-