public interface ImmutableBitmapDataProvider
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
ImmutableBitmapDataProvider.RoaringOfInt
An internal class to help provide streams.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
contains(int x)
Checks whether the value in included, which is equivalent to checking if the corresponding bit
is set (get in BitSet class).
|
int |
first()
Get the first (smallest) integer in this RoaringBitmap,
that is, returns the minimum of the set.
|
void |
forEach(IntConsumer ic)
Visit all values in the bitmap and pass them to the consumer
|
BatchIterator |
getBatchIterator()
This iterator may be faster than others
|
int |
getCardinality()
Returns the number of distinct integers added to the bitmap (e.g., number of bits set).
|
PeekableIntIterator |
getIntIterator()
For better performance, consider the Use the
forEach method. |
long |
getLongCardinality()
Returns the number of distinct integers added to the bitmap (e.g., number of bits set).
|
long |
getLongSizeInBytes()
Estimate of the memory usage of this data structure.
|
IntIterator |
getReverseIntIterator() |
int |
getSizeInBytes()
Estimate of the memory usage of this data structure.
|
boolean |
isEmpty()
Checks whether the bitmap is empty.
|
int |
last()
Get the last (largest) integer in this RoaringBitmap,
that is, returns the maximum of the set.
|
ImmutableBitmapDataProvider |
limit(int x)
Create a new bitmap of the same class, containing at most maxcardinality integers.
|
long |
nextAbsentValue(int fromValue)
Returns the first absent value equal to or larger than the provided
value (interpreted as an unsigned integer).
|
long |
nextValue(int fromValue)
Returns the first value equal to or larger than the provided value
(interpreted as an unsigned integer).
|
long |
previousAbsentValue(int fromValue)
Returns the first absent value less than or equal to the provided
value (interpreted as an unsigned integer).
|
long |
previousValue(int fromValue)
Returns the first value less than or equal to the provided value
(interpreted as an unsigned integer).
|
long |
rangeCardinality(long start,
long end)
Computes the number of values in the interval [start,end) where
start is included and end excluded.
|
int |
rank(int x)
Rank returns the number of integers that are smaller or equal to x (rank(infinity) would be
getCardinality()).
|
long |
rankLong(int x)
Rank returns the number of integers that are smaller or equal to x (rankLong(infinity) would be
getLongCardinality()).
|
default java.util.stream.IntStream |
reverseStream() |
int |
select(int j)
Return the jth value stored in this bitmap.
|
void |
serialize(java.nio.ByteBuffer buffer)
Serialize this bitmap to a ByteBuffer.
|
void |
serialize(java.io.DataOutput out)
Serialize this bitmap.
|
int |
serializedSizeInBytes()
Report the number of bytes required to serialize this bitmap.
|
default java.util.stream.IntStream |
stream() |
int[] |
toArray()
Return the set values as an array.
|
boolean contains(int x)
x - integer valueint getCardinality()
long getLongCardinality()
void forEach(IntConsumer ic)
bitmap.forEach(new IntConsumer() {
{@literal @}Override
public void accept(int value) {
// do something here
}});
}
ic - the consumerPeekableIntIterator getIntIterator()
forEach method.IntIterator getReverseIntIterator()
default java.util.stream.IntStream stream()
default java.util.stream.IntStream reverseStream()
BatchIterator getBatchIterator()
int getSizeInBytes()
long getLongSizeInBytes()
boolean isEmpty()
ImmutableBitmapDataProvider limit(int x)
x - maximal cardinalityint rank(int x)
x - upper limitlong rankLong(int x)
x - upper limitlong rangeCardinality(long start,
long end)
start - lower limit (included)end - upper limit (excluded)int select(int j)
j - index of the valueint first()
java.util.NoSuchElementException - if emptyint last()
java.util.NoSuchElementException - if emptylong nextValue(int fromValue)
-1 is returned. It is not necessarily a
computationally effective way to iterate through the values.fromValue - the lower bound (inclusive)-1 if there is no such valuelong previousValue(int fromValue)
-1 is returned. It is not an efficient
way to iterate through the values backwards.fromValue - the upper bound (inclusive)-1 if there is no such valuelong nextAbsentValue(int fromValue)
fromValue - the lower bound (inclusive)long previousAbsentValue(int fromValue)
fromValue - the lower bound (inclusive)void serialize(java.io.DataOutput out)
throws java.io.IOException
out - the DataOutput streamjava.io.IOException - Signals that an I/O exception has occurred.void serialize(java.nio.ByteBuffer buffer)
byte[] array = new byte[mrb.serializedSizeInBytes()];
mrb.serialize(ByteBuffer.wrap(array));
buffer - the ByteBufferint serializedSizeInBytes()
int[] toArray()