public final class ImmutableRoaringArray extends Object implements PointableRoaringArray
Modifier and Type | Field and Description |
---|---|
protected static short |
SERIAL_COOKIE |
protected static short |
SERIAL_COOKIE_NO_RUNCONTAINER |
Modifier | Constructor and Description |
---|---|
protected |
ImmutableRoaringArray(ByteBuffer bbf)
Create an array based on a previously serialized ByteBuffer.
|
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.
|
ImmutableRoaringArray |
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.
|
int |
first()
Gets the first value in the array
|
int |
getCardinality(int k)
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(boolean hasrun) |
boolean |
isEmpty()
Returns true if this bitmap is empty.
|
int |
last()
Gets the last value in the array
|
void |
serialize(DataOutput out)
Serialize.
|
int |
serializedSizeInBytes() |
int |
size() |
protected static final short SERIAL_COOKIE
protected static final short SERIAL_COOKIE_NO_RUNCONTAINER
protected ImmutableRoaringArray(ByteBuffer bbf)
bbf
- The source ByteBufferpublic int advanceUntil(short x, int pos)
PointableRoaringArray
advanceUntil
in interface PointableRoaringArray
x
- minimal valuepos
- index to exceedpublic ImmutableRoaringArray clone()
PointableRoaringArray
clone
in interface PointableRoaringArray
clone
in class Object
public int getCardinality(int k)
PointableRoaringArray
getCardinality
in interface PointableRoaringArray
k
- indexpublic int getContainerIndex(short x)
PointableRoaringArray
getContainerIndex
in interface PointableRoaringArray
x
- 16-bit keypublic MappeableContainer getContainerAtIndex(int i)
getContainerAtIndex
in interface PointableRoaringArray
i
- indexpublic 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 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(boolean hasrun)
public boolean isEmpty()
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
public int size()
size
in interface PointableRoaringArray
public int first()
PointableRoaringArray
first
in interface PointableRoaringArray
public int last()
PointableRoaringArray
last
in interface PointableRoaringArray
Copyright © 2018. All rights reserved.