public class ScoredVectorWithUnsignedIndices
extends java.lang.Object
ScoredVector class, which uses the SparseValues class to represent the sparse values,
this class uses the SparseValuesWithUnsignedIndices class, which allows for the use of unsigned 32-bit
integers as indices.
The ScoredVectorWithUnsignedIndices class contains the following fields:
- score: the score associated with the vector
- id: the identifier of the vector
- values: the dense vector values
- metadata: the metadata associated with the vector
- sparseValuesWithUnsignedIndices: the sparse values associated with the vector, using unsigned 32-bit integer indices
The class provides a constructor that takes a ScoredVector object and converts it to a
ScoredVectorWithUnsignedIndices object, as well as getter and setter methods for each of the fields.
| Constructor and Description |
|---|
ScoredVectorWithUnsignedIndices(ScoredVector scoredVector)
Constructs a
ScoredVectorWithUnsignedIndices object from a ScoredVector object, converting the
SparseValues to SparseValuesWithUnsignedIndices. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getId()
Returns the identifier of the vector.
|
com.google.protobuf.Struct |
getMetadata()
Returns the metadata associated with the vector.
|
float |
getScore()
Returns the score associated with the vector.
|
SparseValuesWithUnsignedIndices |
getSparseValuesWithUnsignedIndices()
Returns the sparse values associated with the vector, using unsigned 32-bit integer indices.
|
java.util.List<java.lang.Float> |
getValuesList()
Returns the dense vector values.
|
void |
setId(java.lang.String id)
Sets the identifier of the vector.
|
void |
setMetadata(com.google.protobuf.Struct metadata)
Sets the metadata associated with the vector.
|
void |
setScore(float score)
Sets the score associated with the vector.
|
void |
setSparseValuesWithUnsignedIndices(SparseValuesWithUnsignedIndices sparseValuesWithUnsignedIndices)
Sets the sparse values associated with the vector, using unsigned 32-bit integer indices.
|
void |
setValues(java.util.List<java.lang.Float> values)
Sets the dense vector values.
|
java.lang.String |
toString() |
public ScoredVectorWithUnsignedIndices(ScoredVector scoredVector)
ScoredVectorWithUnsignedIndices object from a ScoredVector object, converting the
SparseValues to SparseValuesWithUnsignedIndices.scoredVector - the ScoredVector object to convertpublic float getScore()
public void setScore(float score)
score - The new scorepublic java.lang.String getId()
public void setId(java.lang.String id)
id - The new idpublic java.util.List<java.lang.Float> getValuesList()
public void setValues(java.util.List<java.lang.Float> values)
values - The new list of valuespublic com.google.protobuf.Struct getMetadata()
public void setMetadata(com.google.protobuf.Struct metadata)
metadata - The new metadatapublic SparseValuesWithUnsignedIndices getSparseValuesWithUnsignedIndices()
SparseValuesWithUnsignedIndices objectpublic void setSparseValuesWithUnsignedIndices(SparseValuesWithUnsignedIndices sparseValuesWithUnsignedIndices)
sparseValuesWithUnsignedIndices - The new SparseValuesWithUnsignedIndices objectpublic java.lang.String toString()
toString in class java.lang.Object