public class FastRankRoaringBitmap extends RoaringBitmap
RoaringBitmap to provide better performance for .rank and .select
operations, at the cost of maintain a cache of cardinalities.
On RoaringBitmap.select(int) and RoaringBitmap.rank(int) operations,
RoaringBitmap needs to iterate along all underlying buckets to cumulate their
cardinalities. This may lead to sub-optimal performance for application doing a large amount of
.rank/.select over read-only RoaringBitmap, especially if the RoaringBitmap holds
a large number of underlying buckets.
This implementation will discard the cache of cardinality on any write operations, and it will
memoize the computed cardinalities on any .rank or .select operation| Constructor and Description |
|---|
FastRankRoaringBitmap() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int... dat)
Set all the specified values to true.
|
void |
add(int x)
Add the value to the container (set the value to "true"), whether it already appears or not.
|
void |
add(int rangeStart,
int rangeEnd)
Deprecated.
|
void |
add(long rangeStart,
long rangeEnd)
Add to the current bitmap all integers in [rangeStart,rangeEnd).
|
void |
and(RoaringBitmap x2)
In-place bitwise AND (intersection) operation.
|
void |
andNot(RoaringBitmap x2)
In-place bitwise ANDNOT (difference) operation.
|
boolean |
checkedAdd(int x)
Add the value to the container (set the value to "true"), whether it already appears or not.
|
boolean |
checkedRemove(int x)
If present remove the specified integer (effectively, sets its bit value to false)
|
void |
clear()
reset to an empty bitmap; result occupies as much space a newly created bitmap.
|
void |
flip(int x)
Add the value if it is not already present, otherwise remove it.
|
void |
flip(int rangeStart,
int rangeEnd)
Deprecated.
|
void |
flip(long rangeStart,
long rangeEnd)
Modifies the current bitmap by complementing the bits in the given range, from rangeStart
(inclusive) rangeEnd (exclusive).
|
void |
or(RoaringBitmap x2)
In-place bitwise OR (union) operation.
|
long |
rankLong(int x)
Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be
GetCardinality()).
|
void |
remove(int x)
If present remove the specified integer (effectively, sets its bit value to false)
|
void |
remove(int rangeStart,
int rangeEnd)
Deprecated.
|
void |
remove(long rangeStart,
long rangeEnd)
Remove from the current bitmap all integers in [rangeStart,rangeEnd).
|
int |
select(int j)
Return the jth value stored in this bitmap.
|
void |
xor(RoaringBitmap x2)
In-place bitwise XOR (symmetric difference) operation.
|
add, add, and, and, and, andCardinality, andNot, andNot, andNot, andNotCardinality, bitmapOf, bitmapOfUnordered, clone, contains, contains, deserialize, equals, first, flip, flip, forEach, getCardinality, getContainerPointer, getIntIterator, getLongCardinality, getLongSizeInBytes, getReverseIntIterator, getSizeInBytes, hashCode, hasRunCompression, intersects, isEmpty, isHammingSimilar, iterator, last, lazyor, lazyor, lazyorfromlazyinputs, limit, maximumSerializedSize, naivelazyor, or, or, or, or, or, orCardinality, rank, readExternal, remove, remove, removeRunCompression, repairAfterLazy, runOptimize, serialize, serializedSizeInBytes, toArray, toMutableRoaringBitmap, toString, trim, writeExternal, xor, xor, xor, xorCardinalityfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic void add(long rangeStart,
long rangeEnd)
RoaringBitmapadd in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void add(int x)
RoaringBitmapInteger.compareUnsigned(int, int).
We order the numbers like 0, 1, ..., 2147483647, -2147483648, -2147483647,..., -1.add in interface BitmapDataProvideradd in class RoaringBitmapx - integer valuepublic void add(int... dat)
RoaringBitmapadd in class RoaringBitmapdat - set values@Deprecated public void add(int rangeStart, int rangeEnd)
RoaringBitmapadd in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void clear()
RoaringBitmapclear in class RoaringBitmappublic void flip(int x)
RoaringBitmapflip in class RoaringBitmapx - integer value@Deprecated public void flip(int rangeStart, int rangeEnd)
RoaringBitmapflip in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void flip(long rangeStart,
long rangeEnd)
RoaringBitmapflip in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void and(RoaringBitmap x2)
RoaringBitmapand in class RoaringBitmapx2 - other bitmappublic void andNot(RoaringBitmap x2)
RoaringBitmapandNot in class RoaringBitmapx2 - other bitmap@Deprecated public void remove(int rangeStart, int rangeEnd)
RoaringBitmapremove in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void remove(int x)
RoaringBitmapremove in interface BitmapDataProviderremove in class RoaringBitmapx - integer value representing the index in a bitmappublic void remove(long rangeStart,
long rangeEnd)
RoaringBitmapremove in class RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic boolean checkedAdd(int x)
RoaringBitmapcheckedAdd in class RoaringBitmapx - integer valuepublic boolean checkedRemove(int x)
RoaringBitmapcheckedRemove in class RoaringBitmapx - integer value representing the index in a bitmappublic void or(RoaringBitmap x2)
RoaringBitmapor in class RoaringBitmapx2 - other bitmappublic void xor(RoaringBitmap x2)
RoaringBitmapxor in class RoaringBitmapx2 - other bitmappublic long rankLong(int x)
RoaringBitmaprankLong in interface ImmutableBitmapDataProviderrankLong in class RoaringBitmapx - upper limitpublic int select(int j)
RoaringBitmapselect in interface ImmutableBitmapDataProviderselect in class RoaringBitmapj - index of the valueCopyright © 2017. All rights reserved.