|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.DocValues.Source org.apache.lucene.codecs.DocValuesArraySource
public abstract class DocValuesArraySource
DocValues DocValues.Source
implementation backed by
simple arrays.
Field Summary | |
---|---|
protected int |
bytesPerValue
Number of bytes to encode each doc value. |
Fields inherited from class org.apache.lucene.index.DocValues.Source |
---|
type |
Method Summary | |
---|---|
static int |
asInt(BytesRef b)
Converts 4 consecutive bytes from the current offset to an int. |
static long |
asLong(BytesRef b)
Converts 8 consecutive bytes from the current offset to a long. |
static short |
asShort(BytesRef b)
Converts 2 consecutive bytes from the current offset to a short. |
static void |
copyInt(BytesRef ref,
int value)
Copies the given int value and encodes it as 4 byte Big-Endian. |
static void |
copyLong(BytesRef ref,
long value)
Copies the given long value and encodes it as 8 byte Big-Endian. |
static void |
copyShort(BytesRef ref,
short value)
Copies the given short value and encodes it as a 2 byte Big-Endian. |
static DocValuesArraySource |
forType(DocValues.Type type)
Returns the DocValuesArraySource for the given
DocValues.Type . |
abstract BytesRef |
getBytes(int docID,
BytesRef ref)
Returns a BytesRef for the given document id or throws an
UnsupportedOperationException if this source doesn't support
byte[] values. |
boolean |
hasArray()
Returns true iff this DocValues.Source exposes an array via
DocValues.Source.getArray() otherwise false . |
abstract DocValuesArraySource |
newFromArray(Object array)
Creates DocValuesArraySource from a native
array. |
abstract DocValuesArraySource |
newFromInput(IndexInput input,
int numDocs)
Creates a DocValuesArraySource by loading a
previously saved one from an IndexInput . |
void |
toBytes(double value,
BytesRef bytesRef)
Encode a double value into the provided BytesRef . |
void |
toBytes(long value,
BytesRef bytesRef)
Encode a long value into the provided BytesRef . |
Methods inherited from class org.apache.lucene.index.DocValues.Source |
---|
asSortedSource, getArray, getFloat, getInt, getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int bytesPerValue
Method Detail |
---|
public static DocValuesArraySource forType(DocValues.Type type)
DocValuesArraySource
for the given
DocValues.Type
.
public abstract BytesRef getBytes(int docID, BytesRef ref)
DocValues.Source
BytesRef
for the given document id or throws an
UnsupportedOperationException
if this source doesn't support
byte[] values.
getBytes
in class DocValues.Source
public abstract DocValuesArraySource newFromInput(IndexInput input, int numDocs) throws IOException
DocValuesArraySource
by loading a
previously saved one from an IndexInput
.
IOException
public abstract DocValuesArraySource newFromArray(Object array)
DocValuesArraySource
from a native
array.
public final boolean hasArray()
DocValues.Source
true
iff this DocValues.Source
exposes an array via
DocValues.Source.getArray()
otherwise false
.
hasArray
in class DocValues.Source
true
iff this DocValues.Source
exposes an array via
DocValues.Source.getArray()
otherwise false
.public void toBytes(long value, BytesRef bytesRef)
BytesRef
.
public void toBytes(double value, BytesRef bytesRef)
BytesRef
.
public static void copyLong(BytesRef ref, long value)
NOTE: this method resets the offset to 0, length to 8 and resizes the reference array if needed.
public static void copyInt(BytesRef ref, int value)
NOTE: this method resets the offset to 0, length to 4 and resizes the reference array if needed.
public static void copyShort(BytesRef ref, short value)
NOTE: this method resets the offset to 0, length to 2 and resizes the reference array if needed.
public static short asShort(BytesRef b)
NOTE: this method does NOT check the bounds of the referenced array.
public static int asInt(BytesRef b)
NOTE: this method does NOT check the bounds of the referenced array.
public static long asLong(BytesRef b)
NOTE: this method does NOT check the bounds of the referenced array.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |