Package org.apache.lucene.util.packed
Class PackedInts.Mutable
java.lang.Object
org.apache.lucene.index.NumericDocValues
org.apache.lucene.util.packed.PackedInts.Reader
org.apache.lucene.util.packed.PackedInts.Mutable
- Direct Known Subclasses:
GrowableWriter
- Enclosing class:
- PackedInts
A packed integer array that can be modified.
-
Field Summary
Fields inherited from class org.apache.lucene.index.NumericDocValues
EMPTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Sets all values to 0.void
fill
(int fromIndex, int toIndex, long val) Fill the mutable fromfromIndex
(inclusive) totoIndex
(exclusive) withval
.void
save
(DataOutput out) Save this mutable intoout
.abstract void
set
(int index, long value) Set the value at the given index in the array.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
.Methods inherited from class org.apache.lucene.util.packed.PackedInts.Reader
get, getArray, getBitsPerValue, hasArray, ramBytesUsed, size
Methods inherited from class org.apache.lucene.index.NumericDocValues
get
-
Constructor Details
-
Mutable
public Mutable()
-
-
Method Details
-
set
public abstract void set(int index, long value) Set the value at the given index in the array.- 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) 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. -
fill
public void fill(int fromIndex, int toIndex, long val) Fill the mutable fromfromIndex
(inclusive) totoIndex
(exclusive) withval
. -
clear
public void clear()Sets all values to 0. -
save
Save this mutable intoout
. Instantiating a reader from the generated data will return a reader with the same number of bits per value.- Throws:
IOException
-