Package org.openscience.cdk.tools
Class IDCreator
java.lang.Object
org.openscience.cdk.tools.IDCreator
Class that provides methods to give unique IDs to ChemObjects.
Methods are implemented for Atom, Bond, AtomContainer, AtomContainerSet
and Reaction. It will only create missing IDs. If you want to create new
IDs for all ChemObjects, you need to delete them first.
- Author:
- Egon Willighagen
- Source code:
- main
- Belongs to CDK module:
- standard
- Keywords:
- id, creation
- Created on:
- 2003-04-01
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
New ID generation policy - to generate IDs unique only in a moleculestatic final int
Old ID generation policy - to generate IDs unique over the entire set -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
createIDs
(IChemObject chemObject) Labels the Atom's and Bond's in the AtomContainer using the a1, a2, b1, b2 scheme often used in CML.static void
setIDPolicy
(int policy) Alters the policy of ID generation.
-
Field Details
-
SET_UNIQUE_POLICY
public static final int SET_UNIQUE_POLICYOld ID generation policy - to generate IDs unique over the entire set- See Also:
-
OBJECT_UNIQUE_POLICY
public static final int OBJECT_UNIQUE_POLICYNew ID generation policy - to generate IDs unique only in a molecule- See Also:
-
-
Constructor Details
-
IDCreator
public IDCreator()
-
-
Method Details
-
setIDPolicy
public static void setIDPolicy(int policy) Alters the policy of ID generation. The IDCreator should in any case preserve the already existing IDs therefore if one of objects already has an ID set, this ID will be skipped in all the cases when attempting to generate a new ID value- Parameters:
policy
- new policy to be used- See Also:
-
createIDs
Labels the Atom's and Bond's in the AtomContainer using the a1, a2, b1, b2 scheme often used in CML. Supports IAtomContainer, IAtomContainerSet, IChemFile, IChemModel, IChemSequence, IReaction, IReactionSet, and derived interfaces.- Parameters:
chemObject
- IChemObject to create IDs for.
-