|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openscience.cdk.ChemObject
org.openscience.cdk.AtomContainer
public class AtomContainer
Base class for all chemical objects that maintain a list of Atoms and ElectronContainers.
Looping over all Bonds in the AtomContainer is typically done like:
Iterator iter = atomContainer.bonds();
while (iter.hasNext()) {
IBond aBond = (IBond) iter.next();
}
| Constructor Summary | |
|---|---|
AtomContainer()
Constructs an empty AtomContainer. |
|
AtomContainer(IAtomContainer container)
Constructs an AtomContainer with a copy of the atoms and electronContainers of another AtomContainer (A shallow copy, i.e., with the same objects as in the original AtomContainer). |
|
AtomContainer(int atomCount,
int bondCount,
int lpCount,
int seCount)
Constructs an empty AtomContainer that will contain a certain number of atoms and electronContainers. |
|
| Method Summary | |
|---|---|
void |
add(IAtomContainer atomContainer)
Adds all atoms and electronContainers of a given atomcontainer to this container. |
void |
addAtom(IAtom atom)
Adds an atom to this container. |
void |
addBond(IBond bond)
Adds a Bond to this AtomContainer. |
void |
addBond(int atom1,
int atom2,
IBond.Order order)
Adds a bond to this container. |
void |
addBond(int atom1,
int atom2,
IBond.Order order,
IBond.Stereo stereo)
Adds a bond to this container. |
void |
addElectronContainer(IElectronContainer electronContainer)
Adds a ElectronContainer to this AtomContainer. |
void |
addLonePair(ILonePair lonePair)
Adds a lone pair to this AtomContainer. |
void |
addLonePair(int atomID)
Adds a LonePair to this Atom. |
void |
addSingleElectron(int atomID)
Adds a LonePair to this Atom. |
void |
addSingleElectron(ISingleElectron singleElectron)
Adds a single electron to this AtomContainer. |
void |
addStereoElement(IStereoElement element)
Adds a stereo element to this container. |
Iterable<IAtom> |
atoms()
Returns an Iterable for looping over all atoms in this container. |
Iterable<IBond> |
bonds()
Returns an Iterable for looping over all bonds in this container. |
Object |
clone()
Clones this AtomContainer object and its content. |
boolean |
contains(IAtom atom)
True, if the AtomContainer contains the given atom object. |
boolean |
contains(IBond bond)
True, if the AtomContainer contains the given bond object. |
boolean |
contains(IElectronContainer electronContainer)
True, if the AtomContainer contains the given ElectronContainer object. |
boolean |
contains(ILonePair lonePair)
True, if the AtomContainer contains the given LonePair object. |
boolean |
contains(ISingleElectron singleElectron)
True, if the AtomContainer contains the given SingleElectron object. |
Iterable<IElectronContainer> |
electronContainers()
Returns an Iterable for looping over all electron containers in this container. |
IAtom |
getAtom(int number)
Get the atom at position number in [0,..]. |
int |
getAtomCount()
Returns the number of Atoms in this Container. |
int |
getAtomNumber(IAtom atom)
Returns the position of a given atom in the atoms array. |
IBond |
getBond(IAtom atom1,
IAtom atom2)
Returns the bond that connects the two given atoms. |
IBond |
getBond(int number)
Get the bond at position number in [0,..]. |
int |
getBondCount()
Returns the number of Bonds in this Container. |
int |
getBondNumber(IAtom atom1,
IAtom atom2)
Returns the position of the bond between two given atoms in the electronContainers array. |
int |
getBondNumber(IBond bond)
Returns the position of a given bond in the electronContainers array. |
double |
getBondOrderSum(IAtom atom)
Deprecated. Replaced by AtomContainerManipulator#getBondOrderSum(IAtomContainer, IAtom) |
int |
getConnectedAtomsCount(IAtom atom)
Returns the number of atoms connected to the given atom. |
List<IAtom> |
getConnectedAtomsList(IAtom atom)
Returns an ArrayList of all atoms connected to the given atom. |
int |
getConnectedBondsCount(IAtom atom)
Returns the number of Bonds for a given Atom. |
int |
getConnectedBondsCount(int atomNumber)
Returns the number of connected atoms (degree) to the given atom. |
List<IBond> |
getConnectedBondsList(IAtom atom)
Returns an ArrayList of all Bonds connected to the given atom. |
List<IElectronContainer> |
getConnectedElectronContainersList(IAtom atom)
Returns an ArrayList of all electronContainers connected to the given atom. |
int |
getConnectedLonePairsCount(IAtom atom)
Returns the number of LonePairs for a given Atom. |
List<ILonePair> |
getConnectedLonePairsList(IAtom atom)
Returns the array of lone pairs connected to an atom. |
int |
getConnectedSingleElectronsCount(IAtom atom)
Returns the sum of the SingleElectron for a given Atom. |
List<ISingleElectron> |
getConnectedSingleElectronsList(IAtom atom)
Returns an array of all SingleElectron connected to the given atom. |
IElectronContainer |
getElectronContainer(int number)
Returns the ElectronContainer at position number in the
container. |
int |
getElectronContainerCount()
Returns the number of ElectronContainers in this Container. |
IAtom |
getFirstAtom()
Returns the atom at position 0 in the container. |
IAtom |
getLastAtom()
Returns the atom at the last position in the container. |
ILonePair |
getLonePair(int number)
Get the lone pair at position number in [0,..]. |
int |
getLonePairCount()
Returns the number of LonePairs in this Container. |
int |
getLonePairNumber(ILonePair lonePair)
Returns the position of a given lone pair in the lone pair array. |
IBond.Order |
getMaximumBondOrder(IAtom atom)
Returns the maximum bond order that this atom currently has in the context of this AtomContainer. |
IBond.Order |
getMinimumBondOrder(IAtom atom)
Returns the minimum bond order that this atom currently has in the context of this AtomContainer. |
ISingleElectron |
getSingleElectron(int number)
Get the single electron at position number in [0,..]. |
int |
getSingleElectronCount()
Returns the number of the single electrons in this container, |
int |
getSingleElectronNumber(ISingleElectron singleElectron)
Returns the position of a given single electron in the single electron array. |
Iterable<ILonePair> |
lonePairs()
Returns an Iterable for looping over all lone pairs in this container. |
void |
remove(IAtomContainer atomContainer)
Removes all atoms and electronContainers of a given atomcontainer from this container. |
void |
removeAllBonds()
Removes all Bonds from this container. |
void |
removeAllElectronContainers()
Removes electronContainers from this container. |
void |
removeAllElements()
Removes all atoms and bond from this container. |
void |
removeAtom(IAtom atom)
Removes the given atom from the AtomContainer. |
void |
removeAtom(int position)
Removes the atom at the given position from the AtomContainer. |
void |
removeAtomAndConnectedElectronContainers(IAtom atom)
Removes the given atom and all connected electronContainers from the AtomContainer. |
IBond |
removeBond(IAtom atom1,
IAtom atom2)
Removes the bond that connects the two given atoms. |
void |
removeBond(IBond bond)
Removes the bond from this container. |
IBond |
removeBond(int position)
Removes the bond at the given position from the AtomContainer. |
void |
removeElectronContainer(IElectronContainer electronContainer)
Removes this ElectronContainer from this container. |
IElectronContainer |
removeElectronContainer(int number)
Removes the bond at the given position from this container. |
void |
removeLonePair(ILonePair lonePair)
Removes the lone pair from the AtomContainer. |
ILonePair |
removeLonePair(int position)
Removes the lone pair at the given position from the AtomContainer. |
ISingleElectron |
removeSingleElectron(int position)
Removes the single electron at the given position from the AtomContainer. |
void |
removeSingleElectron(ISingleElectron singleElectron)
Removes the single electron from the AtomContainer. |
void |
setAtom(int number,
IAtom atom)
Sets the atom at position number in [0,..]. |
void |
setAtoms(IAtom[] atoms)
Sets the array of atoms of this AtomContainer. |
void |
setBonds(IBond[] bonds)
Sets the array of bonds of this AtomContainer. |
Iterable<ISingleElectron> |
singleElectrons()
Returns an Iterable for looping over all single electrons in this container. |
void |
stateChanged(IChemObjectChangeEvent event)
Called by objects to which this object has registered as a listener. |
Iterable<IStereoElement> |
stereoElements()
Returns the stereo elements defined for this atom container. |
String |
toString()
Returns a one line string representation of this Container. |
| Methods inherited from class org.openscience.cdk.ChemObject |
|---|
addListener, compare, getBuilder, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openscience.cdk.interfaces.IChemObject |
|---|
addListener, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty |
| Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject |
|---|
getBuilder |
| Constructor Detail |
|---|
public AtomContainer()
public AtomContainer(IAtomContainer container)
container - An AtomContainer to copy the atoms and electronContainers from
public AtomContainer(int atomCount,
int bondCount,
int lpCount,
int seCount)
atomCount - Number of atoms to be in this containerbondCount - Number of bonds to be in this containerlpCount - Number of lone pairs to be in this containerseCount - Number of single electrons to be in this container| Method Detail |
|---|
public void addStereoElement(IStereoElement element)
addStereoElement in interface IAtomContainerelement - The new IStereoElement for this containerIAtomContainer.stereoElements()public Iterable<IStereoElement> stereoElements()
stereoElements in interface IAtomContainerIterable of IStereoElements.IAtomContainer.addStereoElement(IStereoElement)public void setAtoms(IAtom[] atoms)
setAtoms in interface IAtomContaineratoms - The array of atoms to be assigned to this AtomContainergetAtom(int)public void setBonds(IBond[] bonds)
setBonds in interface IAtomContainerbonds - The array of bonds to be assigned to
this AtomContainergetBond(int)
public void setAtom(int number,
IAtom atom)
number in [0,..].
setAtom in interface IAtomContainernumber - The position of the atom to be set.atom - The atom to be stored at position numbergetAtom(int)public IAtom getAtom(int number)
number in [0,..].
getAtom in interface IAtomContainernumber - The position of the atom to be retrieved.
setAtom(int, org.openscience.cdk.interfaces.IAtom),
setAtoms(org.openscience.cdk.interfaces.IAtom[])public IBond getBond(int number)
number in [0,..].
getBond in interface IAtomContainernumber - The position of the bond to be retrieved.
public ILonePair getLonePair(int number)
number in [0,..].
getLonePair in interface IAtomContainernumber - The position of the LonePair to be retrieved.
public ISingleElectron getSingleElectron(int number)
number in [0,..].
getSingleElectron in interface IAtomContainernumber - The position of the SingleElectron to be retrieved.
public Iterable<IAtom> atoms()
atoms in interface IAtomContainerpublic Iterable<IBond> bonds()
bonds in interface IAtomContainerpublic Iterable<ILonePair> lonePairs()
lonePairs in interface IAtomContainerpublic Iterable<ISingleElectron> singleElectrons()
singleElectrons in interface IAtomContainerpublic Iterable<IElectronContainer> electronContainers()
electronContainers in interface IAtomContainerpublic IAtom getFirstAtom()
getFirstAtom in interface IAtomContainerpublic IAtom getLastAtom()
getLastAtom in interface IAtomContainerpublic int getAtomNumber(IAtom atom)
getAtomNumber in interface IAtomContaineratom - The atom to be sought
public int getBondNumber(IAtom atom1,
IAtom atom2)
getBondNumber in interface IAtomContaineratom1 - The first atomatom2 - The second atom
public int getBondNumber(IBond bond)
getBondNumber in interface IAtomContainerbond - The bond to be sought
public int getLonePairNumber(ILonePair lonePair)
getLonePairNumber in interface IAtomContainerlonePair - The lone pair to be sought
public int getSingleElectronNumber(ISingleElectron singleElectron)
getSingleElectronNumber in interface IAtomContainersingleElectron - The single electron to be sought
public IElectronContainer getElectronContainer(int number)
number in the
container.
getElectronContainer in interface IAtomContainernumber - The position of the ElectronContainer to be returned.
number.IAtomContainer.addElectronContainer(IElectronContainer)
public IBond getBond(IAtom atom1,
IAtom atom2)
getBond in interface IAtomContaineratom1 - The first atomatom2 - The second atom
public int getAtomCount()
getAtomCount in interface IAtomContainerpublic int getBondCount()
getBondCount in interface IAtomContainerpublic int getLonePairCount()
getLonePairCount in interface IAtomContainerpublic int getSingleElectronCount()
getSingleElectronCount in interface IAtomContainerpublic int getElectronContainerCount()
getElectronContainerCount in interface IAtomContainerpublic List<IAtom> getConnectedAtomsList(IAtom atom)
getConnectedAtomsList in interface IAtomContaineratom - The atom the bond partners are searched of.
public List<IBond> getConnectedBondsList(IAtom atom)
getConnectedBondsList in interface IAtomContaineratom - The atom the connected bonds are searched of
public List<ILonePair> getConnectedLonePairsList(IAtom atom)
getConnectedLonePairsList in interface IAtomContaineratom - The atom for which to get lone pairs
getElectronContainer(int),
electronContainers(),
getBond(int)public List<ISingleElectron> getConnectedSingleElectronsList(IAtom atom)
getConnectedSingleElectronsList in interface IAtomContaineratom - The atom on which the single electron is located
public List<IElectronContainer> getConnectedElectronContainersList(IAtom atom)
getConnectedElectronContainersList in interface IAtomContaineratom - The atom the connected electronContainers are searched of
public int getConnectedAtomsCount(IAtom atom)
getConnectedAtomsCount in interface IAtomContaineratom - The atom the number of bond partners are searched of.
public int getConnectedBondsCount(IAtom atom)
getConnectedBondsCount in interface IAtomContaineratom - The atom
public int getConnectedBondsCount(int atomNumber)
getConnectedBondsCount in interface IAtomContaineratomNumber - The atomnumber the degree is searched for
public int getConnectedLonePairsCount(IAtom atom)
getConnectedLonePairsCount in interface IAtomContaineratom - The atom
public int getConnectedSingleElectronsCount(IAtom atom)
getConnectedSingleElectronsCount in interface IAtomContaineratom - The atom on which the single electron is located
public double getBondOrderSum(IAtom atom)
AtomContainerManipulator#getBondOrderSum(IAtomContainer, IAtom)
getBondOrderSum in interface IAtomContaineratom - The atom
public IBond.Order getMaximumBondOrder(IAtom atom)
getMaximumBondOrder in interface IAtomContaineratom - The atom
public IBond.Order getMinimumBondOrder(IAtom atom)
getMinimumBondOrder in interface IAtomContaineratom - The atom
public void add(IAtomContainer atomContainer)
add in interface IAtomContaineratomContainer - The atomcontainer to be addedpublic void addAtom(IAtom atom)
addAtom in interface IAtomContaineratom - The atom to be added to this containerpublic void addBond(IBond bond)
addBond in interface IAtomContainerbond - The bond to added to this containerpublic void addLonePair(ILonePair lonePair)
addLonePair in interface IAtomContainerlonePair - The LonePair to added to this containerpublic void addSingleElectron(ISingleElectron singleElectron)
addSingleElectron in interface IAtomContainersingleElectron - The SingleElectron to added to this containerpublic void addElectronContainer(IElectronContainer electronContainer)
addElectronContainer in interface IAtomContainerelectronContainer - The ElectronContainer to added to this containerpublic void remove(IAtomContainer atomContainer)
remove in interface IAtomContaineratomContainer - The atomcontainer to be removedpublic void removeAtom(int position)
removeAtom in interface IAtomContainerposition - The position of the atom to be removed.public void removeAtom(IAtom atom)
removeAtom in interface IAtomContaineratom - The atom to be removedpublic IBond removeBond(int position)
removeBond in interface IAtomContainerposition - The position of the bond to be removed.
public IBond removeBond(IAtom atom1,
IAtom atom2)
removeBond in interface IAtomContaineratom1 - The first atomatom2 - The second atom
public void removeBond(IBond bond)
removeBond in interface IAtomContainerbond - The bond to be removed.public ILonePair removeLonePair(int position)
removeLonePair in interface IAtomContainerposition - The position of the LonePair to be removed.
public void removeLonePair(ILonePair lonePair)
removeLonePair in interface IAtomContainerlonePair - The LonePair to be removed.public ISingleElectron removeSingleElectron(int position)
removeSingleElectron in interface IAtomContainerposition - The position of the SingleElectron to be removed.
public void removeSingleElectron(ISingleElectron singleElectron)
removeSingleElectron in interface IAtomContainersingleElectron - The SingleElectron to be removed.public IElectronContainer removeElectronContainer(int number)
removeElectronContainer in interface IAtomContainernumber - The position of the bond in the electronContainers array
public void removeElectronContainer(IElectronContainer electronContainer)
removeElectronContainer in interface IAtomContainerelectronContainer - The electronContainer to be removedpublic void removeAtomAndConnectedElectronContainers(IAtom atom)
removeAtomAndConnectedElectronContainers in interface IAtomContaineratom - The atom to be removedpublic void removeAllElements()
removeAllElements in interface IAtomContainerpublic void removeAllElectronContainers()
removeAllElectronContainers in interface IAtomContainerpublic void removeAllBonds()
removeAllBonds in interface IAtomContainer
public void addBond(int atom1,
int atom2,
IBond.Order order,
IBond.Stereo stereo)
addBond in interface IAtomContaineratom1 - Id of the first atom of the Bond in [0,..]atom2 - Id of the second atom of the Bond in [0,..]order - Bondorderstereo - Stereochemical orientation
public void addBond(int atom1,
int atom2,
IBond.Order order)
addBond in interface IAtomContaineratom1 - Id of the first atom of the Bond in [0,..]atom2 - Id of the second atom of the Bond in [0,..]order - Bondorderpublic void addLonePair(int atomID)
addLonePair in interface IAtomContaineratomID - The atom number to which the LonePair is added in [0,..]public void addSingleElectron(int atomID)
addSingleElectron in interface IAtomContaineratomID - The atom number to which the LonePair is added in [0,..]public boolean contains(IAtom atom)
contains in interface IAtomContaineratom - the atom this AtomContainer is searched for
public boolean contains(IBond bond)
contains in interface IAtomContainerbond - the bond this AtomContainer is searched for
public boolean contains(ILonePair lonePair)
contains in interface IAtomContainerlonePair - the LonePair this AtomContainer is searched for
public boolean contains(ISingleElectron singleElectron)
contains in interface IAtomContainersingleElectron - the LonePair this AtomContainer is searched for
public boolean contains(IElectronContainer electronContainer)
contains in interface IAtomContainerelectronContainer - ElectronContainer that is searched for
public String toString()
toString in interface IChemObjecttoString in class Object
public Object clone()
throws CloneNotSupportedException
clone in interface IChemObjectclone in class ChemObjectCloneNotSupportedException - if the IChemObject cannot be clonedChemObject.shallowCopy()public void stateChanged(IChemObjectChangeEvent event)
stateChanged in interface IChemObjectListenerevent - A change event pointing to the source of the change
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||