D
- Type of compared descriptors@Beta @PublicAPI public interface DescriptorComparator<D extends Descriptor> extends Serializable, Guarded
Please note that descriptor comparison is done on the bare descriptor level.
Please note that this interface is marked with Beta
annotation, so it can be subject of incompatible
changes or removal in later releases.
Guarded.EnsureThat, Guarded.New
Modifier and Type | Method and Description |
---|---|
double |
calculateDissimilarity(byte[] target,
byte[] query)
Compare two descriptors in serialized form.
|
double |
calculateDissimilarity(D target,
D query)
Compare two descriptors.
|
double |
calculateSimilarity(byte[] target,
byte[] query)
Compare two descriptors in serialized form.
|
double |
calculateSimilarity(D target,
D query)
Compare two descriptors.
|
ComparisonResult |
compare(byte[] target,
byte[] query)
Compare two descriptors in serialized form.
|
ComparisonResult |
compare(D target,
D query)
Compare two descriptors.
|
Optional<Double> |
getLowerBound()
Get lower bound for the similarity/dissimilarity values if such one can be determined.
|
MetricMetadata |
getMetricMetadata()
Metadata about this metric.
|
Optional<Double> |
getUpperBound()
Get upper bound for the similarity/dissimilarity values if such one can be determined.
|
UnguardedContext<D,?> |
unguardedContext()
Associated unguarded context.
|
getGuardObject
ComparisonResult compare(D target, D query)
Please note that some implementation might return a result object containing additional data related to the compariosn results.
target
- Target descriptorquery
- Query descriptorComparisonResult compare(byte[] target, byte[] query)
Please note that some implementation might return a result object containing additional data related to the
compariosn results. This method's functionality is equivalent to comparing
(with compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)
)
deserialized
(by DescriptorSerializer.fromByteArray(byte[])
) descriptors.
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized formdouble calculateSimilarity(D target, D query)
Please note that this convenience method wraps ComparisonResult.getSimilarity()
of comparison result
constructed by
compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)
target
- Target descriptorquery
- Query descriptordouble calculateDissimilarity(D target, D query)
Please note that this convenience method wraps ComparisonResult.getDissimilarity()
of comparison
result constructed by
compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)
target
- Target descriptorquery
- Query descriptordouble calculateSimilarity(byte[] target, byte[] query)
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized formdouble calculateDissimilarity(byte[] target, byte[] query)
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized formOptional<Double> getLowerBound()
Optional<Double> getUpperBound()
MetricMetadata getMetricMetadata()
It is guaranteed that the actual instance returned can be used as a parameter of the appropriate comparator
getter method of the associated DescriptorGenerator
UnguardedContext<D,?> unguardedContext()