jklustor-all-api-0.0.7-20140619012755 (ChemAxon)


com.chemaxon.descriptors.common
Interface DescriptorComparator<D extends Descriptor>

Type Parameters:
D - Type of compared descriptors
All Superinterfaces:
Serializable
All Known Subinterfaces:
CfpComparator, EcfpComparator, PfComparator, ShapeComparator<T>
All Known Implementing Classes:
AbstractShapeComparator

@Beta
public interface DescriptorComparator<D extends Descriptor>
extends Serializable

Common functionality for descriptor comparison.

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.

Author:
Gabor Imre

Method Summary
 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.
 

Method Detail

compare

ComparisonResult compare(D target,
                         D query)
Compare two descriptors.

Please note that some implementation might return a result object containing additional data related to the compariosn results.

Parameters:
target - Target descriptor
query - Query descriptor
Returns:
Comparison result wrapper

compare

ComparisonResult compare(byte[] target,
                         byte[] query)
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 (by DescriptorGenerator.fromByteArray(byte[])) descriptors.

Parameters:
target - Target descriptor in its serialized form
query - Query descriptor in its serialized form
Returns:
Comparison result wrapper

calculateSimilarity

double calculateSimilarity(D target,
                           D query)
Compare two descriptors.

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)

Parameters:
target - Target descriptor
query - Query descriptor
Returns:
Similarity result

calculateDissimilarity

double calculateDissimilarity(D target,
                              D query)
Compare two descriptors.

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)

Parameters:
target - Target descriptor
query - 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 form
query - 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 form
query - Query descriptor in its serialized form
Returns:
Dissimilarity result

getLowerBound

Optional<Double> getLowerBound()
Get lower bound for the similarity/dissimilarity values if such one can be determined.

Returns:
Lower bond if exists; otherwise absent

getUpperBound

Optional<Double> 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

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)