public interface ImmutableBitmapDataProvider
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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()).
|
int |
select(int j)
Return the jth value stored in this bitmap.
|
void |
serialize(DataOutput out)
Serialize this bitmap.
|
int |
serializedSizeInBytes()
Report the number of bytes required to serialize this bitmap.
|
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()
int getSizeInBytes()
long getLongSizeInBytes()
boolean isEmpty()
ImmutableBitmapDataProvider limit(int x)
x
- maximal cardinalityint rank(int x)
x
- upper limitlong rankLong(int x)
x
- upper limitint select(int j)
j
- index of the valueint first()
NoSuchElementException
- if emptyint last()
NoSuchElementException
- if emptyvoid serialize(DataOutput out) throws IOException
out
- the DataOutput streamIOException
- Signals that an I/O exception has occurred.int serializedSizeInBytes()
int[] toArray()
Copyright © 2018. All rights reserved.