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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfromString(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.inthashCode()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, waitMethods inherited from interface com.chemaxon.descriptors.common.DescriptorGenerator
comparisonContextFactory, defaultComparison, generateDescriptorMethods inherited from interface com.chemaxon.descriptors.common.DescriptorSerializer
fromByteArray, serializerIsEqualWith
-
Field Details
-
parameters
-
-
Constructor Details
-
AbstractShapeGenerator
-
-
Method Details
-
toByteArray
Description copied from interface:DescriptorSerializerCreates 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:
toByteArrayin interfaceDescriptorSerializer<D extends ShapeDescriptor>- Parameters:
desc- Descriptor (only bare form is considered)- Returns:
- Byte array representation of the descriptor
-
toString
Description copied from interface:DescriptorSerializerCreates the String representation of a descriptor object.The descriptors bare form can be reconstructed using
DescriptorSerializer.fromString(java.lang.String).- Specified by:
toStringin interfaceDescriptorSerializer<D extends ShapeDescriptor>- Parameters:
desc- Descriptor (only bare form is considered)- Returns:
- String representation of descriptor
-
fromString
Description copied from interface:DescriptorSerializerBuilds 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:
fromStringin interfaceDescriptorSerializer<D extends ShapeDescriptor>- Parameters:
desc- String representation- Returns:
- Reconstructed descriptors bare form
-
getParameters
Description copied from interface:DescriptorGeneratorGets the parameter object.- Specified by:
getParametersin interfaceDescriptorGenerator<D extends ShapeDescriptor>- Returns:
- paramater obj
-
toString
-
hashCode
public int hashCode() -
equals
-
getBareDescriptor
Description copied from interface:DescriptorGeneratorGet bare-only form of a descriptor.- Specified by:
getBareDescriptorin 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:GuardedGets 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
DescriptorGeneratororDescriptorParametersreference 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:
getGuardObjectin interfaceGuarded- Returns:
- The guard object, can not be
null.
-