public final class RoaringArray extends java.lang.Object implements java.lang.Cloneable, java.io.Externalizable, AppendableStorage<Container>
| 构造器和说明 |
|---|
RoaringArray() |
RoaringArray(char[] keys,
Container[] values,
int size)
create method with keys and containers
|
RoaringArray(int initialCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
advanceUntil(char x,
int pos)
Find the smallest integer index larger than pos such that array[index].key>=x.
|
void |
append(char key,
Container value)
Appends the key and container to the storage, throws if the key is less
than the current mark.
|
void |
append(RoaringArray sa,
int startingIndex,
int end)
Append the values from another array, no copy is made (use with care)
|
void |
clear()
clear
|
RoaringArray |
clone() |
void |
deserialize(java.nio.ByteBuffer bbf)
Deserialize (retrieve) this bitmap.
|
void |
deserialize(java.io.DataInput in)
Deserialize.
|
void |
deserialize(java.io.DataInput in,
byte[] buffer)
Deserialize.
|
boolean |
equals(java.lang.Object o) |
int |
first()
Gets the first value in the array
|
Container |
getContainer(char x)
involves a binary search
|
Container |
getContainerAtIndex(int i) |
int |
getContainerIndex(char x) |
ContainerPointer |
getContainerPointer()
Create a ContainerPointer for this RoaringArray
|
ContainerPointer |
getContainerPointer(int startIndex)
Create a ContainerPointer for this RoaringArray
|
char |
getKeyAtIndex(int i) |
int |
hashCode() |
int |
last()
Gets the last value in the array
|
void |
readExternal(java.io.ObjectInput in) |
void |
serialize(java.nio.ByteBuffer buffer)
Serialize.
|
void |
serialize(java.io.DataOutput out)
Serialize.
|
int |
serializedSizeInBytes()
Report the number of bytes required for serialization.
|
int |
size() |
void |
trim()
If possible, recover wasted memory.
|
void |
writeExternal(java.io.ObjectOutput out) |
public char[] keys
public Container[] values
public RoaringArray()
public RoaringArray(int initialCapacity)
public RoaringArray(char[] keys,
Container[] values,
int size)
public int advanceUntil(char x,
int pos)
x - minimal valuepos - index to exceedpublic void append(char key,
Container value)
AppendableStorageappend 在接口中 AppendableStorage<Container>key - the key to appendvalue - the data to appendpublic void append(RoaringArray sa, int startingIndex, int end)
sa - other arraystartingIndex - starting index in the other arrayend - endingIndex (exclusive) in the other arraypublic void clear()
public void trim()
public RoaringArray clone() throws java.lang.CloneNotSupportedException
clone 在类中 java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void deserialize(java.io.DataInput in)
throws java.io.IOException
deserialize(ByteBuffer). If the InputStream is >= 8kB, you could prefer
relying on deserialize(DataInput, byte[]);in - the DataInput streamjava.io.IOException - Signals that an I/O exception has occurred.InvalidRoaringFormat - if a Roaring Bitmap cookie is missing.public void deserialize(java.io.DataInput in,
byte[] buffer)
throws java.io.IOException
in - the DataInput streambuffer - The buffer gets overwritten with data during deserialization. You can pass a NULL
reference as a buffer. A buffer containing at least 8192 bytes might be ideal for
performance. It is recommended to reuse the buffer between calls to deserialize (in a
single-threaded context) for best performance.java.io.IOException - Signals that an I/O exception has occurred.InvalidRoaringFormat - if a Roaring Bitmap cookie is missing.public void deserialize(java.nio.ByteBuffer bbf)
bbf - the byte buffer (can be mapped, direct, array backed etc.public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic Container getContainer(char x)
public int getContainerIndex(char x)
public Container getContainerAtIndex(int i)
public ContainerPointer getContainerPointer()
public ContainerPointer getContainerPointer(int startIndex)
startIndex - starting index in the container listpublic char getKeyAtIndex(int i)
public int hashCode()
hashCode 在类中 java.lang.Objectpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic void serialize(java.io.DataOutput out)
throws java.io.IOException
out - the DataOutput streamjava.io.IOException - Signals that an I/O exception has occurred.public void serialize(java.nio.ByteBuffer buffer)
buffer - the ByteBuffer to write topublic int serializedSizeInBytes()
public int size()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal 在接口中 java.io.Externalizablejava.io.IOExceptionpublic int first()
java.util.NoSuchElementException - if emptypublic int last()
java.util.NoSuchElementException - if empty