public class MoleculeSet extends AtomContainerSet implements IMoleculeSet, Cloneable
Molecule[] mols = setOfMolecules.getMolecules(); for (int i=0; i < mols.length; i++) { Molecule mol = mols[i]; }and
for (int i=0; i < setOfMolecules.getMoleculeCount(); i++) { Molecule mol = setOfMolecules.getMolecule(i); }
Constructor and Description |
---|
MoleculeSet() |
Modifier and Type | Method and Description |
---|---|
void |
add(IMoleculeSet moleculeSet)
Adds all molecules in the MoleculeSet to this container.
|
void |
addAtomContainer(IAtomContainer atomContainer)
Adds an atomContainer to this container.
|
void |
addAtomContainer(IAtomContainer atomContainer,
double multiplier)
Adds an atomContainer to this container with the given
multiplier.
|
void |
addMolecule(IMolecule molecule)
Adds an molecule to this container.
|
Object |
clone()
Clones this MoleculeSet and its content.
|
IMolecule |
getMolecule(int number)
Returns the Molecule at position
number in the
container. |
int |
getMoleculeCount()
Returns the number of Molecules in this Container.
|
Iterable<IAtomContainer> |
molecules()
Returns the array of Molecules of this container.
|
void |
setMolecules(IMolecule[] molecules)
Sets the molecules in the IMoleculeSet, removing previously added
IMolecule's.
|
void |
stateChanged(IChemObjectChangeEvent event)
Called by objects to which this object has
registered as a listener.
|
String |
toString()
Returns the String representation of this AtomContainerSet.
|
add, atomContainers, getAtomContainer, getAtomContainerCount, getMultiplier, getMultiplier, getMultipliers, isEmpty, removeAllAtomContainers, removeAtomContainer, removeAtomContainer, replaceAtomContainer, setMultiplier, setMultiplier, setMultipliers, sortAtomContainers
addListener, compare, getBuilder, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
add, atomContainers, getAtomContainer, getAtomContainerCount, getMultiplier, getMultiplier, getMultipliers, isEmpty, removeAllAtomContainers, removeAtomContainer, removeAtomContainer, replaceAtomContainer, setMultiplier, setMultiplier, setMultipliers, sortAtomContainers
addListener, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
public void addAtomContainer(IAtomContainer atomContainer)
addAtomContainer
in interface IAtomContainerSet
addAtomContainer
in class AtomContainerSet
atomContainer
- The IMolecule to be added to this containerIllegalArgumentException
- when the passed IAtomContainer is not
an IMolecule.public void addAtomContainer(IAtomContainer atomContainer, double multiplier)
addAtomContainer
in interface IAtomContainerSet
addAtomContainer
in class AtomContainerSet
atomContainer
- The atomContainer to be added to this containermultiplier
- The multiplier of this atomContainerIllegalArgumentException
- when the passed IAtomContainer is not
an IMolecule.public void addMolecule(IMolecule molecule)
addMolecule
in interface IMoleculeSet
molecule
- The molecule to be added to this containerpublic void add(IMoleculeSet moleculeSet)
add
in interface IMoleculeSet
moleculeSet
- The MoleculeSetpublic void setMolecules(IMolecule[] molecules)
IMoleculeSet
setMolecules
in interface IMoleculeSet
molecules
- New set of moleculesIMoleculeSet.molecules()
public Iterable<IAtomContainer> molecules()
molecules
in interface IMoleculeSet
setMolecules(org.openscience.cdk.interfaces.IMolecule[])
public IMolecule getMolecule(int number)
number
in the
container.getMolecule
in interface IMoleculeSet
number
- The position of the Molecule to be returned.number
.public int getMoleculeCount()
getMoleculeCount
in interface IMoleculeSet
public Object clone() throws CloneNotSupportedException
clone
in interface IChemObject
clone
in class AtomContainerSet
CloneNotSupportedException
- if the IChemObject cannot be clonedpublic String toString()
AtomContainerSet
toString
in interface IChemObject
toString
in class AtomContainerSet
public void stateChanged(IChemObjectChangeEvent event)
stateChanged
in interface IChemObjectListener
stateChanged
in class AtomContainerSet
event
- A change event pointing to the source of the change