Package org.roaringbitmap
Class RangeBitmap
- java.lang.Object
-
- org.roaringbitmap.RangeBitmap
-
public final class RangeBitmap extends java.lang.ObjectA 2D bitmap which associates values with a row index and can perform range queries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRangeBitmap.AppenderBuilder for constructing immutable RangeBitmaps
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RangeBitmap.Appenderappender(long maxValue)Append values to the RangeBitmap before sealing it, defaults to on heap ByteBuffers.static RangeBitmap.Appenderappender(long maxValue, java.util.function.IntFunction<java.nio.ByteBuffer> bufferSupplier, java.util.function.Consumer<java.nio.ByteBuffer> cleaner)Append values to the RangeBitmap before sealing it.RoaringBitmapbetween(long min, long max)Returns a RoaringBitmap of rows which have a value in between the thresholds.RoaringBitmapgt(long threshold)Returns a RoaringBitmap of rows which have a value greater than the threshold.RoaringBitmapgt(long threshold, RoaringBitmap context)Returns a RoaringBitmap of rows which have a value greater than the threshold, and intersect with the context bitmap, which will not be modified.RoaringBitmapgte(long threshold)Returns a RoaringBitmap of rows which have a value greater than or equal to the threshold.RoaringBitmapgte(long threshold, RoaringBitmap context)Returns a RoaringBitmap of rows which have a value greater than or equal to the threshold, and intersect with the context bitmap, which will not be modified.RoaringBitmaplt(long threshold)Returns a RoaringBitmap of rows which have a value less than the threshold.RoaringBitmaplt(long threshold, RoaringBitmap context)Returns a RoaringBitmap of rows which have a value less than the threshold, and intersect with the context bitmap, which will not be modified.RoaringBitmaplte(long threshold)Returns a RoaringBitmap of rows which have a value less than or equal to the threshold.RoaringBitmaplte(long threshold, RoaringBitmap context)Returns a RoaringBitmap of rows which have a value less than or equal to the threshold, and intersect with the context bitmap, which will not be modified.static RangeBitmapmap(java.nio.ByteBuffer buffer)Maps the RangeBitmap from the buffer with minimal allocation.
-
-
-
Method Detail
-
appender
public static RangeBitmap.Appender appender(long maxValue, java.util.function.IntFunction<java.nio.ByteBuffer> bufferSupplier, java.util.function.Consumer<java.nio.ByteBuffer> cleaner)
Append values to the RangeBitmap before sealing it.- Parameters:
maxValue- the maximum value to be appended, values larger than this value will be rejected.bufferSupplier- provides ByteBuffers.- Returns:
- an appender.
-
appender
public static RangeBitmap.Appender appender(long maxValue)
Append values to the RangeBitmap before sealing it, defaults to on heap ByteBuffers.- Parameters:
maxValue- the maximum value to be appended, values larger than this value will be rejected.- Returns:
- an appender.
-
map
public static RangeBitmap map(java.nio.ByteBuffer buffer)
Maps the RangeBitmap from the buffer with minimal allocation. The buffer must not be reused while the mapped RangeBitmap is live.- Parameters:
buffer- a buffer containing a serialized RangeBitmap.- Returns:
- a RangeBitmap backed by the buffer.
-
between
public RoaringBitmap between(long min, long max)
Returns a RoaringBitmap of rows which have a value in between the thresholds.- Parameters:
min- the inclusive minimum value.max- the inclusive maximum value.- Returns:
- a bitmap of matching rows.
-
lte
public RoaringBitmap lte(long threshold)
Returns a RoaringBitmap of rows which have a value less than or equal to the threshold.- Parameters:
threshold- the inclusive maximum value.- Returns:
- a bitmap of matching rows.
-
lte
public RoaringBitmap lte(long threshold, RoaringBitmap context)
Returns a RoaringBitmap of rows which have a value less than or equal to the threshold, and intersect with the context bitmap, which will not be modified.- Parameters:
threshold- the inclusive maximum value.context- to be intersected with.- Returns:
- a bitmap of matching rows.
-
lt
public RoaringBitmap lt(long threshold)
Returns a RoaringBitmap of rows which have a value less than the threshold.- Parameters:
threshold- the exclusive maximum value.- Returns:
- a bitmap of matching rows.
-
lt
public RoaringBitmap lt(long threshold, RoaringBitmap context)
Returns a RoaringBitmap of rows which have a value less than the threshold, and intersect with the context bitmap, which will not be modified.- Parameters:
threshold- the exclusive maximum value.context- to be intersected with.- Returns:
- a bitmap of matching rows which intersect .
-
gt
public RoaringBitmap gt(long threshold)
Returns a RoaringBitmap of rows which have a value greater than the threshold.- Parameters:
threshold- the exclusive minimum value.- Returns:
- a bitmap of matching rows.
-
gt
public RoaringBitmap gt(long threshold, RoaringBitmap context)
Returns a RoaringBitmap of rows which have a value greater than the threshold, and intersect with the context bitmap, which will not be modified.- Parameters:
threshold- the exclusive minimum value.context- to be intersected with.- Returns:
- a bitmap of matching rows.
-
gte
public RoaringBitmap gte(long threshold)
Returns a RoaringBitmap of rows which have a value greater than or equal to the threshold.- Parameters:
threshold- the inclusive minimum value.- Returns:
- a bitmap of matching rows.
-
gte
public RoaringBitmap gte(long threshold, RoaringBitmap context)
Returns a RoaringBitmap of rows which have a value greater than or equal to the threshold, and intersect with the context bitmap, which will not be modified.- Parameters:
threshold- the inclusive minimum value.context- to be intersected with.- Returns:
- a bitmap of matching rows.
-
-