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 operationImmutableBitmapDataProvider.RoaringOfInthighLowContainer| 构造器和说明 |
|---|
FastRankRoaringBitmap() |
FastRankRoaringBitmap(RoaringArray array) |
| 限定符和类型 | 方法和说明 |
|---|---|
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)
已过时。
|
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)
已过时。
|
void |
flip(long rangeStart,
long rangeEnd)
Modifies the current bitmap by complementing the bits in the given range, from rangeStart
(inclusive) rangeEnd (exclusive).
|
PeekableIntRankIterator |
getIntRankIterator()
Get a special iterator that allows .peekNextRank efficiently
|
long |
getLongSizeInBytes()
Estimate of the memory usage of this data structure.
|
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)
已过时。
|
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, addN, addOffset, and, and, and, andCardinality, andNot, andNot, andNot, andNotCardinality, append, bitmapOf, bitmapOfRange, bitmapOfUnordered, cardinalityExceeds, clone, contains, contains, contains, deserialize, deserialize, deserialize, equals, first, flip, flip, forAllInRange, forEach, forEachInRange, getBatchIterator, getCardinality, getContainerPointer, getIntIterator, getLongCardinality, getReverseIntIterator, getSizeInBytes, hashCode, hasRunCompression, intersects, intersects, isEmpty, isHammingSimilar, iterator, last, lazyor, lazyor, lazyorfromlazyinputs, limit, maximumSerializedSize, naivelazyor, nextAbsentValue, nextValue, or, or, or, or, or, orCardinality, orNot, orNot, previousAbsentValue, previousValue, rangeCardinality, rank, readExternal, remove, remove, removeRunCompression, repairAfterLazy, runOptimize, serialize, serialize, serializedSizeInBytes, toArray, toMutableRoaringBitmap, toString, trim, writeExternal, xor, xor, xor, xorCardinalityreverseStream, streampublic FastRankRoaringBitmap()
public FastRankRoaringBitmap(RoaringArray array)
public void add(long rangeStart,
long rangeEnd)
RoaringBitmapadd 在接口中 BitmapDataProvideradd 在类中 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 在接口中 BitmapDataProvideradd 在类中 RoaringBitmapx - integer valuepublic void add(int... dat)
RoaringBitmapadd 在类中 RoaringBitmapdat - set values@Deprecated
public void add(int rangeStart,
int rangeEnd)
RoaringBitmapadd 在类中 RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void clear()
RoaringBitmapclear 在类中 RoaringBitmappublic void flip(int x)
RoaringBitmapflip 在类中 RoaringBitmapx - integer value@Deprecated
public void flip(int rangeStart,
int rangeEnd)
RoaringBitmapflip 在类中 RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void flip(long rangeStart,
long rangeEnd)
RoaringBitmapflip 在类中 RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void and(RoaringBitmap x2)
RoaringBitmapand 在类中 RoaringBitmapx2 - other bitmappublic void andNot(RoaringBitmap x2)
RoaringBitmapandNot 在类中 RoaringBitmapx2 - other bitmap@Deprecated
public void remove(int rangeStart,
int rangeEnd)
RoaringBitmapremove 在类中 RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic void remove(int x)
RoaringBitmapremove 在接口中 BitmapDataProviderremove 在类中 RoaringBitmapx - integer value representing the index in a bitmappublic void remove(long rangeStart,
long rangeEnd)
RoaringBitmapremove 在类中 RoaringBitmaprangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic boolean checkedAdd(int x)
RoaringBitmapcheckedAdd 在类中 RoaringBitmapx - integer valuepublic boolean checkedRemove(int x)
RoaringBitmapcheckedRemove 在类中 RoaringBitmapx - integer value representing the index in a bitmappublic void or(RoaringBitmap x2)
RoaringBitmapor 在类中 RoaringBitmapx2 - other bitmappublic void xor(RoaringBitmap x2)
RoaringBitmapxor 在类中 RoaringBitmapx2 - other bitmappublic long rankLong(int x)
RoaringBitmaprankLong 在接口中 ImmutableBitmapDataProviderrankLong 在类中 RoaringBitmapx - upper limitpublic int select(int j)
RoaringBitmapselect 在接口中 ImmutableBitmapDataProviderselect 在类中 RoaringBitmapj - index of the valuepublic long getLongSizeInBytes()
RoaringBitmapgetLongSizeInBytes 在接口中 ImmutableBitmapDataProvidergetLongSizeInBytes 在类中 RoaringBitmappublic PeekableIntRankIterator getIntRankIterator()