abstract class Packed64SingleBlock extends PackedInts.MutableImpl
Packed64 except that it trades space for
speed by ensuring that a single block needs to be read/written in order to
read/write a value.| Modifier and Type | Field and Description |
|---|---|
(package private) long[] |
blocks |
static int |
MAX_SUPPORTED_BITS_PER_VALUE |
private static int[] |
SUPPORTED_BITS_PER_VALUE |
bitsPerValue, valueCount| Constructor and Description |
|---|
Packed64SingleBlock(int valueCount,
int bitsPerValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Sets all values to 0.
|
static Packed64SingleBlock |
create(DataInput in,
int valueCount,
int bitsPerValue) |
static Packed64SingleBlock |
create(int valueCount,
int bitsPerValue) |
void |
fill(int fromIndex,
int toIndex,
long val)
Fill the mutable from
fromIndex (inclusive) to
toIndex (exclusive) with val. |
int |
get(int index,
long[] arr,
int off,
int len)
Bulk get: read at least one and at most
len longs starting
from index into arr[off:off+len] and return
the actual number of values that have been read. |
protected PackedInts.Format |
getFormat()
The underlying format.
|
static boolean |
isSupported(int bitsPerValue) |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
private static int |
requiredCapacity(int valueCount,
int valuesPerBlock) |
int |
set(int index,
long[] arr,
int off,
int len)
Bulk set: set at least one and at most
len longs starting
at off in arr into this mutable, starting at
index. |
java.lang.String |
toString() |
getBitsPerValue, sizesave, setgetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildResourcespublic static final int MAX_SUPPORTED_BITS_PER_VALUE
private static final int[] SUPPORTED_BITS_PER_VALUE
final long[] blocks
public static boolean isSupported(int bitsPerValue)
private static int requiredCapacity(int valueCount,
int valuesPerBlock)
public void clear()
PackedInts.Mutableclear in class PackedInts.Mutablepublic long ramBytesUsed()
Accountablepublic int get(int index,
long[] arr,
int off,
int len)
PackedInts.Readerlen longs starting
from index into arr[off:off+len] and return
the actual number of values that have been read.get in class PackedInts.Readerpublic int set(int index,
long[] arr,
int off,
int len)
PackedInts.Mutablelen longs starting
at off in arr into this mutable, starting at
index. Returns the actual number of values that have been
set.set in class PackedInts.Mutablepublic void fill(int fromIndex,
int toIndex,
long val)
PackedInts.MutablefromIndex (inclusive) to
toIndex (exclusive) with val.fill in class PackedInts.Mutableprotected PackedInts.Format getFormat()
PackedInts.MutablegetFormat in class PackedInts.Mutablepublic java.lang.String toString()
toString in class PackedInts.MutableImplpublic static Packed64SingleBlock create(DataInput in, int valueCount, int bitsPerValue) throws java.io.IOException
java.io.IOExceptionpublic static Packed64SingleBlock create(int valueCount, int bitsPerValue)