Class FastRankRoaringBitmap

java.lang.Object
org.roaringbitmap.RoaringBitmap
org.roaringbitmap.FastRankRoaringBitmap
All Implemented Interfaces:
Externalizable, Serializable, Cloneable, Iterable<Integer>, AppendableStorage<Container>, BitmapDataProvider, ImmutableBitmapDataProvider

public class FastRankRoaringBitmap extends RoaringBitmap
This extends 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
See Also: