Package org.apache.lucene.util.packed
Class PackedInts.Mutable
- java.lang.Object
-
- org.apache.lucene.util.packed.PackedInts.Reader
-
- org.apache.lucene.util.packed.PackedInts.Mutable
-
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
GrowableWriter
- Enclosing class:
- PackedInts
public abstract static class PackedInts.Mutable extends PackedInts.Reader
A packed integer array that can be modified.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Constructor Summary
Constructors Constructor Description Mutable()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclear()Sets all values to 0.voidfill(int fromIndex, int toIndex, long val)Fill the mutable fromfromIndex(inclusive) totoIndex(exclusive) withval.abstract intgetBitsPerValue()abstract 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.-
Methods inherited from class org.apache.lucene.util.packed.PackedInts.Reader
get, get, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
-
-
-
Method Detail
-
getBitsPerValue
public abstract int getBitsPerValue()
- Returns:
- the number of bits used to store any given value. Note: This does not imply that
memory usage is
bitsPerValue * #valuesas implementations are free to use non-space-optimal packing of bits.
-
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 mostlenlongs starting atoffinarrinto 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.
-
-