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


com.chemaxon.descriptors.alignment
Class AbstractShapeComparator<T extends ShapeDescriptor>

Object
  extended by com.chemaxon.descriptors.alignment.AbstractShapeComparator<T>
Type Parameters:
T -
All Implemented Interfaces:
ShapeComparator<T>, DescriptorComparator<T>, Serializable

@Beta
public abstract class AbstractShapeComparator<T extends ShapeDescriptor>
extends Object
implements ShapeComparator<T>

Author:
Adrian Kalaszi
See Also:
Serialized Form

Constructor Summary
AbstractShapeComparator(DescriptorGenerator<T> generator)
           
 
Method Summary
 double calculateDissimilarity(byte[] target, byte[] query)
          Compare two descriptors in serialized form.
 double calculateDissimilarity(T target, T query)
          Compare two descriptors.
 double calculateSimilarity(byte[] target, byte[] query)
          Compare two descriptors in serialized form.
 double calculateSimilarity(T target, T query)
          Compare two descriptors.
 ShapeComparisonResult compare(byte[] target, byte[] query)
          Compare two descriptors in serialized form.
 Optional<Double> getLowerBound()
          Get lower bound for the similarity/dissimilarity values if such one can be determined.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.chemaxon.descriptors.alignment.ShapeComparator
compare
 
Methods inherited from interface com.chemaxon.descriptors.common.DescriptorComparator
getMetricMetadata, getUpperBound
 

Constructor Detail

AbstractShapeComparator

public AbstractShapeComparator(DescriptorGenerator<T> generator)
Method Detail

calculateSimilarity

public double calculateSimilarity(byte[] target,
                                  byte[] query)
Description copied from interface: DescriptorComparator
Compare two descriptors in serialized form.

Specified by:
calculateSimilarity in interface DescriptorComparator<T extends ShapeDescriptor>
Parameters:
target - Target descriptor in its serialized form
query - Query descriptor in its serialized form
Returns:
Similarity result

calculateDissimilarity

public double calculateDissimilarity(byte[] target,
                                     byte[] query)
Description copied from interface: DescriptorComparator
Compare two descriptors in serialized form.

Specified by:
calculateDissimilarity in interface DescriptorComparator<T extends ShapeDescriptor>
Parameters:
target - Target descriptor in its serialized form
query - Query descriptor in its serialized form
Returns:
Dissimilarity result

getLowerBound

public Optional<Double> getLowerBound()
Description copied from interface: DescriptorComparator
Get lower bound for the similarity/dissimilarity values if such one can be determined.

Specified by:
getLowerBound in interface DescriptorComparator<T extends ShapeDescriptor>
Returns:
Lower bond if exists; otherwise absent

calculateSimilarity

public double calculateSimilarity(T target,
                                  T query)
Description copied from interface: DescriptorComparator
Compare two descriptors.

Please note that this convenience method wraps ComparisonResult.getSimilarity() of comparison result constructed by DescriptorComparator.compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)

Specified by:
calculateSimilarity in interface DescriptorComparator<T extends ShapeDescriptor>
Parameters:
target - Target descriptor
query - Query descriptor
Returns:
Similarity result

calculateDissimilarity

public double calculateDissimilarity(T target,
                                     T query)
Description copied from interface: DescriptorComparator
Compare two descriptors.

Please note that this convenience method wraps ComparisonResult.getDissimilarity() of comparison result constructed by DescriptorComparator.compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)

Specified by:
calculateDissimilarity in interface DescriptorComparator<T extends ShapeDescriptor>
Parameters:
target - Target descriptor
query - Query descriptor
Returns:
Dissimilarity result

compare

public ShapeComparisonResult compare(byte[] target,
                                     byte[] query)
Description copied from interface: DescriptorComparator
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 DescriptorComparator.compare(com.chemaxon.descriptors.common.Descriptor, com.chemaxon.descriptors.common.Descriptor)) deserialized (by DescriptorGenerator.fromByteArray(byte[])) descriptors.

Specified by:
compare in interface ShapeComparator<T extends ShapeDescriptor>
Specified by:
compare in interface DescriptorComparator<T extends ShapeDescriptor>
Parameters:
target - Target descriptor in its serialized form
query - Query descriptor in its serialized form
Returns:
Comparison result wrapper

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