Class IDCreator


  • public abstract class IDCreator
    extends Object
    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 Detail

      • SET_UNIQUE_POLICY

        public static final int SET_UNIQUE_POLICY
        Old ID generation policy - to generate IDs unique over the entire set
        See Also:
        Constant Field Values
      • OBJECT_UNIQUE_POLICY

        public static final int OBJECT_UNIQUE_POLICY
        New ID generation policy - to generate IDs unique only in a molecule
        See Also:
        Constant Field Values
    • Constructor Detail

      • IDCreator

        public IDCreator()
    • Method Detail

      • 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:
        OBJECT_UNIQUE_POLICY, SET_UNIQUE_POLICY
      • createIDs

        public static 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. Supports IAtomContainer, IAtomContainerSet, IChemFile, IChemModel, IChemSequence, IReaction, IReactionSet, and derived interfaces.
        Parameters:
        chemObject - IChemObject to create IDs for.