public final class ShapeGenerator extends AbstractShapeGenerator<ShapeDescriptor,ShapeGeneratorParameter>
Guarded.EnsureThat, Guarded.New
parameters
Constructor and Description |
---|
ShapeGenerator(ShapeGeneratorParameter parameters) |
Modifier and Type | Method and Description |
---|---|
ComparisonContextFactory<ShapeComparator<ShapeDescriptor>,ShapeDescriptor,? extends Serializable> |
comparisonContextFactory()
Get an unguarded context factory.
|
ShapeComparator<ShapeDescriptor> |
defaultComparison()
Default comparator.
|
Shape |
fromByteArray(byte[] desc)
Builds a descriptor from its byte array representation.
|
Shape |
generateDescriptor(Molecule mol)
Calculates the associated descriptor for the given Molecule.
|
ShapeComparator<ShapeDescriptor> |
getDefaultComparator()
Deprecated.
|
ShapeComparator<ShapeDescriptor> |
getShapeComparator(ShapeComparatorParameter params) |
boolean |
serializerIsEqualWith(DescriptorSerializer other)
Check strict equivalence of serializers.
|
equals, fromString, getBareDescriptor, getGuardObject, getParameters, hashCode, toByteArray, toString, toString
public ShapeGenerator(ShapeGeneratorParameter parameters)
public Shape generateDescriptor(Molecule mol)
DescriptorGenerator
Note that different descriptors/application scenarios might need different structure standardization.
Currently structure standardization is generally not in the scope of the responsibilities of
DescriptorGenerator
to the possible maximal extent.
Since the returned descriptor might contain additional data (reference to input Molecule
, etc) if
it is stored for later comparison it is recommended to use the bare-only representation returned by
DescriptorGenerator.getBareDescriptor(com.chemaxon.descriptors.common.Descriptor)
.
mol
- Input moleculeDescriptorGenerator.getBareDescriptor(com.chemaxon.descriptors.common.Descriptor)
on either the rich or the
bare representation.@Deprecated public ShapeComparator<ShapeDescriptor> getDefaultComparator()
DescriptorGenerator
public ShapeComparator<ShapeDescriptor> getShapeComparator(ShapeComparatorParameter params)
public Shape fromByteArray(byte[] desc)
DescriptorSerializer
Please note that the compatibility of this (the reconstructing) DescriptorGenerator
, regarding to the
serializing generator (on which
DescriptorSerializer.toByteArray(com.chemaxon.descriptors.common.Descriptor)
was called to construct the
byte array form) is not checked; compatibility must be ensured by the user application.
desc
- Byte array of the descriptorpublic ComparisonContextFactory<ShapeComparator<ShapeDescriptor>,ShapeDescriptor,? extends Serializable> comparisonContextFactory()
DescriptorGenerator
byte []
serialization based unguarded representation.
Implementations are expected to provide additional factory methods for unguarded and plain descriptor comparators for implemented metrics.
public ShapeComparator<ShapeDescriptor> defaultComparison()
DescriptorGenerator
public boolean serializerIsEqualWith(DescriptorSerializer other)
DescriptorSerializer
other
- Other serializertrue
when and only when the two serializers (this
and other
) are the same thus
interchangeable. Implementations typically check class equivalence, guard object match and parameter match.