Package com.oracle.coherence.ai.search
Class ConverterResult<K,V>
java.lang.Object
com.oracle.coherence.ai.search.ConverterResult<K,V>
- Type Parameters:
K
- the type of the vector keysV
- the type of the query result
- All Implemented Interfaces:
QueryResult<K,
,V> SerializationSupport
,Serializable
public class ConverterResult<K,V>
extends Object
implements QueryResult<K,V>, Serializable, SerializationSupport
A wrapper around a
BinaryQueryResult
that can convert
the result to a different type.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionTheConverter
that can deserialize binary data.protected final BinaryQueryResult
The wrappedBinaryQueryResult
. -
Constructor Summary
ConstructorsConstructorDescriptionConverterResult
(BinaryQueryResult wrapped, Converter<Binary, ?> converter) Create aConverterResult
. -
Method Summary
Modifier and TypeMethodDescriptionReturn the wrappedBinaryQueryResult
.Return theConverter
used to convert serialized binary data to Object format data.double
The result value obtained by executing the query on the vector.getKey()
Returns the key for the entry this result matches.getValue()
Returns the value for the entry this result matches.toString()
Designate an alternative object to be used when writing an object to the buffer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tangosol.io.SerializationSupport
readResolve
-
Field Details
-
wrapped
The wrappedBinaryQueryResult
. -
converter
TheConverter
that can deserialize binary data.
-
-
Constructor Details
-
ConverterResult
Create aConverterResult
.- Parameters:
wrapped
- theBinaryQueryResult
to convertconverter
- theConverter
to convert binary serialized values to Object form
-
-
Method Details
-
getBinaryQueryResult
Return the wrappedBinaryQueryResult
.- Returns:
- the wrapped
BinaryQueryResult
-
getConverter
Return theConverter
used to convert serialized binary data to Object format data.- Returns:
- the
Converter
used to convert serialized binary data to Object format data
-
getDistance
public double getDistance()Description copied from interface:QueryResult
The result value obtained by executing the query on the vector.- Specified by:
getDistance
in interfaceQueryResult<K,
V> - Returns:
- the result value obtained by executing the query on the vector
-
getKey
Description copied from interface:QueryResult
Returns the key for the entry this result matches.- Specified by:
getKey
in interfaceQueryResult<K,
V> - Returns:
- the key for the entry this result matches
-
getValue
Description copied from interface:QueryResult
Returns the value for the entry this result matches.- Specified by:
getValue
in interfaceQueryResult<K,
V> - Returns:
- the value for the entry this result matches
-
toString
-
writeReplace
Description copied from interface:SerializationSupport
Designate an alternative object to be used when writing an object to the buffer.This method is invoked by the
Serializer
if the object implementsSerializationSupport
interface.- Specified by:
writeReplace
in interfaceSerializationSupport
- Returns:
- an object which state should be written instead of the original one
- Throws:
ObjectStreamException
-