Class ChemModelManipulator
java.lang.Object
org.openscience.cdk.tools.manipulator.ChemModelManipulator
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IAtomContainercreateNewMolecule(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.getAllIDs(IChemModel chemModel) static intgetAtomCount(IChemModel chemModel) Get the total number of atoms inside an IChemModel.static intgetBondCount(IChemModel chemModel) Get the total number of bonds inside an IChemModel.static IAtomContainergetRelevantAtomContainer(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 IAtomContainergetRelevantAtomContainer(IChemModel chemModel, IBond bond) Retrieves the first IAtomContainer containing a given IBond from an IChemModel.static IReactiongetRelevantReaction(IChemModel chemModel, IAtom atom) Retrieves the first IReaction containing a given IAtom from an IChemModel.static IChemModelnewChemModel(IAtomContainer atomContainer) Create a new ChemModel containing an IAtomContainer.static voidremoveAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) Remove an Atom and the connected ElectronContainers from all AtomContainers inside an IChemModel.static voidremoveElectronContainer(IChemModel chemModel, IElectronContainer electrons) Remove an ElectronContainer from all AtomContainers inside an IChemModel.static voidsetAtomProperties(IChemModel chemModel, Object propKey, Object propVal) Sets the AtomProperties of all Atoms inside an IChemModel.
-
Constructor Details
-
ChemModelManipulator
public ChemModelManipulator()
-
-
Method Details
-
getAtomCount
Get the total number of atoms inside an IChemModel.- Parameters:
chemModel- The IChemModel object.- Returns:
- The number of Atom object inside.
-
getBondCount
Get the total number of bonds inside an IChemModel.- Parameters:
chemModel- The IChemModel object.- Returns:
- The number of Bond object inside.
-
removeAtomAndConnectedElectronContainers
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
Remove an ElectronContainer from all AtomContainers inside an IChemModel.- Parameters:
chemModel- The IChemModel object.electrons- The ElectronContainer to remove.
-
createNewMolecule
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
Create a new ChemModel containing an IAtomContainer. It will create anIAtomContainerfrom 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
This badly named methods tries to determine which AtomContainer in the ChemModel is best suited to contain added Atom's and Bond's. -
getRelevantAtomContainer
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
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
Returns all the AtomContainer's of a ChemModel. -
setAtomProperties
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
Retrieve a List of all ChemObject objects within an IChemModel.- Parameters:
chemModel- The IChemModel object.- Returns:
- A List of all ChemObjects inside.
-
getAllIDs
-