Class IDCreator

java.lang.Object
org.openscience.cdk.tools.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 Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    New ID generation policy - to generate IDs unique only in a molecule
    static final int
    Old ID generation policy - to generate IDs unique over the entire set
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static void
    setIDPolicy(int policy)
    Alters the policy of ID generation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SET_UNIQUE_POLICY

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

      public static final int OBJECT_UNIQUE_POLICY
      New 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

      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.