Class AbstractShapeGenerator<D extends ShapeDescriptor,P extends AbstractShapeGeneratorParameter>
- Type Parameters:
D
-P
-
- All Implemented Interfaces:
DescriptorGenerator<D>
,DescriptorSerializer<D>
,Guarded
,Serializable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.chemaxon.descriptors.common.Guarded
Guarded.EnsureThat, Guarded.New
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
fromString
(String desc) Builds a descriptor from its string representation.getBareDescriptor
(D descriptor) Get bare-only form of a descriptor.Gets the guard object associated to the generated descriptors/utilities.Gets the parameter object.int
hashCode()
byte[]
toByteArray
(D desc) Creates the byte array representation of a descriptor object.toString()
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
Methods inherited from interface com.chemaxon.descriptors.common.DescriptorSerializer
fromByteArray, serializerIsEqualWith
-
Field Details
-
parameters
-
-
Constructor Details
-
AbstractShapeGenerator
-
-
Method Details
-
toByteArray
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
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
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
Description copied from interface:DescriptorGenerator
Gets the parameter object.- Specified by:
getParameters
in interfaceDescriptorGenerator<D extends ShapeDescriptor>
- Returns:
- paramater obj
-
toString
-
hashCode
public int hashCode() -
equals
-
getBareDescriptor
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
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
.
-