java.lang.Object
org.bitlap.roaringbitmap.longlong.Roaring64NavigableMap
Roaring64NavigableMap extends RoaringBitmap to the whole range of longs (or unsigned longs). It
enables a greater cardinality, up to 2*Long.MAX_VALUE-1
Longs are added by default in unsigned sorted order (i.e. -1L is the greatest long to be added
while 0 has no previous value). It can be configured to signed sorted order (in which case, 0 is
preceded by -1). That is, they are treated as unsigned integers (see Java 8's
Integer.toUnsignedLong function). Up to 4294967296 integers can be stored.
- 另请参阅:
-
嵌套类概要
从接口继承的嵌套类/接口 org.bitlap.roaringbitmap.longlong.ImmutableLongBitmapDataProvider
ImmutableLongBitmapDataProvider.RoaringOfLong -
字段概要
字段修饰符和类型字段说明static intstatic final intstatic final int -
构造器概要
构造器构造器说明By default, we consider longs are unsigned longs: normal longs: 0 is the lowest possible long.Roaring64NavigableMap(boolean signedLongs) By default, use RoaringBitmap as underlyingsBitmapDataProviderRoaring64NavigableMap(boolean signedLongs, boolean cacheCardinalities) By default, use RoaringBitmap as underlyingsBitmapDataProviderRoaring64NavigableMap(boolean signedLongs, boolean cacheCardinalities, BitmapDataProviderSupplier supplier) Roaring64NavigableMap(boolean signedLongs, BitmapDataProviderSupplier supplier) By default, we activating cardinalities caching.By default, longs are managed as unsigned longs and cardinalities are cached. -
方法概要
修饰符和类型方法说明voidadd(long... dat) Set all the specified values to true.voidadd(long rangeStart, long rangeEnd) 已过时。as this may be confused with adding individual longsvoidaddInt(int x) Add the integer value to the container (set the value to "true"), whether it already appears or not.voidaddLong(long x) Add the value to the container (set the value to "true"), whether it already appears or not.voidaddRange(long rangeStart, long rangeEnd) Add to the current bitmap all longs in [rangeStart,rangeEnd).voidIn-place bitwise AND (intersection) operation.voidIn-place bitwise ANDNOT (difference) operation.static Roaring64NavigableMapbitmapOf(long... dat) Generate a bitmap with the specified values set to true.voidclear()reset to an empty bitmap; result occupies as much space a newly created bitmap.booleancontains(long x) Checks whether the value in included, which is equivalent to checking if the corresponding bit is set (get in BitSet class).voiddeserialize(DataInput in) Deserialize (retrieve) this bitmap.voidDeserialize (retrieve) this bitmap.voidDeserialize (retrieve) this bitmap.protected intensureCumulatives(int high) booleanlongfirst()Get the first (smallest) integer in this RoaringBitmap, that is, return the minimum of the set.voidflip(long x) Add the value if it is not already present, otherwise remove it.voidforEach(LongConsumer lc) Visit all values in the bitmap and pass them to the consumerintlongReturns the number of distinct integers added to the bitmap (e.g., number of bits set).For better performance, consider the Use theforEachmethod.longEstimate of the memory usage of this data structure.intEstimate of the memory usage of this data structure.inthashCode()booleanisEmpty()Checks whether the bitmap is empty.iterator()For better performance, consider the Use theforEachmethod.longlast()Get the last (largest) integer in this RoaringBitmap, that is, return the maximum of the set.limit(long x) Create a new bitmap of the same class, containing at most maxcardinality integers.voidIn-place bitwise OR (union) operation without maintaining cardinality.voidIn-place bitwise OR (union) operation.longrankLong(long id) Rank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()).voidvoidremoveLong(long x) If present remove the specified integers (effectively, sets its bit value to false)voidto be used with naivelazyorbooleanUse a run-length encoding where it is estimated as more space efficientlongselect(long j) Return the jth value stored in this bitmap.voidserialize(DataOutput out) Serialize this bitmap.longReport the number of bytes required to serialize this bitmap.void已过时。voidSerialize this bitmap.long[]toArray()Return the set values as an array, if the cardinality is smaller than 2147483648.protected LongIteratortoIterator(Iterator<Map.Entry<Integer, BitmapDataProvider>> it, boolean reversed) toString()A string describing the bitmap.voidtrim()Recover allocated but unused memory.voidRoaring64NavigableMapare serializable.voidIn-place bitwise XOR (symmetric difference) operation.从接口继承的方法 org.bitlap.roaringbitmap.longlong.ImmutableLongBitmapDataProvider
reverseStream, stream
-
字段详细资料
-
构造器详细资料
-
Roaring64NavigableMap
public Roaring64NavigableMap()By default, we consider longs are unsigned longs: normal longs: 0 is the lowest possible long. Long.MAX_VALUE is followed by Long.MIN_VALUE. -1L is the highest possible value -
Roaring64NavigableMap
public Roaring64NavigableMap(boolean signedLongs) By default, use RoaringBitmap as underlyingsBitmapDataProvider- 参数:
signedLongs- true if longs has to be ordered as plain java longs. False to handle them as unsigned 64bits long (as RoaringBitmap with unsigned integers)
-
Roaring64NavigableMap
public Roaring64NavigableMap(boolean signedLongs, boolean cacheCardinalities) By default, use RoaringBitmap as underlyingsBitmapDataProvider- 参数:
signedLongs- true if longs has to be ordered as plain java longs. False to handle them as unsigned 64bits long (as RoaringBitmap with unsigned integers)cacheCardinalities- true if cardinalities have to be cached. It will prevent many iteration along the NavigableMap
-
Roaring64NavigableMap
By default, longs are managed as unsigned longs and cardinalities are cached.- 参数:
supplier- provide the logic to instantiate newBitmapDataProvider, typically instantiated once per high.
-
Roaring64NavigableMap
By default, we activating cardinalities caching.- 参数:
signedLongs- true if longs has to be ordered as plain java longs. False to handle them as unsigned 64bits long (as RoaringBitmap with unsigned integers)supplier- provide the logic to instantiate newBitmapDataProvider, typically instantiated once per high.
-
Roaring64NavigableMap
public Roaring64NavigableMap(boolean signedLongs, boolean cacheCardinalities, BitmapDataProviderSupplier supplier) - 参数:
signedLongs- true if longs has to be ordered as plain java longs. False to handle them as unsigned 64bits long (as RoaringBitmap with unsigned integers)cacheCardinalities- true if cardinalities have to be cached. It will prevent many iteration along the NavigableMapsupplier- provide the logic to instantiate newBitmapDataProvider, typically instantiated once per high.
-
-
方法详细资料
-
addLong
public void addLong(long x) Add the value to the container (set the value to "true"), whether it already appears or not. Java lacks native unsigned longs but the x argument is considered to be unsigned. Within bitmaps, numbers are ordered according toLong.compareUnsigned(long, long). We order the numbers like 0, 1, ..., 9223372036854775807, -9223372036854775808, -9223372036854775807,..., -1.- 指定者:
addLong在接口中LongBitmapDataProvider- 参数:
x- long value
-
addInt
public void addInt(int x) Add the integer value to the container (set the value to "true"), whether it already appears or not. Javac lacks native unsigned integers but the x argument is considered to be unsigned. Within bitmaps, numbers are ordered according toInteger.compareUnsigned(int, int). We order the numbers like 0, 1, ..., 2147483647, -2147483648, -2147483647,..., -1.- 参数:
x- integer value
-
getLongCardinality
public long getLongCardinality()Returns the number of distinct integers added to the bitmap (e.g., number of bits set).- 指定者:
getLongCardinality在接口中ImmutableLongBitmapDataProvider- 返回:
- the cardinality
-
getIntCardinality
- 返回:
- the cardinality as an int
- 抛出:
UnsupportedOperationException- if the cardinality does not fit in an int
-
select
Return the jth value stored in this bitmap.- 指定者:
select在接口中ImmutableLongBitmapDataProvider- 参数:
j- index of the value- 返回:
- the value
- 抛出:
IllegalArgumentException- if j is out of the bounds of the bitmap cardinality
-
iterator
For better performance, consider the Use theforEachmethod.- 返回:
- a custom iterator over set bits, the bits are traversed in ascending sorted order
-
forEach
从接口复制的说明:ImmutableLongBitmapDataProviderVisit all values in the bitmap and pass them to the consumer. * Usage:bitmap.forEach(new LongConsumer() { {@literal @}Override public void accept(long value) { // do something here }});}- 指定者:
forEach在接口中ImmutableLongBitmapDataProvider- 参数:
lc- the consumer
-
rankLong
public long rankLong(long id) 从接口复制的说明:ImmutableLongBitmapDataProviderRank returns the number of integers that are smaller or equal to x (Rank(infinity) would be GetCardinality()). The value is a full 64-bit value.- 指定者:
rankLong在接口中ImmutableLongBitmapDataProvider- 参数:
id- upper limit- 返回:
- the rank
-
ensureCumulatives
protected int ensureCumulatives(int high) - 参数:
high- for which high bucket should we compute the cardinality- 返回:
- the highest validatedIndex
-
writeExternal
Roaring64NavigableMapare serializable. However, contrary to RoaringBitmap, the serialization format is not well-defined: for now, it is strongly coupled with Java standard serialization. Just like the serialization may be incompatible between various Java versions,Roaring64NavigableMapare subject to incompatibilities. Moreover, even on a given Java versions, the serialization format may change from one RoaringBitmap version to another- 指定者:
writeExternal在接口中Externalizable- 抛出:
IOException
-
readExternal
- 指定者:
readExternal在接口中Externalizable- 抛出:
IOExceptionClassNotFoundException
-
toString
A string describing the bitmap. -
getLongIterator
For better performance, consider the Use theforEachmethod.- 指定者:
getLongIterator在接口中ImmutableLongBitmapDataProvider- 返回:
- a custom iterator over set bits, the bits are traversed in ascending sorted order
-
toIterator
protected LongIterator toIterator(Iterator<Map.Entry<Integer, BitmapDataProvider>> it, boolean reversed) -
contains
public boolean contains(long x) 从接口复制的说明:ImmutableLongBitmapDataProviderChecks whether the value in included, which is equivalent to checking if the corresponding bit is set (get in BitSet class).- 指定者:
contains在接口中ImmutableLongBitmapDataProvider- 参数:
x- long value- 返回:
- whether the long value is included.
-
getSizeInBytes
public int getSizeInBytes()从接口复制的说明:ImmutableLongBitmapDataProviderEstimate of the memory usage of this data structure. Internally, this is computed as a 64-bit counter.- 指定者:
getSizeInBytes在接口中ImmutableLongBitmapDataProvider- 返回:
- estimated memory usage.
-
getLongSizeInBytes
public long getLongSizeInBytes()从接口复制的说明:ImmutableLongBitmapDataProviderEstimate of the memory usage of this data structure. Provides full 64-bit number.- 指定者:
getLongSizeInBytes在接口中ImmutableLongBitmapDataProvider- 返回:
- estimated memory usage.
-
isEmpty
public boolean isEmpty()从接口复制的说明:ImmutableLongBitmapDataProviderChecks whether the bitmap is empty.- 指定者:
isEmpty在接口中ImmutableLongBitmapDataProvider- 返回:
- true if this bitmap contains no set bit
-
limit
从接口复制的说明:ImmutableLongBitmapDataProviderCreate a new bitmap of the same class, containing at most maxcardinality integers.- 指定者:
limit在接口中ImmutableLongBitmapDataProvider- 参数:
x- maximal cardinality- 返回:
- a new bitmap with cardinality no more than maxcardinality
-
repairAfterLazy
public void repairAfterLazy()to be used with naivelazyor -
runOptimize
public boolean runOptimize()Use a run-length encoding where it is estimated as more space efficient- 返回:
- whether a change was applied
-
serialize
Serialize this bitmap. If SERIALIZATION_MODE is set to SERIALIZATION_MODE_PORTABLE, this will rely on the specification at https://github.com/RoaringBitmap/RoaringFormatSpec#extention-for-64-bit-implementations. As of 0.x, this is **not** the default behavior. Consider callingrunOptimize()before serialization to improve compression. The current bitmap is not modified.- 指定者:
serialize在接口中ImmutableLongBitmapDataProvider- 参数:
out- the DataOutput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
serializeLegacy
已过时。Serialize this bitmap. This format was introduced before converting with CRoaring portable format. It remains useful when considering signed longs. It is the default in 0.x Consider callingrunOptimize()before serialization to improve compression. The current bitmap is not modified.- 参数:
out- the DataOutput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
serializePortable
Serialize this bitmap. The format is specified at https://github.com/RoaringBitmap/RoaringFormatSpec#extention-for-64-bit-implementations. It is the compatible with CRoaring (and GoRoaring). Consider callingrunOptimize()before serialization to improve compression. The current bitmap is not modified.- 参数:
out- the DataOutput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
deserialize
Deserialize (retrieve) this bitmap. If SERIALIZATION_MODE is set to SERIALIZATION_MODE_PORTABLE, this will rely on the specification at https://github.com/RoaringBitmap/RoaringFormatSpec#extention-for-64-bit-implementations. As of 0.x, this is **not** the default behavior. The current bitmap is overwritten.- 参数:
in- the DataInput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
deserializeLegacy
Deserialize (retrieve) this bitmap. This format was introduced before converting with CRoaring portable format. It remains useful when considering signed longs. It is the default in 0.x The current bitmap is overwritten.- 参数:
in- the DataInput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
deserializePortable
Deserialize (retrieve) this bitmap. The format is specified at https://github.com/RoaringBitmap/RoaringFormatSpec#extention-for-64-bit-implementations. It is the compatible with CRoaring (and GoRoaring). The current bitmap is overwritten.- 参数:
in- the DataInput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
serializedSizeInBytes
public long serializedSizeInBytes()从接口复制的说明:ImmutableLongBitmapDataProviderReport the number of bytes required to serialize this bitmap. This is the number of bytes written out when using the serialize method. When using the writeExternal method, the count will be higher due to the overhead of Java serialization.- 指定者:
serializedSizeInBytes在接口中ImmutableLongBitmapDataProvider- 返回:
- the size in bytes
-
clear
public void clear()reset to an empty bitmap; result occupies as much space a newly created bitmap. -
toArray
public long[] toArray()Return the set values as an array, if the cardinality is smaller than 2147483648. The long values are in sorted order.- 指定者:
toArray在接口中ImmutableLongBitmapDataProvider- 返回:
- array representing the set values.
-
bitmapOf
Generate a bitmap with the specified values set to true. The provided longs values don't have to be in sorted order, but it may be preferable to sort them from a performance point of view.- 参数:
dat- set values- 返回:
- a new bitmap
-
add
public void add(long... dat) Set all the specified values to true. This can be expected to be slightly faster than calling "add" repeatedly. The provided integers values don't have to be in sorted order, but it may be preferable to sort them from a performance point of view.- 参数:
dat- set values
-
add
已过时。as this may be confused with adding individual longsAdd to the current bitmap all longs in [rangeStart,rangeEnd).- 参数:
rangeStart- inclusive beginning of rangerangeEnd- exclusive ending of range
-
addRange
public void addRange(long rangeStart, long rangeEnd) Add to the current bitmap all longs in [rangeStart,rangeEnd).- 参数:
rangeStart- inclusive beginning of rangerangeEnd- exclusive ending of range
-
getReverseLongIterator
- 指定者:
getReverseLongIterator在接口中ImmutableLongBitmapDataProvider- 返回:
- a custom iterator over set bits, the bits are traversed in descending sorted order
-
removeLong
public void removeLong(long x) 从接口复制的说明:LongBitmapDataProviderIf present remove the specified integers (effectively, sets its bit value to false)- 指定者:
removeLong在接口中LongBitmapDataProvider- 参数:
x- long value representing the index in a bitmap
-
trim
public void trim()从接口复制的说明:LongBitmapDataProviderRecover allocated but unused memory.- 指定者:
trim在接口中LongBitmapDataProvider
-
hashCode
public int hashCode() -
equals
-
flip
public void flip(long x) Add the value if it is not already present, otherwise remove it.- 参数:
x- long value
-
first
public long first()从接口复制的说明:ImmutableLongBitmapDataProviderGet the first (smallest) integer in this RoaringBitmap, that is, return the minimum of the set.- 指定者:
first在接口中ImmutableLongBitmapDataProvider- 返回:
- the first (smallest) integer
-
last
public long last()从接口复制的说明:ImmutableLongBitmapDataProviderGet the last (largest) integer in this RoaringBitmap, that is, return the maximum of the set.- 指定者:
last在接口中ImmutableLongBitmapDataProvider- 返回:
- the last (largest) integer
-