public final class DRShapeGenerator extends Object implements DescriptorGenerator<DRShapeDescriptor>
Guarded.EnsureThat, Guarded.New| Constructor and Description |
|---|
DRShapeGenerator(DRShapeGeneratorParameter parameters) |
| Modifier and Type | Method and Description |
|---|---|
ComparisonContextFactory<ShapeComparator<DRShapeDescriptor>,DRShapeDescriptor,? extends Serializable> |
comparisonContextFactory()
Get an unguarded context factory.
|
ShapeComparator<DRShapeDescriptor> |
defaultComparison()
Default comparator.
|
boolean |
equals(Object obj) |
DRShapeDescriptor |
fromByteArray(byte[] desc)
Builds a descriptor from its byte array representation.
|
DRShapeDescriptor |
fromString(String desc)
Builds a descriptor from its string representation.
|
DRShapeDescriptor |
generateDescriptor(Molecule mol)
Calculates the associated descriptor for the given Molecule.
|
DRShapeDescriptor |
getBareDescriptor(DRShapeDescriptor descriptor)
Get bare-only form of a descriptor.
|
ShapeComparator<DRShapeDescriptor> |
getDefaultComparator()
Deprecated.
|
Object |
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.
|
DRShapeGeneratorParameter |
getParameters()
Gets the parameter object.
|
ShapeComparator<DRShapeDescriptor> |
getShapeComparator(DRShapeComparatorParameter params) |
int |
hashCode() |
boolean |
serializerIsEqualWith(DescriptorSerializer other)
Check strict equivalence of serializers.
|
byte[] |
toByteArray(DRShapeDescriptor desc)
Creates the byte array representation of a descriptor object.
|
String |
toString() |
String |
toString(DRShapeDescriptor desc)
Creates the String representation of a descriptor object.
|
public DRShapeGenerator(DRShapeGeneratorParameter parameters)
public DRShapeDescriptor generateDescriptor(Molecule mol)
DescriptorGeneratorNote 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).
generateDescriptor in interface DescriptorGenerator<DRShapeDescriptor>mol - Input moleculeDescriptorGenerator.getBareDescriptor(com.chemaxon.descriptors.common.Descriptor) on either the rich or the
bare representation.public byte[] toByteArray(DRShapeDescriptor desc)
DescriptorSerializerThe descriptors bare form can be reconstructed using DescriptorSerializer.fromByteArray(byte[]).
toByteArray in interface DescriptorSerializer<DRShapeDescriptor>desc - Descriptor (only bare form is considered)public String toString(DRShapeDescriptor desc)
DescriptorSerializerThe descriptors bare form can be reconstructed using DescriptorSerializer.fromString(java.lang.String).
toString in interface DescriptorSerializer<DRShapeDescriptor>desc - Descriptor (only bare form is considered)public DRShapeDescriptor fromString(String desc)
DescriptorSerializerPlease note that the compatibility of this (the reconstructing) DescriptorGenerator, regarding to the
serializing generator (on which DescriptorSerializer.toString(com.chemaxon.descriptors.common.Descriptor)
was called to construct the String form) is not checked; compatibility must be ensured by the user application.
fromString in interface DescriptorSerializer<DRShapeDescriptor>desc - String representationpublic DRShapeDescriptor fromByteArray(byte[] desc)
DescriptorSerializerPlease 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.
fromByteArray in interface DescriptorSerializer<DRShapeDescriptor>desc - Byte array of the descriptorpublic DRShapeGeneratorParameter getParameters()
DescriptorGeneratorgetParameters in interface DescriptorGenerator<DRShapeDescriptor>public Object getGuardObject()
GuardedThis method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated DescriptorGenerator or DescriptorParameters reference as
the guard object, however it is a non recommended practice to use this method to access the associated generator
to perform further operations on it.
getGuardObject in interface Guardednull.@Deprecated public ShapeComparator<DRShapeDescriptor> getDefaultComparator()
DescriptorGeneratorgetDefaultComparator in interface DescriptorGenerator<DRShapeDescriptor>public ShapeComparator<DRShapeDescriptor> getShapeComparator(DRShapeComparatorParameter params)
public DRShapeDescriptor getBareDescriptor(DRShapeDescriptor descriptor)
DescriptorGeneratorgetBareDescriptor in interface DescriptorGenerator<DRShapeDescriptor>descriptor - A descriptor's rich or bare formpublic ComparisonContextFactory<ShapeComparator<DRShapeDescriptor>,DRShapeDescriptor,? extends Serializable> comparisonContextFactory()
DescriptorGeneratorbyte [] serialization based unguarded representation.
Implementations are expected to provide additional factory methods for unguarded and plain descriptor comparators for implemented metrics.
comparisonContextFactory in interface DescriptorGenerator<DRShapeDescriptor>public ShapeComparator<DRShapeDescriptor> defaultComparison()
DescriptorGeneratordefaultComparison in interface DescriptorGenerator<DRShapeDescriptor>public boolean serializerIsEqualWith(DescriptorSerializer other)
DescriptorSerializerserializerIsEqualWith in interface DescriptorSerializer<DRShapeDescriptor>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.