public class OptimizedRoaringBitmap64 extends Object
Mostly copied from iceberg.
Modifier and Type | Field and Description |
---|---|
static long |
MAX_VALUE |
Constructor and Description |
---|
OptimizedRoaringBitmap64() |
Modifier and Type | Method and Description |
---|---|
void |
add(long pos)
Sets a position in the bitmap.
|
void |
addRange(long posStartInclusive,
long posEndExclusive)
Sets a range of positions in the bitmap.
|
long |
cardinality()
Returns the number of set positions in the bitmap.
|
boolean |
contains(long pos)
Checks if a position is set in the bitmap.
|
static OptimizedRoaringBitmap64 |
deserialize(ByteBuffer buffer)
Deserializes a bitmap from a buffer, assuming the portable serialization format.
|
void |
forEach(java.util.function.LongConsumer consumer)
Iterates over all positions in the bitmap.
|
static OptimizedRoaringBitmap64 |
fromRoaringBitmap32(RoaringBitmap32 roaringBitmap32) |
boolean |
isEmpty()
Indicates whether the bitmap has any positions set.
|
void |
or(OptimizedRoaringBitmap64 that)
Sets all positions from the other bitmap in this bitmap, modifying this bitmap in place.
|
boolean |
runLengthEncode()
Applies run-length encoding wherever it is more space efficient.
|
void |
serialize(ByteBuffer buffer)
Serializes the bitmap using the portable serialization format described below.
|
long |
serializedSizeInBytes()
Returns the number of bytes required to serialize the bitmap.
|
public static OptimizedRoaringBitmap64 fromRoaringBitmap32(RoaringBitmap32 roaringBitmap32)
public void add(long pos)
pos
- the positionpublic void addRange(long posStartInclusive, long posEndExclusive)
posStartInclusive
- the start position of the range (inclusive)posEndExclusive
- the end position of the range (exclusive)public void or(OptimizedRoaringBitmap64 that)
that
- the other bitmappublic boolean contains(long pos)
pos
- the positionpublic boolean isEmpty()
public long cardinality()
public boolean runLengthEncode()
public void forEach(java.util.function.LongConsumer consumer)
consumer
- a consumer for positionspublic long serializedSizeInBytes()
public void serialize(ByteBuffer buffer)
Note the byte order of the buffer must be little-endian.
buffer
- the buffer to write topublic static OptimizedRoaringBitmap64 deserialize(ByteBuffer buffer)
buffer
- the buffer to read fromCopyright © 2023–2025 The Apache Software Foundation. All rights reserved.