Interface DescriptorComparator<D extends Descriptor>
- Type Parameters:
D
- Type of compared descriptors
- All Superinterfaces:
Guarded
,Serializable
- All Known Subinterfaces:
CfpComparator
,EcfpComparator
,MaccsComparator
,PfComparator
,ShapeComparator<T>
- All Known Implementing Classes:
AbstractShapeComparator
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.chemaxon.descriptors.common.Guarded
Guarded.EnsureThat, Guarded.New
-
Method Summary
Modifier and TypeMethodDescriptiondouble
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.compare
(byte[] target, byte[] query) Compare two descriptors in serialized form.Compare two descriptors.Get lower bound for the similarity/dissimilarity values if such one can be determined.Metadata about this metric.Get upper bound for the similarity/dissimilarity values if such one can be determined.com.chemaxon.descriptors.common.unguarded.UnguardedContext<D,
?> Associated unguarded context.Methods inherited from interface com.chemaxon.descriptors.common.Guarded
getGuardObject
-
Method Details
-
compare
Compare two descriptors.Please note that some implementation might return a result object containing additional data related to the compariosn results.
- Parameters:
target
- Target descriptorquery
- Query descriptor- Returns:
- Comparison result wrapper
-
compare
Compare two descriptors in serialized form.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 (byDescriptorSerializer.fromByteArray(byte[])
) descriptors.- Parameters:
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized form- Returns:
- Comparison result wrapper
-
calculateSimilarity
Compare two descriptors.Please note that this convenience method wraps
ComparisonResult.getSimilarity()
of comparison result constructed bycompare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)
- Parameters:
target
- Target descriptorquery
- Query descriptor- Returns:
- Similarity result
-
calculateDissimilarity
Compare two descriptors.Please note that this convenience method wraps
ComparisonResult.getDissimilarity()
of comparison result constructed bycompare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)
- Parameters:
target
- Target descriptorquery
- Query descriptor- Returns:
- Dissimilarity result
-
calculateSimilarity
double calculateSimilarity(byte[] target, byte[] query) Compare two descriptors in serialized form.- Parameters:
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized form- Returns:
- Similarity result
-
calculateDissimilarity
double calculateDissimilarity(byte[] target, byte[] query) Compare two descriptors in serialized form.- Parameters:
target
- Target descriptor in its serialized formquery
- Query descriptor in its serialized form- Returns:
- Dissimilarity result
-
getLowerBound
Get lower bound for the similarity/dissimilarity values if such one can be determined.- Returns:
- Lower bond if exists; otherwise absent
-
getUpperBound
Get upper bound for the similarity/dissimilarity values if such one can be determined.- Returns:
- Upper bond if exists; otherwise absent
-
getMetricMetadata
MetricMetadata getMetricMetadata()Metadata about this metric.It is guaranteed that the actual instance returned can be used as a parameter of the appropriate comparator getter method of the associated
DescriptorGenerator
- Returns:
- Metadata of the comparison
-
unguardedContext
com.chemaxon.descriptors.common.unguarded.UnguardedContext<D,?> unguardedContext()Associated unguarded context. For internal use only.- Returns:
- unguarded context
-