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 voidadd(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 setConciseSetgetBitmap()intgetSizeInBytes()Return the size in bytes for the purpose of serialization to a ByteBuffer.ImmutableBitmapintersection(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.PeekableIntIteratorpeekableIterator()voidremove(int entry)Remove the specified integer to the bitmap.intsize()byte[]toBytes()StringtoString()ImmutableBitmapunion(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, 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:
toBytesin interfaceImmutableBitmap
-
clear
public void clear()
Description copied from interface:MutableBitmapEmpties the content of this bitmap.- Specified by:
clearin interfaceMutableBitmap
-
or
public void or(MutableBitmap mutableBitmap)
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
-
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
public ImmutableBitmap intersection(ImmutableBitmap otherBitmap)
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
public ImmutableBitmap union(ImmutableBitmap otherBitmap)
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
-
-