public final class MutableRoaringArray extends java.lang.Object implements java.lang.Cloneable, java.io.Externalizable, PointableRoaringArray, AppendableStorage<MappeableContainer>
| 限定符和类型 | 字段和说明 |
|---|---|
protected static int |
INITIAL_CAPACITY |
protected static int |
NO_OFFSET_THRESHOLD |
protected static short |
SERIAL_COOKIE |
protected static short |
SERIAL_COOKIE_NO_RUNCONTAINER |
| 限定符 | 构造器和说明 |
|---|---|
protected |
MutableRoaringArray() |
|
MutableRoaringArray(int initialCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
advanceUntil(char x,
int pos)
Find the smallest integer index larger than pos such that getKeyAtIndex(index)>=x.
|
void |
append(char key,
MappeableContainer value)
Appends the key and container to the storage, throws if the key is less
than the current mark.
|
protected void |
appendCopiesAfter(PointableRoaringArray highLowContainer,
char beforeStart)
Append copies of the values AFTER a specified key (may or may not be present) to end.
|
protected void |
appendCopiesUntil(PointableRoaringArray highLowContainer,
char stoppingKey)
Append copies of the values from another array, from the start
|
protected void |
appendCopy(char key,
MappeableContainer value) |
protected void |
appendCopy(PointableRoaringArray highLowContainer,
int startingIndex,
int end)
Append copies of the values from another array
|
protected void |
clear() |
MutableRoaringArray |
clone()
Create an independent copy of the underlying array
|
boolean |
containsForContainerAtIndex(int i,
char x)
This checks whether the container at index i has the value x.
|
protected void |
copyRange(int begin,
int end,
int newBegin) |
void |
deserialize(java.nio.ByteBuffer bbf)
Deserialize (retrieve) this bitmap.
|
void |
deserialize(java.io.DataInput in)
Deserialize.
|
boolean |
equals(java.lang.Object o) |
protected void |
extendArray(int k) |
int |
first()
Gets the first value in the array
|
int |
getCardinality(int i)
Returns the cardinality of the container at the given index.
|
MappeableContainer |
getContainerAtIndex(int i) |
int |
getContainerIndex(char x)
Returns either the index of the container corresponding to key x, or a negative value.
|
MappeableContainerPointer |
getContainerPointer() |
MappeableContainerPointer |
getContainerPointer(int startIndex) |
int |
getIndex(char x) |
char |
getKeyAtIndex(int i) |
int |
hashCode() |
boolean |
hasRunCompression()
Check whether this bitmap has had its runs compressed.
|
protected int |
headerSize() |
protected void |
insertNewKeyValueAt(int i,
char key,
MappeableContainer value) |
int |
last()
Gets the last value in the array
|
void |
readExternal(java.io.ObjectInput in) |
protected void |
removeAtIndex(int i) |
protected void |
removeIndexRange(int begin,
int end) |
protected void |
replaceKeyAndContainerAtIndex(int i,
char key,
MappeableContainer c) |
protected void |
resize(int newLength) |
void |
serialize(java.nio.ByteBuffer buffer)
Serialize.
|
void |
serialize(java.io.DataOutput out)
Serialize.
|
int |
serializedSizeInBytes()
Report the number of bytes required for serialization.
|
protected void |
setContainerAtIndex(int i,
MappeableContainer c) |
int |
size() |
void |
trim()
If possible, recover wasted memory.
|
void |
writeExternal(java.io.ObjectOutput out) |
protected static final int INITIAL_CAPACITY
protected static final short SERIAL_COOKIE_NO_RUNCONTAINER
protected static final short SERIAL_COOKIE
protected static final int NO_OFFSET_THRESHOLD
protected MutableRoaringArray()
public MutableRoaringArray(int initialCapacity)
public int advanceUntil(char x,
int pos)
PointableRoaringArrayadvanceUntil 在接口中 PointableRoaringArrayx - minimal valuepos - index to exceedpublic void append(char key,
MappeableContainer value)
AppendableStorageappend 在接口中 AppendableStorage<MappeableContainer>key - the key to appendvalue - the data to appendprotected void appendCopiesAfter(PointableRoaringArray highLowContainer, char beforeStart)
highLowContainer - the other arraybeforeStart - given key is the largest key that we won't copyprotected void appendCopiesUntil(PointableRoaringArray highLowContainer, char stoppingKey)
highLowContainer - the other arraystoppingKey - any equal or larger key in other array will terminate copyingprotected void appendCopy(PointableRoaringArray highLowContainer, int startingIndex, int end)
highLowContainer - other arraystartingIndex - starting index in the other arrayend - last index array in the other arrayprotected void appendCopy(char key,
MappeableContainer value)
protected void clear()
public void trim()
public MutableRoaringArray clone()
PointableRoaringArrayclone 在接口中 PointableRoaringArrayclone 在类中 java.lang.Objectprotected void copyRange(int begin,
int end,
int newBegin)
public void deserialize(java.io.DataInput in)
throws java.io.IOException
in - the DataInput streamjava.io.IOException - Signals that an I/O exception has occurred.public void deserialize(java.nio.ByteBuffer bbf)
bbf - the byte buffer (can be mapped, direct, array backed etc.protected void extendArray(int k)
public int getCardinality(int i)
PointableRoaringArraygetCardinality 在接口中 PointableRoaringArrayi - indexpublic int getContainerIndex(char x)
PointableRoaringArraygetContainerIndex 在接口中 PointableRoaringArrayx - 16-bit keypublic MappeableContainer getContainerAtIndex(int i)
getContainerAtIndex 在接口中 PointableRoaringArrayi - indexpublic MappeableContainerPointer getContainerPointer()
getContainerPointer 在接口中 PointableRoaringArraypublic MappeableContainerPointer getContainerPointer(int startIndex)
getContainerPointer 在接口中 PointableRoaringArraystartIndex - starting indexpublic int getIndex(char x)
getIndex 在接口中 PointableRoaringArrayx - 16-bit keypublic char getKeyAtIndex(int i)
getKeyAtIndex 在接口中 PointableRoaringArrayi - the indexpublic boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean hasRunCompression()
PointableRoaringArrayhasRunCompression 在接口中 PointableRoaringArrayprotected int headerSize()
protected void insertNewKeyValueAt(int i,
char key,
MappeableContainer value)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal 在接口中 java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected void removeAtIndex(int i)
protected void removeIndexRange(int begin,
int end)
protected void replaceKeyAndContainerAtIndex(int i,
char key,
MappeableContainer c)
protected void resize(int newLength)
public void serialize(java.io.DataOutput out)
throws java.io.IOException
serialize 在接口中 PointableRoaringArrayout - the DataOutput streamjava.io.IOException - Signals that an I/O exception has occurred.public void serialize(java.nio.ByteBuffer buffer)
serialize 在接口中 PointableRoaringArraybuffer - the ByteBuffer to write topublic int serializedSizeInBytes()
serializedSizeInBytes 在接口中 PointableRoaringArrayprotected void setContainerAtIndex(int i,
MappeableContainer c)
public int size()
size 在接口中 PointableRoaringArraypublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic boolean containsForContainerAtIndex(int i,
char x)
PointableRoaringArraycontainsForContainerAtIndex 在接口中 PointableRoaringArrayi - container index (assumed to be non-negative)x - 16-bit value to checkpublic int first()
PointableRoaringArrayfirst 在接口中 PointableRoaringArraypublic int last()
PointableRoaringArraylast 在接口中 PointableRoaringArray