public final class RoaringArray extends Object implements Cloneable, Externalizable
Modifier and Type | Field and Description |
---|---|
protected static int |
NO_OFFSET_THRESHOLD |
protected static short |
SERIAL_COOKIE |
protected static short |
SERIAL_COOKIE_NO_RUNCONTAINER |
Modifier | Constructor and Description |
---|---|
protected |
RoaringArray() |
Modifier and Type | Method and Description |
---|---|
protected int |
advanceUntil(short x,
int pos)
Find the smallest integer index larger than pos such that array[index].key>=x.
|
protected void |
append(RoaringArray sa,
int startingIndex,
int end)
Append the values from another array, no copy is made (use with care)
|
protected void |
append(short key,
Container value) |
protected void |
appendCopiesAfter(RoaringArray sa,
short beforeStart)
Append copies of the values AFTER a specified key (may or may not be present) to end.
|
protected void |
appendCopiesUntil(RoaringArray sourceArray,
short stoppingKey)
Append copies of the values from another array, from the start
|
protected void |
appendCopy(RoaringArray sa,
int index)
Append copy of the one value from another array
|
protected void |
appendCopy(RoaringArray sa,
int startingIndex,
int end)
Append copies of the values from another array
|
protected void |
clear() |
RoaringArray |
clone() |
protected void |
copyRange(int begin,
int end,
int newBegin) |
void |
deserialize(DataInput in)
Deserialize.
|
boolean |
equals(Object o) |
protected void |
extendArray(int k) |
int |
first()
Gets the first value in the array
|
protected Container |
getContainer(short x) |
protected Container |
getContainerAtIndex(int i) |
ContainerPointer |
getContainerPointer()
Create a ContainerPointer for this RoaringArray
|
ContainerPointer |
getContainerPointer(int startIndex)
Create a ContainerPointer for this RoaringArray
|
protected int |
getIndex(short x) |
protected short |
getKeyAtIndex(int i) |
int |
hashCode() |
protected int |
headerSize() |
protected void |
insertNewKeyValueAt(int i,
short key,
Container value) |
int |
last()
Gets the last value in the array
|
void |
readExternal(ObjectInput in) |
protected void |
removeAtIndex(int i) |
protected void |
removeIndexRange(int begin,
int end) |
protected void |
replaceKeyAndContainerAtIndex(int i,
short key,
Container c) |
protected void |
resize(int newLength) |
void |
serialize(DataOutput out)
Serialize.
|
int |
serializedSizeInBytes()
Report the number of bytes required for serialization.
|
protected void |
setContainerAtIndex(int i,
Container c) |
protected int |
size() |
void |
writeExternal(ObjectOutput out) |
protected static final short SERIAL_COOKIE_NO_RUNCONTAINER
protected static final short SERIAL_COOKIE
protected static final int NO_OFFSET_THRESHOLD
protected int advanceUntil(short x, int pos)
x
- minimal valuepos
- index to exceedprotected void append(short key, Container value)
protected void appendCopiesAfter(RoaringArray sa, short beforeStart)
sa
- other arraybeforeStart
- given key is the largest key that we won't copyprotected void appendCopiesUntil(RoaringArray sourceArray, short stoppingKey)
sourceArray
- The array to copy fromstoppingKey
- any equal or larger key in other array will terminate copyingprotected void appendCopy(RoaringArray sa, int index)
sa
- other arrayindex
- index in the other arrayprotected void appendCopy(RoaringArray sa, int startingIndex, int end)
sa
- other arraystartingIndex
- starting index in the other arrayend
- endingIndex (exclusive) in the other arrayprotected void append(RoaringArray sa, int startingIndex, int end)
sa
- other arraystartingIndex
- starting index in the other arrayend
- endingIndex (exclusive) in the other arrayprotected void clear()
public RoaringArray clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
protected void copyRange(int begin, int end, int newBegin)
public void deserialize(DataInput in) throws IOException
in
- the DataInput streamIOException
- Signals that an I/O exception has occurred.protected void extendArray(int k)
protected Container getContainer(short x)
protected Container getContainerAtIndex(int i)
public ContainerPointer getContainerPointer()
public ContainerPointer getContainerPointer(int startIndex)
startIndex
- starting index in the container listprotected int getIndex(short x)
protected short getKeyAtIndex(int i)
protected int headerSize()
protected void insertNewKeyValueAt(int i, short key, Container value)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
protected void removeAtIndex(int i)
protected void removeIndexRange(int begin, int end)
protected void replaceKeyAndContainerAtIndex(int i, short key, Container c)
protected void resize(int newLength)
public void serialize(DataOutput out) throws IOException
out
- the DataOutput streamIOException
- Signals that an I/O exception has occurred.public int serializedSizeInBytes()
protected void setContainerAtIndex(int i, Container c)
protected int size()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public int first()
NoSuchElementException
- if emptypublic int last()
NoSuchElementException
- if emptyCopyright © 2018. All rights reserved.