|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.packed.GrowableWriter
public class GrowableWriter
Implements PackedInts.Mutable
, but grows the
bit count of the underlying packed ints on-demand.
@lucene.internal
Constructor Summary | |
---|---|
GrowableWriter(int startBitsPerValue,
int valueCount,
boolean roundFixedSize)
|
Method Summary | |
---|---|
void |
clear()
Sets all values to 0. |
long |
get(int index)
|
Object |
getArray()
Expert: if the bit-width of this reader matches one of java's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null. |
int |
getBitsPerValue()
|
PackedInts.Mutable |
getMutable()
|
boolean |
hasArray()
Returns true if this implementation is backed by a native java array. |
GrowableWriter |
resize(int newSize)
|
void |
set(int index,
long value)
Set the value at the given index in the array. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GrowableWriter(int startBitsPerValue, int valueCount, boolean roundFixedSize)
Method Detail |
---|
public long get(int index)
get
in interface PackedInts.Reader
index
- the position of the wanted value.
public int size()
size
in interface PackedInts.Reader
public int getBitsPerValue()
getBitsPerValue
in interface PackedInts.Reader
bitsPerValue * #values
as implementations are free to
use non-space-optimal packing of bits.public PackedInts.Mutable getMutable()
public Object getArray()
PackedInts.Reader
getArray
in interface PackedInts.Reader
public boolean hasArray()
PackedInts.Reader
hasArray
in interface PackedInts.Reader
PackedInts.Reader.getArray()
public void set(int index, long value)
PackedInts.Mutable
set
in interface PackedInts.Mutable
index
- where the value should be positioned.value
- a value conforming to the constraints set by the array.public void clear()
PackedInts.Mutable
clear
in interface PackedInts.Mutable
public GrowableWriter resize(int newSize)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |