PackedInts.Mutable, PackedInts.Readerpublic class GrowableWriter extends Object implements PackedInts.Mutable
PackedInts.Mutable, but grows the
bit count of the underlying packed ints on-demand.
@lucene.internal
| Constructor | Description |
|---|---|
GrowableWriter(int startBitsPerValue,
int valueCount,
boolean roundFixedSize) |
| Modifier and Type | Method | Description |
|---|---|---|
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() |
public GrowableWriter(int startBitsPerValue,
int valueCount,
boolean roundFixedSize)
public long get(int index)
get in interface PackedInts.Readerindex - the position of the wanted value.public int size()
size in interface PackedInts.Readerpublic int getBitsPerValue()
getBitsPerValue in interface PackedInts.ReaderbitsPerValue * #values as implementations are free to
use non-space-optimal packing of bits.public PackedInts.Mutable getMutable()
public Object getArray()
PackedInts.ReadergetArray in interface PackedInts.Readerpublic boolean hasArray()
PackedInts.ReaderhasArray in interface PackedInts.ReaderPackedInts.Reader.getArray()public void set(int index,
long value)
PackedInts.Mutableset in interface PackedInts.Mutableindex - where the value should be positioned.value - a value conforming to the constraints set by the array.public void clear()
PackedInts.Mutableclear in interface PackedInts.Mutablepublic GrowableWriter resize(int newSize)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.