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
.int
Return the dimension of the returned vector valuesint
size()
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:RandomAccessVectorValues
Return the number of vector values- Specified by:
size
in interfaceRandomAccessVectorValues
-
dimension
public int dimension()Description copied from interface:RandomAccessVectorValues
Return the dimension of the returned vector values- Specified by:
dimension
in interfaceRandomAccessVectorValues
-
vectorValue
Description copied from interface:RandomAccessVectorValues
Return 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:
vectorValue
in interfaceRandomAccessVectorValues
- Parameters:
targetOrd
- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size()
.- Throws:
IOException
-
binaryValue
Description copied from interface:RandomAccessVectorValues
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. The provided bytes may be shared and overwritten by subsequent calls to this method andRandomAccessVectorValues.vectorValue(int)
.- Specified by:
binaryValue
in interfaceRandomAccessVectorValues
- Parameters:
targetOrd
- a valid ordinal, ≥ 0 and <RandomAccessVectorValues.size()
.- Throws:
IOException
-
copy
Description copied from interface:RandomAccessVectorValues
Creates 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:
copy
in interfaceRandomAccessVectorValues
- Throws:
IOException
-