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, size
save, set
get
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildResources
public 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.Mutable
clear
in class PackedInts.Mutable
public long ramBytesUsed()
Accountable
public int get(int index, long[] arr, int off, int len)
PackedInts.Reader
len
longs starting
from index
into arr[off:off+len]
and return
the actual number of values that have been read.get
in class PackedInts.Reader
public int set(int index, long[] arr, int off, int len)
PackedInts.Mutable
len
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.Mutable
public void fill(int fromIndex, int toIndex, long val)
PackedInts.Mutable
fromIndex
(inclusive) to
toIndex
(exclusive) with val
.fill
in class PackedInts.Mutable
protected PackedInts.Format getFormat()
PackedInts.Mutable
getFormat
in class PackedInts.Mutable
public java.lang.String toString()
toString
in class PackedInts.MutableImpl
public static Packed64SingleBlock create(DataInput in, int valueCount, int bitsPerValue) throws java.io.IOException
java.io.IOException
public static Packed64SingleBlock create(int valueCount, int bitsPerValue)