- java.lang.Object
-
- org.apache.lucene.util.packed.PackedInts.Reader
-
- org.apache.lucene.util.packed.PackedInts.Mutable
-
- org.apache.lucene.util.packed.PackedInts.MutableImpl
-
- org.apache.lucene.util.packed.Packed64SingleBlock
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
Packed64SingleBlock.Packed64SingleBlock1
,Packed64SingleBlock.Packed64SingleBlock10
,Packed64SingleBlock.Packed64SingleBlock12
,Packed64SingleBlock.Packed64SingleBlock16
,Packed64SingleBlock.Packed64SingleBlock2
,Packed64SingleBlock.Packed64SingleBlock21
,Packed64SingleBlock.Packed64SingleBlock3
,Packed64SingleBlock.Packed64SingleBlock32
,Packed64SingleBlock.Packed64SingleBlock4
,Packed64SingleBlock.Packed64SingleBlock5
,Packed64SingleBlock.Packed64SingleBlock6
,Packed64SingleBlock.Packed64SingleBlock7
,Packed64SingleBlock.Packed64SingleBlock8
,Packed64SingleBlock.Packed64SingleBlock9
abstract class Packed64SingleBlock extends PackedInts.MutableImpl
This class is similar toPacked64
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.
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description (package private) long[]
blocks
static int
MAX_SUPPORTED_BITS_PER_VALUE
private static int[]
SUPPORTED_BITS_PER_VALUE
-
Fields inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl
bitsPerValue, valueCount
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description Packed64SingleBlock(int valueCount, int bitsPerValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Sets all values to 0.static Packed64SingleBlock
create(int valueCount, int bitsPerValue)
void
fill(int fromIndex, int toIndex, long val)
Fill the mutable fromfromIndex
(inclusive) totoIndex
(exclusive) withval
.int
get(int index, long[] arr, int off, int len)
Bulk get: read at least one and at mostlen
longs starting fromindex
intoarr[off:off+len]
and return the actual number of values that have been read.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 mostlen
longs starting atoff
inarr
into this mutable, starting atindex
.java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl
getBitsPerValue, size
-
Methods inherited from class org.apache.lucene.util.packed.PackedInts.Mutable
set
-
Methods inherited from class org.apache.lucene.util.packed.PackedInts.Reader
get
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
MAX_SUPPORTED_BITS_PER_VALUE
public static final int MAX_SUPPORTED_BITS_PER_VALUE
- See Also:
- Constant Field Values
-
SUPPORTED_BITS_PER_VALUE
private static final int[] SUPPORTED_BITS_PER_VALUE
-
blocks
final long[] blocks
-
-
Method Detail
-
isSupported
public static boolean isSupported(int bitsPerValue)
-
requiredCapacity
private static int requiredCapacity(int valueCount, int valuesPerBlock)
-
clear
public void clear()
Description copied from class:PackedInts.Mutable
Sets all values to 0.- Overrides:
clear
in classPackedInts.Mutable
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
get
public int get(int index, long[] arr, int off, int len)
Description copied from class:PackedInts.Reader
Bulk get: read at least one and at mostlen
longs starting fromindex
intoarr[off:off+len]
and return the actual number of values that have been read.- Overrides:
get
in classPackedInts.Reader
-
set
public int set(int index, long[] arr, int off, int len)
Description copied from class:PackedInts.Mutable
Bulk set: set at least one and at mostlen
longs starting atoff
inarr
into this mutable, starting atindex
. Returns the actual number of values that have been set.- Overrides:
set
in classPackedInts.Mutable
-
fill
public void fill(int fromIndex, int toIndex, long val)
Description copied from class:PackedInts.Mutable
Fill the mutable fromfromIndex
(inclusive) totoIndex
(exclusive) withval
.- Overrides:
fill
in classPackedInts.Mutable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPackedInts.MutableImpl
-
create
public static Packed64SingleBlock create(int valueCount, int bitsPerValue)
-
-