public final class MutableRoaringArray extends Object implements Cloneable, Externalizable, PointableRoaringArray
Modifier and Type | Class and Description |
---|---|
protected static class |
MutableRoaringArray.Element |
Modifier and Type | Field and Description |
---|---|
protected static int |
INITIAL_CAPACITY |
protected static short |
SERIAL_COOKIE |
Modifier | Constructor and Description |
---|---|
protected |
MutableRoaringArray() |
protected |
MutableRoaringArray(ByteBuffer bb)
Create a roaring array based on a previously serialized ByteBuffer.
|
Modifier and Type | Method and Description |
---|---|
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
|
void |
deserialize(DataInput in)
Deserialize.
|
boolean |
equals(Object o) |
protected void |
extendArray(int k) |
int |
getCardinality(int i)
Returns the cardinality of the container at the given index.
|
MappeableContainer |
getContainer(short x) |
MappeableContainer |
getContainerAtIndex(int i) |
org.roaringbitmap.buffer.MappeableContainerPointer |
getContainerPointer() |
int |
getIndex(short x) |
short |
getKeyAtIndex(int i) |
int |
hashCode() |
protected void |
insertNewKeyValueAt(int i,
short key,
MappeableContainer value) |
void |
readExternal(ObjectInput in) |
protected void |
removeAtIndex(int i) |
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
protected MutableRoaringArray()
protected MutableRoaringArray(ByteBuffer bb)
bb
- The source ByteBufferprotected 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
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 MappeableContainer getContainer(short x)
getContainer
in interface PointableRoaringArray
x
- 16-bit keypublic MappeableContainer getContainerAtIndex(int i)
getContainerAtIndex
in interface PointableRoaringArray
i
- indexpublic org.roaringbitmap.buffer.MappeableContainerPointer getContainerPointer()
getContainerPointer
in interface PointableRoaringArray
public int getIndex(short x)
getIndex
in interface PointableRoaringArray
x
- 16-bit keypublic short getKeyAtIndex(int i)
getKeyAtIndex
in interface PointableRoaringArray
i
- the indexprotected 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 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 int getCardinality(int i)
PointableRoaringArray
getCardinality
in interface PointableRoaringArray
i
- indexCopyright © 2014. All Rights Reserved.