Class WrappedImmutableBitSetBitmap
- java.lang.Object
-
- org.apache.druid.collections.bitmap.WrappedImmutableBitSetBitmap
-
- All Implemented Interfaces:
ImmutableBitmap
- Direct Known Subclasses:
WrappedBitSetBitmap
public class WrappedImmutableBitSetBitmap extends Object implements ImmutableBitmap
WrappedImmutableBitSetBitmap implements ImmutableBitmap for java.util.BitSet
-
-
Constructor Summary
Constructors Constructor Description WrappedImmutableBitSetBitmap()
WrappedImmutableBitSetBitmap(ByteBuffer byteBuffer)
WrappedImmutableBitSetBitmap(BitSet bitmap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
get(int value)
Returns true if the bit at position value is setImmutableBitmap
intersection(ImmutableBitmap otherBitmap)
Compute the bitwise-and of this bitmap with another bitmap.boolean
isEmpty()
org.roaringbitmap.IntIterator
iterator()
int
size()
byte[]
toBytes()
ImmutableBitmap
union(ImmutableBitmap otherBitmap)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.collections.bitmap.ImmutableBitmap
batchIterator, peekableIterator
-
-
-
-
Field Detail
-
bitmap
protected final BitSet bitmap
-
-
Constructor Detail
-
WrappedImmutableBitSetBitmap
public WrappedImmutableBitSetBitmap(BitSet bitmap)
-
WrappedImmutableBitSetBitmap
public WrappedImmutableBitSetBitmap()
-
WrappedImmutableBitSetBitmap
public WrappedImmutableBitSetBitmap(ByteBuffer byteBuffer)
-
-
Method Detail
-
iterator
public org.roaringbitmap.IntIterator iterator()
- Specified by:
iterator
in interfaceImmutableBitmap
- Returns:
- an iterator over the set bits of this 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
-
size
public int size()
- Specified by:
size
in interfaceImmutableBitmap
- Returns:
- The number of bits set to true in this bitmap
-
toBytes
public byte[] toBytes()
- Specified by:
toBytes
in interfaceImmutableBitmap
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceImmutableBitmap
- Returns:
- True if this bitmap is empty (contains no set bit)
-
union
public ImmutableBitmap union(ImmutableBitmap otherBitmap)
-
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
-
-