java.lang.Object
org.bitlap.roaringbitmap.buffer.ImmutableRoaringArray
- 所有已实现的接口:
Cloneable,PointableRoaringArray
This is the underlying data structure for an ImmutableRoaringBitmap. This class is not meant for
end-users.
-
字段概要
字段修饰符和类型字段说明protected static final shortprotected static final short -
构造器概要
构造器限定符构造器说明protectedCreate an array based on a previously serialized ByteBuffer. -
方法概要
修饰符和类型方法说明intadvanceUntil(char x, int pos) Find the smallest integer index larger than pos such that getKeyAtIndex(index)>=x.clone()Create an independent copy of the underlying arraybooleancontainsForContainerAtIndex(int i, char x) This checks whether the container at index i has the value x.booleanintfirst()Gets the first value in the arrayintgetCardinality(int k) Returns the cardinality of the container at the given index.getContainerAtIndex(int i) intgetContainerIndex(char x) Returns either the index of the container corresponding to key x, or a negative value.getContainerPointer(int startIndex) intgetIndex(char x) chargetKeyAtIndex(int i) inthashCode()booleanCheck whether this bitmap has had its runs compressed.protected intheaderSize(boolean hasrun) booleanisEmpty()Returns true if this bitmap is empty.intlast()Gets the last value in the arrayvoidserialize(DataOutput out) Serialize.voidserialize(ByteBuffer buffer) Serialize.intintsize()
-
字段详细资料
-
构造器详细资料
-
ImmutableRoaringArray
Create an array based on a previously serialized ByteBuffer. The input ByteBuffer is effectively copied (with the slice operation) so you should expect the provided ByteBuffer position/mark/limit/order to remain unchanged.- 参数:
bbf- The source ByteBuffer
-
-
方法详细资料
-
advanceUntil
public int advanceUntil(char x, int pos) 从接口复制的说明:PointableRoaringArrayFind the smallest integer index larger than pos such that getKeyAtIndex(index)>=x. If none can be found, return size.- 指定者:
advanceUntil在接口中PointableRoaringArray- 参数:
x- minimal valuepos- index to exceed- 返回:
- the smallest index greater than pos such that getKeyAtIndex(index) is at least as large as min, or size if it is not possible.
-
clone
从接口复制的说明:PointableRoaringArrayCreate an independent copy of the underlying array- 指定者:
clone在接口中PointableRoaringArray- 覆盖:
clone在类中Object- 返回:
- a copy
-
getCardinality
public int getCardinality(int k) 从接口复制的说明:PointableRoaringArrayReturns the cardinality of the container at the given index. This method is expected to be fast.- 指定者:
getCardinality在接口中PointableRoaringArray- 参数:
k- index- 返回:
- the cardinality
-
getContainerIndex
public int getContainerIndex(char x) 从接口复制的说明:PointableRoaringArrayReturns either the index of the container corresponding to key x, or a negative value.- 指定者:
getContainerIndex在接口中PointableRoaringArray- 参数:
x- 16-bit key- 返回:
- index of container (negative value if no container found)
-
getContainerAtIndex
- 指定者:
getContainerAtIndex在接口中PointableRoaringArray- 参数:
i- index- 返回:
- matching container
-
containsForContainerAtIndex
public boolean containsForContainerAtIndex(int i, char x) 从接口复制的说明:PointableRoaringArrayThis checks whether the container at index i has the value x. This can be faster than calling "getContainerAtIndex" and then calling contains.- 指定者:
containsForContainerAtIndex在接口中PointableRoaringArray- 参数:
i- container index (assumed to be non-negative)x- 16-bit value to check- 返回:
- whether the container contains at index i contains x
-
getContainerPointer
- 指定者:
getContainerPointer在接口中PointableRoaringArray- 返回:
- a ContainerPointer to iterator over the array
-
getContainerPointer
- 指定者:
getContainerPointer在接口中PointableRoaringArray- 参数:
startIndex- starting index- 返回:
- a ContainerPointer to iterator over the array initially positioned at startIndex
-
getIndex
public int getIndex(char x) - 指定者:
getIndex在接口中PointableRoaringArray- 参数:
x- 16-bit key- 返回:
- corresponding index
-
getKeyAtIndex
public char getKeyAtIndex(int i) - 指定者:
getKeyAtIndex在接口中PointableRoaringArray- 参数:
i- the index- 返回:
- 16-bit key at the index
-
equals
-
hashCode
public int hashCode() -
hasRunCompression
public boolean hasRunCompression()从接口复制的说明:PointableRoaringArrayCheck whether this bitmap has had its runs compressed.- 指定者:
hasRunCompression在接口中PointableRoaringArray- 返回:
- whether this bitmap has run compression
-
headerSize
protected int headerSize(boolean hasrun) -
isEmpty
public boolean isEmpty()Returns true if this bitmap is empty.- 返回:
- true if empty
-
serialize
Serialize. The current bitmap is not modified.- 指定者:
serialize在接口中PointableRoaringArray- 参数:
out- the DataOutput stream- 抛出:
IOException- Signals that an I/O exception has occurred.
-
serialize
从接口复制的说明:PointableRoaringArraySerialize. The current bitmap is not modified.- 指定者:
serialize在接口中PointableRoaringArray- 参数:
buffer- the buffer to serialize to
-
serializedSizeInBytes
public int serializedSizeInBytes()- 指定者:
serializedSizeInBytes在接口中PointableRoaringArray- 返回:
- the size that the data structure occupies on disk
-
size
public int size()- 指定者:
size在接口中PointableRoaringArray- 返回:
- number of keys
-
first
public int first()从接口复制的说明:PointableRoaringArrayGets the first value in the array- 指定者:
first在接口中PointableRoaringArray- 返回:
- te first value in the array
-
last
public int last()从接口复制的说明:PointableRoaringArrayGets the last value in the array- 指定者:
last在接口中PointableRoaringArray- 返回:
- te last value in the array
-