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)
PointableRoaringArray
advanceUntil
in interface PointableRoaringArray
x
- 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()
PointableRoaringArray
clone
in interface PointableRoaringArray
clone
in class Object
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)
public int getCardinality(int i)
PointableRoaringArray
getCardinality
in interface PointableRoaringArray
i
- indexpublic int getContainerIndex(short x)
PointableRoaringArray
getContainerIndex
in interface PointableRoaringArray
x
- 16-bit keypublic MappeableContainer getContainerAtIndex(int i)
getContainerAtIndex
in interface PointableRoaringArray
i
- indexpublic MappeableContainerPointer getContainerPointer()
getContainerPointer
in interface PointableRoaringArray
public MappeableContainerPointer getContainerPointer(int startIndex)
getContainerPointer
in interface PointableRoaringArray
startIndex
- starting indexpublic int getIndex(short x)
getIndex
in interface PointableRoaringArray
x
- 16-bit keypublic short getKeyAtIndex(int i)
getKeyAtIndex
in interface PointableRoaringArray
i
- the indexpublic boolean hasRunCompression()
PointableRoaringArray
hasRunCompression
in interface PointableRoaringArray
protected int headerSize()
protected void insertNewKeyValueAt(int i, short key, MappeableContainer 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, MappeableContainer c)
protected void resize(int newLength)
public void serialize(DataOutput out) throws IOException
serialize
in interface PointableRoaringArray
out
- the DataOutput streamIOException
- Signals that an I/O exception has occurred.public int serializedSizeInBytes()
serializedSizeInBytes
in interface PointableRoaringArray
protected void setContainerAtIndex(int i, MappeableContainer c)
public int size()
size
in interface PointableRoaringArray
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public boolean containsForContainerAtIndex(int i, short x)
PointableRoaringArray
containsForContainerAtIndex
in interface PointableRoaringArray
i
- container index (assumed to be non-negative)x
- 16-bit value to checkpublic int first()
PointableRoaringArray
first
in interface PointableRoaringArray
public int last()
PointableRoaringArray
last
in interface PointableRoaringArray
Copyright © 2018. All rights reserved.