public final class MutableRoaringArray extends Object implements Cloneable, Externalizable, PointableRoaringArray
| Modifier and Type | Field and Description |
|---|---|
protected static int |
INITIAL_CAPACITY |
protected boolean |
mayHaveRunContainers |
protected static int |
NO_OFFSET_THRESHOLD |
protected static short |
SERIAL_COOKIE |
protected static short |
SERIAL_COOKIE_NO_RUNCONTAINER |
| Modifier | Constructor and Description |
|---|---|
protected |
MutableRoaringArray() |
| Modifier and Type | Method and Description |
|---|---|
int |
advanceUntil(short x,
int pos)
Find the smallest integer index larger than pos such that getKeyAtIndex(index)>=x.
|
protected void |
append(short key,
MappeableContainer value) |
protected void |
appendCopiesAfter(PointableRoaringArray highLowContainer,
short beforeStart)
Append copies of the values AFTER a specified key (may or may not be present) to end.
|
protected void |
appendCopiesUntil(PointableRoaringArray highLowContainer,
short stoppingKey)
Append copies of the values from another array, from the start
|
protected void |
appendCopy(PointableRoaringArray highLowContainer,
int startingIndex,
int end)
Append copies of the values from another array
|
protected void |
appendCopy(short key,
MappeableContainer value) |
protected void |
clear() |
MutableRoaringArray |
clone()
Create an independent copy of the underlying array
|
boolean |
containsForContainerAtIndex(int i,
short x)
This checks whether the container at index i has the value x.
|
protected void |
copyRange(int begin,
int end,
int newBegin) |
void |
deserialize(DataInput in)
Deserialize.
|
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(short x)
Returns either the index of the container corresponding to key x, or a negative value.
|
MappeableContainerPointer |
getContainerPointer() |
MappeableContainerPointer |
getContainerPointer(int startIndex) |
int |
getIndex(short x) |
short |
getKeyAtIndex(int i) |
int |
hashCode() |
boolean |
hasRunCompression()
Check whether this bitmap has had its runs compressed.
|
protected int |
headerSize() |
protected void |
insertNewKeyValueAt(int i,
short key,
MappeableContainer 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,
MappeableContainer 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,
MappeableContainer c) |
int |
size() |
void |
writeExternal(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 boolean mayHaveRunContainers
public int advanceUntil(short x,
int pos)
PointableRoaringArrayadvanceUntil in interface PointableRoaringArrayx - minimal valuepos - index to exceedprotected void append(short key,
MappeableContainer value)
protected void appendCopiesAfter(PointableRoaringArray highLowContainer, short beforeStart)
highLowContainer - the other arraybeforeStart - given key is the largest key that we won't copyprotected void appendCopiesUntil(PointableRoaringArray highLowContainer, short 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(short key,
MappeableContainer value)
protected void clear()
public MutableRoaringArray clone()
PointableRoaringArrayclone in interface PointableRoaringArrayclone in class Objectprotected 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)
public int getCardinality(int i)
PointableRoaringArraygetCardinality in interface PointableRoaringArrayi - indexpublic int getContainerIndex(short x)
PointableRoaringArraygetContainerIndex in interface PointableRoaringArrayx - 16-bit keypublic MappeableContainer getContainerAtIndex(int i)
getContainerAtIndex in interface PointableRoaringArrayi - indexpublic MappeableContainerPointer getContainerPointer()
getContainerPointer in interface PointableRoaringArraypublic MappeableContainerPointer getContainerPointer(int startIndex)
getContainerPointer in interface PointableRoaringArraystartIndex - starting indexpublic int getIndex(short x)
getIndex in interface PointableRoaringArrayx - 16-bit keypublic short getKeyAtIndex(int i)
getKeyAtIndex in interface PointableRoaringArrayi - the indexpublic boolean hasRunCompression()
PointableRoaringArrayhasRunCompression in interface PointableRoaringArrayprotected int headerSize()
protected void insertNewKeyValueAt(int i,
short key,
MappeableContainer value)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionprotected void removeAtIndex(int i)
protected void removeIndexRange(int begin,
int end)
protected void replaceKeyAndContainerAtIndex(int i,
short key,
MappeableContainer c)
protected void resize(int newLength)
public void serialize(DataOutput out) throws IOException
serialize in interface PointableRoaringArrayout - the DataOutput streamIOException - Signals that an I/O exception has occurred.public int serializedSizeInBytes()
serializedSizeInBytes in interface PointableRoaringArrayprotected void setContainerAtIndex(int i,
MappeableContainer c)
public int size()
size in interface PointableRoaringArraypublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic boolean containsForContainerAtIndex(int i,
short x)
PointableRoaringArraycontainsForContainerAtIndex in interface PointableRoaringArrayi - container index (assumed to be non-negative)x - 16-bit value to checkpublic int first()
PointableRoaringArrayfirst in interface PointableRoaringArraypublic int last()
PointableRoaringArraylast in interface PointableRoaringArrayCopyright © 2017. All rights reserved.