Class ChemModelManipulator
- java.lang.Object
-
- org.openscience.cdk.tools.manipulator.ChemModelManipulator
-
public class ChemModelManipulator extends Object
Class with convenience methods that provide methods from methods from ChemObjects within the ChemModel. For example:ChemModelManipulator.removeAtom(chemModel, atom);
will find the Atom in the model by traversing the ChemModel's MoleculeSet, Crystal and ReactionSet fields and remove it with the removeAtom(Atom) method.- See Also:
AtomContainer.removeAtomAndConnectedElectronContainers(IAtom)
- Source code:
- main
- Belongs to CDK module:
- standard
-
-
Constructor Summary
Constructors Constructor Description ChemModelManipulator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IAtomContainer
createNewMolecule(IChemModel chemModel)
Adds a new Molecule to the MoleculeSet inside a given ChemModel.static List<IAtomContainer>
getAllAtomContainers(IChemModel chemModel)
Returns all the AtomContainer's of a ChemModel.static List<IChemObject>
getAllChemObjects(IChemModel chemModel)
Retrieve a List of all ChemObject objects within an IChemModel.static List<String>
getAllIDs(IChemModel chemModel)
static int
getAtomCount(IChemModel chemModel)
Get the total number of atoms inside an IChemModel.static int
getBondCount(IChemModel chemModel)
Get the total number of bonds inside an IChemModel.static IAtomContainer
getRelevantAtomContainer(IChemModel chemModel, IAtom atom)
This badly named methods tries to determine which AtomContainer in the ChemModel is best suited to contain added Atom's and Bond's.static IAtomContainer
getRelevantAtomContainer(IChemModel chemModel, IBond bond)
Retrieves the first IAtomContainer containing a given IBond from an IChemModel.static IReaction
getRelevantReaction(IChemModel chemModel, IAtom atom)
Retrieves the first IReaction containing a given IAtom from an IChemModel.static IChemModel
newChemModel(IAtomContainer atomContainer)
Create a new ChemModel containing an IAtomContainer.static void
removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom)
Remove an Atom and the connected ElectronContainers from all AtomContainers inside an IChemModel.static void
removeElectronContainer(IChemModel chemModel, IElectronContainer electrons)
Remove an ElectronContainer from all AtomContainers inside an IChemModel.static void
setAtomProperties(IChemModel chemModel, Object propKey, Object propVal)
Sets the AtomProperties of all Atoms inside an IChemModel.
-
-
-
Method Detail
-
getAtomCount
public static int getAtomCount(IChemModel chemModel)
Get the total number of atoms inside an IChemModel.- Parameters:
chemModel
- The IChemModel object.- Returns:
- The number of Atom object inside.
-
getBondCount
public static int getBondCount(IChemModel chemModel)
Get the total number of bonds inside an IChemModel.- Parameters:
chemModel
- The IChemModel object.- Returns:
- The number of Bond object inside.
-
removeAtomAndConnectedElectronContainers
public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom)
Remove an Atom and the connected ElectronContainers from all AtomContainers inside an IChemModel.- Parameters:
chemModel
- The IChemModel object.atom
- The Atom object to remove.
-
removeElectronContainer
public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons)
Remove an ElectronContainer from all AtomContainers inside an IChemModel.- Parameters:
chemModel
- The IChemModel object.electrons
- The ElectronContainer to remove.
-
createNewMolecule
public static IAtomContainer createNewMolecule(IChemModel chemModel)
Adds a new Molecule to the MoleculeSet inside a given ChemModel. Creates a MoleculeSet if none is contained.- Parameters:
chemModel
- The ChemModel object.- Returns:
- The created Molecule object.
-
newChemModel
public static IChemModel newChemModel(IAtomContainer atomContainer)
Create a new ChemModel containing an IAtomContainer. It will create anIAtomContainer
from the passed IAtomContainer when needed, which may cause information loss.- Parameters:
atomContainer
- The AtomContainer to have inside the ChemModel.- Returns:
- The new IChemModel object.
-
getRelevantAtomContainer
public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom)
This badly named methods tries to determine which AtomContainer in the ChemModel is best suited to contain added Atom's and Bond's.
-
getRelevantAtomContainer
public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond)
Retrieves the first IAtomContainer containing a given IBond from an IChemModel.- Parameters:
chemModel
- The IChemModel object.bond
- The IBond object to search.- Returns:
- The IAtomContainer object found, null if none is found.
-
getRelevantReaction
public static IReaction getRelevantReaction(IChemModel chemModel, IAtom atom)
Retrieves the first IReaction containing a given IAtom from an IChemModel.- Parameters:
chemModel
- The IChemModel object.atom
- The IAtom object to search.- Returns:
- The IAtomContainer object found, null if none is found.
-
getAllAtomContainers
public static List<IAtomContainer> getAllAtomContainers(IChemModel chemModel)
Returns all the AtomContainer's of a ChemModel.
-
setAtomProperties
public static void setAtomProperties(IChemModel chemModel, Object propKey, Object propVal)
Sets the AtomProperties of all Atoms inside an IChemModel.- Parameters:
chemModel
- The IChemModel object.propKey
- The key of the property.propVal
- The value of the property.
-
getAllChemObjects
public static List<IChemObject> getAllChemObjects(IChemModel chemModel)
Retrieve a List of all ChemObject objects within an IChemModel.- Parameters:
chemModel
- The IChemModel object.- Returns:
- A List of all ChemObjects inside.
-
getAllIDs
public static List<String> getAllIDs(IChemModel chemModel)
-
-