Package org.apache.lucene.util.packed
Class Packed8ThreeBlocks
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.Packed8ThreeBlocks
- All Implemented Interfaces:
Accountable
Packs integers into 3 bytes (24 bits per value).
-
Field Summary
FieldsFields inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl
bitsPerValue, valueCountFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionPacked8ThreeBlocks(int valueCount) Packed8ThreeBlocks(int packedIntsVersion, DataInput in, int valueCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Sets all values to 0.voidfill(int fromIndex, int toIndex, long val) Fill the mutable fromfromIndex(inclusive) totoIndex(exclusive) withval.longget(int index) Get the long at the given index.intget(int index, long[] arr, int off, int len) Bulk get: read at least one and at mostlenlongs starting fromindexintoarr[off:off+len]and return the actual number of values that have been read.longReturn the memory usage of this object in bytes.voidset(int index, long value) Set the value at the given index in the array.intset(int index, long[] arr, int off, int len) Bulk set: set at least one and at mostlenlongs starting atoffinarrinto this mutable, starting atindex.toString()Methods inherited from class org.apache.lucene.util.packed.PackedInts.MutableImpl
getBitsPerValue, sizeMethods inherited from class org.apache.lucene.util.packed.PackedInts.Mutable
getFormat, saveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
blocks
final byte[] blocks -
MAX_SIZE
public static final int MAX_SIZE- See Also:
-
-
Constructor Details
-
Packed8ThreeBlocks
Packed8ThreeBlocks(int valueCount) -
Packed8ThreeBlocks
Packed8ThreeBlocks(int packedIntsVersion, DataInput in, int valueCount) throws IOException - Throws:
IOException
-
-
Method Details
-
get
public long get(int index) Description copied from class:PackedInts.ReaderGet the long at the given index. Behavior is undefined for out-of-range indices.- Specified by:
getin classPackedInts.Reader
-
get
public int get(int index, long[] arr, int off, int len) Description copied from class:PackedInts.ReaderBulk get: read at least one and at mostlenlongs starting fromindexintoarr[off:off+len]and return the actual number of values that have been read.- Overrides:
getin classPackedInts.Reader
-
set
public void set(int index, long value) Description copied from class:PackedInts.MutableSet the value at the given index in the array.- Specified by:
setin classPackedInts.Mutable- Parameters:
index- where the value should be positioned.value- a value conforming to the constraints set by the array.
-
set
public int set(int index, long[] arr, int off, int len) Description copied from class:PackedInts.MutableBulk set: set at least one and at mostlenlongs starting atoffinarrinto this mutable, starting atindex. Returns the actual number of values that have been set.- Overrides:
setin classPackedInts.Mutable
-
fill
public void fill(int fromIndex, int toIndex, long val) Description copied from class:PackedInts.MutableFill the mutable fromfromIndex(inclusive) totoIndex(exclusive) withval.- Overrides:
fillin classPackedInts.Mutable
-
clear
public void clear()Description copied from class:PackedInts.MutableSets all values to 0.- Overrides:
clearin classPackedInts.Mutable
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal. -
toString
- Overrides:
toStringin classPackedInts.MutableImpl
-