|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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,
float acceptableOverheadRatio)
|
|
| Method Summary | |
|---|---|
void |
clear()
Sets all values to 0. |
void |
fill(int fromIndex,
int toIndex,
long val)
Fill the mutable from fromIndex (inclusive) to
toIndex (exclusive) with val. |
long |
get(int index)
|
int |
get(int index,
long[] arr,
int off,
int len)
Bulk get: read at least one and at most len longs starting
from index into arr[off:off+len] and return
the actual number of values that have been read. |
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. |
long |
ramBytesUsed()
Return the in-memory size in bytes. |
GrowableWriter |
resize(int newSize)
|
void |
save(DataOutput out)
Save this mutable into out. |
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 most len longs starting
at off in arr into this mutable, starting at
index. |
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,
float acceptableOverheadRatio)
| Method Detail |
|---|
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.Reader
getArray in interface PackedInts.Readerpublic boolean hasArray()
PackedInts.Reader
hasArray in interface PackedInts.ReaderPackedInts.Reader.getArray()
public void set(int index,
long value)
PackedInts.Mutable
set 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.Mutable
clear in interface PackedInts.Mutablepublic GrowableWriter resize(int newSize)
public int get(int index,
long[] arr,
int off,
int len)
PackedInts.Readerlen longs starting
from index into arr[off:off+len] and return
the actual number of values that have been read.
get in interface PackedInts.Reader
public int set(int index,
long[] arr,
int off,
int len)
PackedInts.Mutablelen longs starting
at off in arr into this mutable, starting at
index. Returns the actual number of values that have been
set.
set in interface PackedInts.Mutable
public void fill(int fromIndex,
int toIndex,
long val)
PackedInts.MutablefromIndex (inclusive) to
toIndex (exclusive) with val.
fill in interface PackedInts.Mutablepublic long ramBytesUsed()
PackedInts.Reader
ramBytesUsed in interface PackedInts.Reader
public void save(DataOutput out)
throws IOException
PackedInts.Mutableout. Instantiating a reader from
the generated data will return a reader with the same number of bits
per value.
save in interface PackedInts.MutableIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||