Class AbstractShapeGenerator<D extends ShapeDescriptor,P extends AbstractShapeGeneratorParameter>
- java.lang.Object
-
- com.chemaxon.descriptors.alignment.AbstractShapeGenerator<D,P>
-
- Type Parameters:
D
-P
-
- All Implemented Interfaces:
DescriptorGenerator<D>
,DescriptorSerializer<D>
,Guarded
,Serializable
@Beta @PublicAPI public abstract class AbstractShapeGenerator<D extends ShapeDescriptor,P extends AbstractShapeGeneratorParameter> extends Object implements DescriptorGenerator<D>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.chemaxon.descriptors.common.Guarded
Guarded.EnsureThat, Guarded.New
-
-
Field Summary
Fields Modifier and Type Field Description protected P
parameters
-
Constructor Summary
Constructors Constructor Description AbstractShapeGenerator(P parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
D
fromString(String desc)
Builds a descriptor from its string representation.D
getBareDescriptor(D descriptor)
Get bare-only form of a descriptor.Object
getGuardObject()
Gets the guard object associated to the generated descriptors/utilities.P
getParameters()
Gets the parameter object.int
hashCode()
byte[]
toByteArray(D desc)
Creates the byte array representation of a descriptor object.String
toString()
String
toString(D desc)
Creates the String representation of a descriptor object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.chemaxon.descriptors.common.DescriptorGenerator
comparisonContextFactory, defaultComparison, generateDescriptor, getDefaultComparator
-
Methods inherited from interface com.chemaxon.descriptors.common.DescriptorSerializer
fromByteArray, serializerIsEqualWith
-
-
-
-
Field Detail
-
parameters
protected final P extends AbstractShapeGeneratorParameter parameters
-
-
Constructor Detail
-
AbstractShapeGenerator
public AbstractShapeGenerator(P parameters)
-
-
Method Detail
-
toByteArray
public byte[] toByteArray(D desc)
Description copied from interface:DescriptorSerializer
Creates the byte array representation of a descriptor object. Note that implementations of this method must ensure the matching of associated guard objects.The descriptors bare form can be reconstructed using
DescriptorSerializer.fromByteArray(byte[])
.- Specified by:
toByteArray
in interfaceDescriptorSerializer<D extends ShapeDescriptor>
- Parameters:
desc
- Descriptor (only bare form is considered)- Returns:
- Byte array representation of the descriptor
-
toString
public String toString(D desc)
Description copied from interface:DescriptorSerializer
Creates the String representation of a descriptor object.The descriptors bare form can be reconstructed using
DescriptorSerializer.fromString(java.lang.String)
.- Specified by:
toString
in interfaceDescriptorSerializer<D extends ShapeDescriptor>
- Parameters:
desc
- Descriptor (only bare form is considered)- Returns:
- String representation of descriptor
-
fromString
public D fromString(String desc)
Description copied from interface:DescriptorSerializer
Builds a descriptor from its string representation.Please note that the compatibility of this (the reconstructing)
DescriptorGenerator
, regarding to the serializing generator (on whichDescriptorSerializer.toString(com.chemaxon.descriptors.common.Descriptor)
was called to construct the String form) is not checked; compatibility must be ensured by the user application.- Specified by:
fromString
in interfaceDescriptorSerializer<D extends ShapeDescriptor>
- Parameters:
desc
- String representation- Returns:
- Reconstructed descriptors bare form
-
getParameters
public P getParameters()
Description copied from interface:DescriptorGenerator
Gets the parameter object.- Specified by:
getParameters
in interfaceDescriptorGenerator<D extends ShapeDescriptor>
- Returns:
- paramater obj
-
getBareDescriptor
public D getBareDescriptor(D descriptor)
Description copied from interface:DescriptorGenerator
Get bare-only form of a descriptor.- Specified by:
getBareDescriptor
in interfaceDescriptorGenerator<D extends ShapeDescriptor>
- Parameters:
descriptor
- A descriptor's rich or bare form- Returns:
- Bare-only representation of given descriptor
-
getGuardObject
public Object getGuardObject()
Description copied from interface:Guarded
Gets the guard object associated to the generated descriptors/utilities. Note that serialization/deserialization must preserve guard object reference.This method is intended to use only for ensuring the compatibility of manipulated objects.
Implementations might use the associated
DescriptorGenerator
orDescriptorParameters
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.- Specified by:
getGuardObject
in interfaceGuarded
- Returns:
- The guard object, can not be
null
.
-
-