@TestClass(value="org.openscience.cdk.tools.manipulator.ChemModelManipulatorTest") public class ChemModelManipulator extends Object
ChemModelManipulator.removeAtomAndConnectedElectronContainers(chemModel, atom);will find the Atom in the model by traversing the ChemModel's MoleculeSet, Crystal and ReactionSet fields and remove it with the removeAtomAndConnectedElectronContainers(Atom) method.
Constructor and Description |
---|
ChemModelManipulator() |
Modifier and Type | Method and 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.
|
@TestMethod(value="testGetAtomCount_IChemModel") public static int getAtomCount(IChemModel chemModel)
chemModel
- The IChemModel object.@TestMethod(value="testGetBondCount_IChemModel") public static int getBondCount(IChemModel chemModel)
chemModel
- The IChemModel object.@TestMethod(value="testRemoveAtomAndConnectedElectronContainers_IChemModel_IAtom") public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom)
chemModel
- The IChemModel object.atom
- The Atom object to remove.@TestMethod(value="testRemoveElectronContainer_IChemModel_IElectronContainer") public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons)
chemModel
- The IChemModel object.electrons
- The ElectronContainer to remove.@TestMethod(value="testCreateNewMolecule_IChemModel") public static IAtomContainer createNewMolecule(IChemModel chemModel)
chemModel
- The ChemModel object.@TestMethod(value="testNewChemModel_IAtomContainer") public static IChemModel newChemModel(IAtomContainer atomContainer)
atomContainer
- The AtomContainer to have inside the ChemModel.@TestMethod(value="testGetRelevantAtomContainer_IChemModel_IAtom") public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom)
@TestMethod(value="testGetRelevantAtomContainer_IChemModel_IBond") public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond)
chemModel
- The IChemModel object.bond
- The IBond object to search.@TestMethod(value="testGetRelevantReaction_IChemModel_IAtom") public static IReaction getRelevantReaction(IChemModel chemModel, IAtom atom)
chemModel
- The IChemModel object.atom
- The IAtom object to search.@TestMethod(value="testGetAllAtomContainers_IChemModel") public static List<IAtomContainer> getAllAtomContainers(IChemModel chemModel)
@TestMethod(value="testSetAtomProperties_IChemModel_Object_Object") public static void setAtomProperties(IChemModel chemModel, Object propKey, Object propVal)
chemModel
- The IChemModel object.propKey
- The key of the property.propVal
- The value of the property.@TestMethod(value="testGetAllChemObjects_IChemModel") public static List<IChemObject> getAllChemObjects(IChemModel chemModel)
chemModel
- The IChemModel object.@TestMethod(value="testGetAllIDs_IChemModel") public static List<String> getAllIDs(IChemModel chemModel)