Class Lucene94HnswVectorsWriter.RAVectorValues<T>
java.lang.Object
org.apache.lucene.codecs.lucene94.Lucene94HnswVectorsWriter.RAVectorValues<T>
- All Implemented Interfaces:
RandomAccessVectorValues
- Enclosing class:
- Lucene94HnswVectorsWriter
private static class Lucene94HnswVectorsWriter.RAVectorValues<T>
extends Object
implements RandomAccessVectorValues
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbinaryValue(int targetOrd) Return the vector indexed at the given ordinal value as an array of bytes in a BytesRef; these are the bytes corresponding to the float array.copy()Creates a new copy of thisRandomAccessVectorValues.intReturn the dimension of the returned vector valuesintsize()Return the number of vector valuesfloat[]vectorValue(int targetOrd) Return the vector value indexed at the given ordinal.
-
Field Details
-
vectors
-
dim
private final int dim
-
-
Constructor Details
-
RAVectorValues
-
-
Method Details
-
size
public int size()Description copied from interface:RandomAccessVectorValuesReturn the number of vector values- Specified by:
sizein interfaceRandomAccessVectorValues
-
dimension
public int dimension()Description copied from interface:RandomAccessVectorValuesReturn the dimension of the returned vector values- Specified by:
dimensionin interfaceRandomAccessVectorValues
-
vectorValue
Description copied from interface:RandomAccessVectorValuesReturn the vector value indexed at the given ordinal. The provided floating point array may be shared and overwritten by subsequent calls to this method andRandomAccessVectorValues.binaryValue(int).- Specified by:
vectorValuein interfaceRandomAccessVectorValues- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- Throws:
IOException
-
binaryValue
Description copied from interface:RandomAccessVectorValuesReturn the vector indexed at the given ordinal value as an array of bytes in a BytesRef; these are the bytes corresponding to the float array. The provided bytes may be shared and overwritten by subsequent calls to this method andRandomAccessVectorValues.vectorValue(int).- Specified by:
binaryValuein interfaceRandomAccessVectorValues- Parameters:
targetOrd- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size().- Throws:
IOException
-
copy
Description copied from interface:RandomAccessVectorValuesCreates a new copy of thisRandomAccessVectorValues. This is helpful when you need to access different values at once, to avoid overwriting the underlying float vector returned byRandomAccessVectorValues.vectorValue(int).- Specified by:
copyin interfaceRandomAccessVectorValues- Throws:
IOException
-