Class AtomContainerLegacy
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.AtomContainerLegacy
- All Implemented Interfaces:
Serializable, Cloneable, IAtomContainer, ICDKObject, IChemObject, IChemObjectListener
public class AtomContainerLegacy
extends ChemObject
implements IAtomContainer, IChemObjectListener, Serializable, Cloneable
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();
}
- Author:
- steinbeck
- See Also:
- Created on:
- 2000-10-02
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intNumber of atoms contained by this object.protected IAtom[]Internal array of atoms.protected intNumber of bonds contained by this object.protected IBond[]Internal array of bonds.protected final intAmount by which the bond and atom arrays grow when elements are added and the arrays are not large enough for that.protected intNumber of lone pairs contained by this object.protected ILonePair[]Internal array of lone pairs.protected intNumber of single electrons contained by this object.protected ISingleElectron[]Internal array of single electrons.protected List<IStereoElement> Internal list of atom parities.Fields inherited from interface IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HIDDEN, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITEDModifier and TypeFieldDescriptionstatic final intFlag that is set if a ChemObject is part of an aliphatic chain.static final intFlag is set if ChemObject is part of an aromatic system.static final intFlag is set if ChemObject is part of a conjugated system.static final intThis flag can be used when depicted structures to hide certain parts, for example the things are abbreviated (display shortcuts).static final intSets to true if the atom is a hydrogen bond acceptor.static final intSets to true if the atom is a hydrogen bond donor.static final intFlag that is set when the ChemObject is part of a ring.static final intFlag is set if a ChemObject is mapped to another ChemObject.static final intFlag to indicate a flattened molecule holds a Markush structure, you can work on it as is or it might make more sense to repack into something sensible like a RGroupQuery.static final intFlag that is set when the ChemObject is part of a ring.static final intFlag that is set if the ChemObject is placed when calculating 2D/3D layouts.static final intFlag is set if a ChemObject has reactive center.static final intFlag used for marking uncertainty of the bond order.static final intFlag is set if an atom could be typed.static final intFlag is set if ChemObject has been visited. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an empty AtomContainer.protectedAtomContainerLegacy(int atomCount, int bondCount, int lpCount, int seCount) Constructs an empty AtomContainer that will contain a certain number of atoms and electronContainers.protectedAtomContainerLegacy(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). -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(IAtomContainer that) Adds all atoms and electronContainers of a given atomcontainer to this container.voidAdds an atom to this container.voidaddBond(int atom1, int atom2, IBond.Order order) Adds a bond to this container.voidaddBond(int atom1, int atom2, IBond.Order order, IBond.Display display) Adds a bond to this container.voidaddBond(int atom1, int atom2, IBond.Order order, IBond.Stereo stereo) Adds a bond to this container.voidAdds a Bond to this AtomContainer.voidaddElectronContainer(IElectronContainer electronContainer) Adds a ElectronContainer to this AtomContainer.voidaddLonePair(int atomID) Adds a LonePair to this Atom.voidaddLonePair(ILonePair lonePair) Adds a lone pair to this AtomContainer.voidaddSingleElectron(int atomID) Adds a SingleElectron to this Atom.voidaddSingleElectron(ISingleElectron singleElectron) Adds a single electron to this AtomContainer.voidaddStereoElement(IStereoElement element) Adds a stereo element to this container.atoms()Returns an Iterable for looping over all atoms in this container.bonds()Returns an Iterable for looping over all bonds in this container.clone()Clones thisIChemObject.booleanTrue, if the AtomContainer contains the given atom object.booleanTrue, if the AtomContainer contains the given bond object.booleancontains(IElectronContainer electronContainer) True, if the AtomContainer contains the given ElectronContainer object.booleanTrue, if the AtomContainer contains the given LonePair object.booleancontains(ISingleElectron singleElectron) True, if the AtomContainer contains the given SingleElectron object.Returns an Iterable for looping over all electron containers in this container.getAtom(int idx) Get the atom at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getAtomCount().intReturns the number of Atoms in this Container.intgetAtomNumber(IAtom atom) Returns the position of a given atom in the atoms array.getBond(int idx) Get the bond at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getBondCount().Returns the bond that connects the two given atoms.intReturns the number of Bonds in this Container.intgetBondNumber(IAtom atom1, IAtom atom2) Returns the position of the bond between two given atoms in the electronContainers array.intgetBondNumber(IBond bond) Returns the position of a given bond in the electronContainers array.doublegetBondOrderSum(IAtom atom) Returns the sum of the bond orders for a given Atom.intgetConnectedAtomsCount(IAtom atom) Returns the number of connected atoms (explicit degree) to the specified atom.getConnectedAtomsList(IAtom atom) Returns the atoms connected connected to the specified atom by a bond.intgetConnectedBondsCount(int idx) Returns the number of connected bonds (explicit degree) to atom at the specified index.intgetConnectedBondsCount(IAtom atom) Returns the number of connected bonds (explicit degree) to the specified atom.getConnectedBondsList(IAtom atom) Returns the bonds connected connected to the specified atom.Returns the electron containers (bonds, radicals, and lone pairs ) connected connected to the specified atom.intReturns the number of lone pairs connected to the specified atom.Returns the lone pairs connected connected to the specified atom.intReturns the number of single electrons connected to the specified atom.Returns the single electrons connected connected to the specified atom.getElectronContainer(int number) Returns the ElectronContainer at positionnumberin the container.intReturns the number of ElectronContainers in this Container.Returns the atom at position 0 in the container.Returns the atom at the last position in the container.getLonePair(int idx) Get the lone pair at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getLonePairCount().intReturns the number of LonePairs in this Container.intgetLonePairNumber(ILonePair lonePair) Returns the position of a given lone pair in the lone pair array.getMaximumBondOrder(IAtom atom) Returns the maximum bond order that this atom currently has in the context of this AtomContainer.getMinimumBondOrder(IAtom atom) Returns the minimum bond order that this atom currently has in the context of this AtomContainer.getSingleElectron(int idx) Get the single electron at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getSingleElectronCount().intReturns the number of the single electrons in this container.intgetSingleElectronNumber(ISingleElectron singleElectron) Returns the position of a given single electron in the single electron array.getTitle()Access the title of the record.intAccess the storage index of an atom.intAccess the storage index of a bond.intAccess the storage index of a long pair.intindexOf(ISingleElectron electron) Access the storage index of a single electron (radical).booleanisEmpty()Indicates whether this container is empty.Returns an Iterable for looping over all lone pairs in this container.voidremove(IAtomContainer atomContainer) Removes all atoms and electronContainers of a given atomcontainer from this container.voidRemoves all Bonds from this container.voidRemoves electronContainers from this container.voidRemoves all atoms, bonds and stereo elements from this container.voidremoveAtom(int pos) Safely remove an atom from the container.voidremoveAtom(IAtom atom) Safely remove an atom from the container.voidDeprecated.voidremoveAtomOnly(int position) Unsafely remove atom at index.voidremoveAtomOnly(IAtom atom) Unsafely remove atom.removeBond(int position) Removes the bond at the given position from the AtomContainer.removeBond(IAtom atom1, IAtom atom2) Removes the bond that connects the two given atoms.voidremoveBond(IBond bond) Removes the bond from this container.removeElectronContainer(int number) Removes the bond at the given position from this container.voidremoveElectronContainer(IElectronContainer electronContainer) Removes this ElectronContainer from this container.removeLonePair(int position) Removes the lone pair at the given position from the AtomContainer.voidremoveLonePair(ILonePair lonePair) Removes the lone pair from the AtomContainer.removeSingleElectron(int position) Removes the single electron at the given position from the AtomContainer.voidremoveSingleElectron(ISingleElectron singleElectron) Removes the single electron from the AtomContainer.voidSet the atom atidx, the index must have an existing atom and therefore be in the range 0 ≤ idx < mol.getAtomCount().voidSets the array of atoms of this AtomContainer.voidSets the array of bonds of this AtomContainer.voidsetStereoElements(List<IStereoElement> elements) Set the stereo elements - this will replace the existing instance with a new instance.voidModify the title of the record.Returns an Iterable for looping over all single electrons in this container.voidCalled by objects to notify objects that implemented this interface and registered with them as ChemObjectListeners.Returns the stereo elements defined for this atom container.toString()Returns a one line description of this IChemObject.Methods inherited from class ChemObject
addListener, addProperties, clear, compare, flags, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopyModifier and TypeMethodDescriptionvoidUse this to add yourself to this IChemObject as a listener.voidaddProperties(Map<Object, Object> properties) Sets the properties of this object.voidclear(int flags) Clear the provided flags.booleanCompares a IChemObject with this IChemObject.intflags()Access the current value of the flags for this ChemObject.Returns aIChemObjectBuilderfor the data classes that extend this class.booleangetFlag(int mask) Returns the value of a given flag.boolean[]getFlags()Returns the whole set of flags.Access the internal value used to store the flags.getID()Returns the identifier (ID) of this object.intReturns the number of ChemObjectListeners registered with this object.booleanReturns the flag that indicates whether notification messages are sent around.Returns a Map with the IChemObject's properties.<T> TgetProperty(Object description) Returns a property for the IChemObject.<T> TgetProperty(Object description, Class<T> c) Access a property of the given description and cast the specified class.booleanis(int flags) Test if a flag(s) are set on this ChemObject.voidThis should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidThis should be triggered by an method that changes the content of an object to that the registered listeners can react to it.voidUse this to remove a ChemObjectListener from the ListenerList of this IChemObject.voidremoveProperty(Object description) Removes a property for a IChemObject.voidset(int flags) Set the provided flags.voidsetFlag(int mask, boolean value) Sets the value of some flag.voidsetFlags(boolean[] flagsNew) Sets the whole set of flags.voidSets the identifier (ID) of this object.voidsetNotification(boolean bool) Set a flag to use or not use notification.voidsetProperties(Map<Object, Object> properties) Set the properties of this object to the provided map (shallow copy).voidsetProperty(Object description, Object property) Sets a property for a IChemObject.Clones thisIChemObject, but preserves references toObjects.Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IAtomContainer
newAtom, newAtom, newAtom, newAtom, newBond, newBondModifier and TypeMethodDescriptiondefault IAtomnewAtom()Create a new carbon atom in this container, it will have the implicit hydrogen count initialized to 0.default IAtomnewAtom(int element) Create a new atom in this container of the specified element, it will have the implicit hydrogen count initialized to 0.default IAtomnewAtom(int element, int numImplH) Create a new atom in this container of the specified element and implicit hydrogen count.default IAtomCreate a new atom in the container based on properties of the provided atom.default IBondCreate a new single bond between two atoms.default IBondnewBond(IAtom beg, IAtom end, IBond.Order order) Create a new bond between two atoms.
-
Field Details
-
atomCount
protected int atomCountNumber of atoms contained by this object. -
bondCount
protected int bondCountNumber of bonds contained by this object. -
lonePairCount
protected int lonePairCountNumber of lone pairs contained by this object. -
singleElectronCount
protected int singleElectronCountNumber of single electrons contained by this object. -
growArraySize
protected final int growArraySizeAmount by which the bond and atom arrays grow when elements are added and the arrays are not large enough for that.- See Also:
-
atoms
Internal array of atoms. -
bonds
Internal array of bonds. -
lonePairs
Internal array of lone pairs. -
singleElectrons
Internal array of single electrons. -
stereoElements
Internal list of atom parities.
-
-
Constructor Details
-
AtomContainerLegacy
protected AtomContainerLegacy()Constructs an empty AtomContainer. -
AtomContainerLegacy
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).- Parameters:
container- An AtomContainer to copy the atoms and electronContainers from
-
AtomContainerLegacy
protected AtomContainerLegacy(int atomCount, int bondCount, int lpCount, int seCount) Constructs an empty AtomContainer that will contain a certain number of atoms and electronContainers. It will set the starting array lengths to the defined values, but will not create any Atom or ElectronContainer's.- Parameters:
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 Details
-
addStereoElement
Adds a stereo element to this container.- Specified by:
addStereoElementin interfaceIAtomContainer- Parameters:
element- The newIStereoElementfor this container- See Also:
-
setStereoElements
Set the stereo elements - this will replace the existing instance with a new instance.- Specified by:
setStereoElementsin interfaceIAtomContainer- Parameters:
elements- the new stereo elements
-
stereoElements
Returns the stereo elements defined for this atom container.- Specified by:
stereoElementsin interfaceIAtomContainer- Returns:
- An
IterableofIStereoElements. - See Also:
-
setAtoms
Sets the array of atoms of this AtomContainer.- Specified by:
setAtomsin interfaceIAtomContainer- Parameters:
newAtoms- The array of atoms to be assigned to this AtomContainer- See Also:
-
setBonds
Sets the array of bonds of this AtomContainer.- Specified by:
setBondsin interfaceIAtomContainer- Parameters:
newBonds- The array of bonds to be assigned to this AtomContainer- See Also:
-
setAtom
Set the atom atidx, the index must have an existing atom and therefore be in the range 0 ≤ idx < mol.getAtomCount().- Specified by:
setAtomin interfaceIAtomContainer- Parameters:
idx- The index of the atom to be set.atom- The atom to be stored at positionidx- See Also:
-
getAtom
Get the atom at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getAtomCount().- Specified by:
getAtomin interfaceIAtomContainer- Parameters:
idx- atom index- Returns:
- the atom stored at the index
- See Also:
-
getBond
Get the bond at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getBondCount().- Specified by:
getBondin interfaceIAtomContainer- Parameters:
idx- bond index- Returns:
- the bond stored at the index
-
getLonePair
Get the lone pair at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getLonePairCount().- Specified by:
getLonePairin interfaceIAtomContainer- Parameters:
idx- lone pair index- Returns:
- the lone pair stored at the index
-
getSingleElectron
Get the single electron at the specified idx, the index should be in the range 0 ≤ idx <IAtomContainer.getSingleElectronCount().- Specified by:
getSingleElectronin interfaceIAtomContainer- Parameters:
idx- single electron index- Returns:
- the single electron stored at the index
-
atoms
Returns an Iterable for looping over all atoms in this container.- Specified by:
atomsin interfaceIAtomContainer- Returns:
- An Iterable with the atoms in this container
-
bonds
Returns an Iterable for looping over all bonds in this container.- Specified by:
bondsin interfaceIAtomContainer- Returns:
- An Iterable with the bonds in this container
-
lonePairs
Returns an Iterable for looping over all lone pairs in this container.- Specified by:
lonePairsin interfaceIAtomContainer- Returns:
- An Iterable with the lone pairs in this container
-
singleElectrons
Returns an Iterable for looping over all single electrons in this container.- Specified by:
singleElectronsin interfaceIAtomContainer- Returns:
- An Iterable with the single electrons in this container
-
electronContainers
Returns an Iterable for looping over all electron containers in this container.- Specified by:
electronContainersin interfaceIAtomContainer- Returns:
- An Iterable with the electron containers in this container
-
getFirstAtom
Returns the atom at position 0 in the container.- Specified by:
getFirstAtomin interfaceIAtomContainer- Returns:
- The atom at position 0 .
-
getLastAtom
Returns the atom at the last position in the container.- Specified by:
getLastAtomin interfaceIAtomContainer- Returns:
- The atom at the last position
-
getAtomNumber
Returns the position of a given atom in the atoms array. It returns -1 if the atom atom does not exist.- Specified by:
getAtomNumberin interfaceIAtomContainer- Parameters:
atom- The atom to be sought- Returns:
- The Position of the atom in the atoms array in [0,..].
-
getBondNumber
Returns the position of the bond between two given atoms in the electronContainers array. It returns -1 if the bond does not exist.- Specified by:
getBondNumberin interfaceIAtomContainer- Parameters:
atom1- The first atomatom2- The second atom- Returns:
- The Position of the bond between a1 and a2 in the electronContainers array.
-
getBondNumber
Returns the position of a given bond in the electronContainers array. It returns -1 if the bond does not exist.- Specified by:
getBondNumberin interfaceIAtomContainer- Parameters:
bond- The bond to be sought- Returns:
- The Position of the bond in the electronContainers array in [0,..].
-
getLonePairNumber
Returns the position of a given lone pair in the lone pair array. It returns -1 if the lone pair does not exist.- Specified by:
getLonePairNumberin interfaceIAtomContainer- Parameters:
lonePair- The lone pair to be sought- Returns:
- The Position of the lone pair in the array..
-
getSingleElectronNumber
Returns the position of a given single electron in the single electron array. It returns -1 if the single electron does not exist.- Specified by:
getSingleElectronNumberin interfaceIAtomContainer- Parameters:
singleElectron- The single electron to be sought- Returns:
- The Position of the single electron in the array.
-
indexOf
Access the storage index of an atom.- Specified by:
indexOfin interfaceIAtomContainer- Parameters:
atom- atom instance to find- Returns:
- the index, -1 if not found
-
indexOf
Access the storage index of a bond.- Specified by:
indexOfin interfaceIAtomContainer- Parameters:
bond- bond instance to find- Returns:
- the index, -1 if not found
-
indexOf
Access the storage index of a single electron (radical).- Specified by:
indexOfin interfaceIAtomContainer- Parameters:
electron- the electron- Returns:
- the index, -1 if not found
-
indexOf
Access the storage index of a long pair.- Specified by:
indexOfin interfaceIAtomContainer- Parameters:
pair- the long pair- Returns:
- the index, -1 if not found
-
getElectronContainer
Returns the ElectronContainer at positionnumberin the container.- Specified by:
getElectronContainerin interfaceIAtomContainer- Parameters:
number- The position of the ElectronContainer to be returned.- Returns:
- The ElectronContainer at position
number. - See Also:
-
getBond
Returns the bond that connects the two given atoms.- Specified by:
getBondin interfaceIAtomContainer- Parameters:
atom1- The first atomatom2- The second atom- Returns:
- The bond that connects the two atoms
-
getAtomCount
public int getAtomCount()Returns the number of Atoms in this Container.- Specified by:
getAtomCountin interfaceIAtomContainer- Returns:
- The number of Atoms in this Container
-
getBondCount
public int getBondCount()Returns the number of Bonds in this Container.- Specified by:
getBondCountin interfaceIAtomContainer- Returns:
- The number of Bonds in this Container
-
getLonePairCount
public int getLonePairCount()Returns the number of LonePairs in this Container.- Specified by:
getLonePairCountin interfaceIAtomContainer- Returns:
- The number of LonePairs in this Container
-
getSingleElectronCount
public int getSingleElectronCount()Returns the number of the single electrons in this container.- Specified by:
getSingleElectronCountin interfaceIAtomContainer- Returns:
- The number of SingleElectron objects of this AtomContainer
-
getElectronContainerCount
public int getElectronContainerCount()Returns the number of ElectronContainers in this Container.- Specified by:
getElectronContainerCountin interfaceIAtomContainer- Returns:
- The number of ElectronContainers in this Container
-
getConnectedAtomsList
Returns the atoms connected connected to the specified atom by a bond.- Specified by:
getConnectedAtomsListin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- connected atoms
-
getConnectedBondsList
Returns the bonds connected connected to the specified atom.- Specified by:
getConnectedBondsListin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- connected bonds
-
getConnectedLonePairsList
Returns the lone pairs connected connected to the specified atom.- Specified by:
getConnectedLonePairsListin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- connected lone pairs
-
getConnectedSingleElectronsList
Returns the single electrons connected connected to the specified atom.- Specified by:
getConnectedSingleElectronsListin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- connected lone pairs
-
getConnectedElectronContainersList
Returns the electron containers (bonds, radicals, and lone pairs ) connected connected to the specified atom.- Specified by:
getConnectedElectronContainersListin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- connected lone pairs
-
getConnectedBondsCount
Returns the number of connected bonds (explicit degree) to the specified atom. This does not include bonds to implicit hydrogens.- Specified by:
getConnectedBondsCountin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- number of connected bonds
-
getConnectedAtomsCount
Returns the number of connected atoms (explicit degree) to the specified atom. This does not include bonds to implicit hydrogens.- Specified by:
getConnectedAtomsCountin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- number of connected bonds
-
getConnectedBondsCount
public int getConnectedBondsCount(int idx) Returns the number of connected bonds (explicit degree) to atom at the specified index. This does not include bonds to implicit hydrogens.- Specified by:
getConnectedBondsCountin interfaceIAtomContainer- Parameters:
idx- the atom idx- Returns:
- number of connected bonds
-
getConnectedLonePairsCount
Returns the number of lone pairs connected to the specified atom.- Specified by:
getConnectedLonePairsCountin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- number of connected bonds
-
getConnectedSingleElectronsCount
Returns the number of single electrons connected to the specified atom.- Specified by:
getConnectedSingleElectronsCountin interfaceIAtomContainer- Parameters:
atom- the atom- Returns:
- number of connected bonds
-
getBondOrderSum
Returns the sum of the bond orders for a given Atom.- Specified by:
getBondOrderSumin interfaceIAtomContainer- Parameters:
atom- The atom- Returns:
- The number of bondorders for this atom
-
getMaximumBondOrder
Returns the maximum bond order that this atom currently has in the context of this AtomContainer. If the atom has no bonds but does have implicit hydrogens the minimum bond order isIBond.Order.SINGLE, otherwise the bond is unsetIBond.Order.UNSET.- Specified by:
getMaximumBondOrderin interfaceIAtomContainer- Parameters:
atom- The atom- Returns:
- The maximum bond order that this atom currently has
-
getMinimumBondOrder
Returns the minimum bond order that this atom currently has in the context of this AtomContainer. If the atom has no bonds but does have implicit hydrogens the minimum bond order isIBond.Order.SINGLE, otherwise the bond is unsetIBond.Order.UNSET.- Specified by:
getMinimumBondOrderin interfaceIAtomContainer- Parameters:
atom- The atom- Returns:
- The minimum bond order that this atom currently has
-
add
Adds all atoms and electronContainers of a given atomcontainer to this container.- Specified by:
addin interfaceIAtomContainer- Parameters:
that- The atomcontainer to be added
-
addAtom
Adds an atom to this container.- Specified by:
addAtomin interfaceIAtomContainer- Parameters:
atom- The atom to be added to this container
-
addBond
Adds a Bond to this AtomContainer.- Specified by:
addBondin interfaceIAtomContainer- Parameters:
bond- The bond to added to this container
-
addLonePair
Adds a lone pair to this AtomContainer.- Specified by:
addLonePairin interfaceIAtomContainer- Parameters:
lonePair- The LonePair to added to this container
-
addSingleElectron
Adds a single electron to this AtomContainer.- Specified by:
addSingleElectronin interfaceIAtomContainer- Parameters:
singleElectron- The SingleElectron to added to this container
-
addElectronContainer
Adds a ElectronContainer to this AtomContainer.- Specified by:
addElectronContainerin interfaceIAtomContainer- Parameters:
electronContainer- The ElectronContainer to added to this container
-
remove
Removes all atoms and electronContainers of a given atomcontainer from this container.- Specified by:
removein interfaceIAtomContainer- Parameters:
atomContainer- The atomcontainer to be removed
-
removeAtomOnly
public void removeAtomOnly(int position) Unsafely remove atom at index.
Removes the atom at the given position from the AtomContainer. Note that the electronContainers are unaffected: you also have to take care of removing all electronContainers to this atom from the container manually.- Specified by:
removeAtomOnlyin interfaceIAtomContainer- Parameters:
position- The position of the atom to be removed.
-
removeAtomOnly
Unsafely remove atom.
Removes the given atom from the AtomContainer. Note that the electronContainers are unaffected: you also have to take care of removeing all electronContainers to this atom from the container.- Specified by:
removeAtomOnlyin interfaceIAtomContainer- Parameters:
atom- The atom to be removed
-
removeBond
Removes the bond at the given position from the AtomContainer.- Specified by:
removeBondin interfaceIAtomContainer- Parameters:
position- The position of the bond to be removed.- Returns:
- the bond at the given position
-
removeBond
Removes the bond that connects the two given atoms.- Specified by:
removeBondin interfaceIAtomContainer- Parameters:
atom1- The first atomatom2- The second atom- Returns:
- The bond that connects the two atoms
-
removeBond
Removes the bond from this container.- Specified by:
removeBondin interfaceIAtomContainer- Parameters:
bond- The bond to be removed.
-
removeLonePair
Removes the lone pair at the given position from the AtomContainer.- Specified by:
removeLonePairin interfaceIAtomContainer- Parameters:
position- The position of the LonePair to be removed.- Returns:
- The removed ILonePair.
-
removeLonePair
Removes the lone pair from the AtomContainer.- Specified by:
removeLonePairin interfaceIAtomContainer- Parameters:
lonePair- The LonePair to be removed.
-
removeSingleElectron
Removes the single electron at the given position from the AtomContainer.- Specified by:
removeSingleElectronin interfaceIAtomContainer- Parameters:
position- The position of the SingleElectron to be removed.- Returns:
- The removed ISingleElectron
-
removeSingleElectron
Removes the single electron from the AtomContainer.- Specified by:
removeSingleElectronin interfaceIAtomContainer- Parameters:
singleElectron- The SingleElectron to be removed.
-
removeElectronContainer
Removes the bond at the given position from this container.- Specified by:
removeElectronContainerin interfaceIAtomContainer- Parameters:
number- The position of the bond in the electronContainers array- Returns:
- the IElectronContainer that was removed
-
removeElectronContainer
Removes this ElectronContainer from this container.- Specified by:
removeElectronContainerin interfaceIAtomContainer- Parameters:
electronContainer- The electronContainer to be removed
-
removeAtomAndConnectedElectronContainers
Deprecated.Safely remove an atom from the container.- Specified by:
removeAtomAndConnectedElectronContainersin interfaceIAtomContainer- See Also:
-
removeAtom
Safely remove an atom from the container.
Removes a single atom from the container updating all internal state to be consistent. All bonds connected to the atom will be deleted as well as all stereo elements. If multiple atoms/bonds are being deleted they should be gathered into a single transaction and removed withIAtomContainer.remove(IAtomContainer).
If you are removing hydrogens one of the utility methods (e.g. AtomContainerManipulator.removeHydrogens(IAtomContainer)) is preferable.- Specified by:
removeAtomin interfaceIAtomContainer- Parameters:
atom- the atom to be removed
-
removeAtom
public void removeAtom(int pos) Safely remove an atom from the container.
Removes a single atom from the container updating all internal state to be consistent. All bonds connected to the atom will be deleted as well as all stereo elements. If multiple atoms/bonds are being deleted they should be gathered into a single transaction and removed withIAtomContainer.remove(IAtomContainer).
If you are removing hydrogens one of the utility methods (e.g. AtomContainerManipulator.removeHydrogens(IAtomContainer)) is preferable.- Specified by:
removeAtomin interfaceIAtomContainer- Parameters:
pos- the position of the atom to be removed
-
removeAllElements
public void removeAllElements()Removes all atoms, bonds and stereo elements from this container.- Specified by:
removeAllElementsin interfaceIAtomContainer
-
removeAllElectronContainers
public void removeAllElectronContainers()Removes electronContainers from this container.- Specified by:
removeAllElectronContainersin interfaceIAtomContainer
-
removeAllBonds
public void removeAllBonds()Removes all Bonds from this container.- Specified by:
removeAllBondsin interfaceIAtomContainer
-
addBond
Adds a bond to this container.- Specified by:
addBondin interfaceIAtomContainer- Parameters:
atom1- 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
-
addBond
Description copied from interface:IAtomContainerAdds a bond to this container.- Specified by:
addBondin interfaceIAtomContainer- Parameters:
atom1- idx of the first atom of the Bond in [0,..]atom2- idx of the second atom of the Bond in [0,..]order- the bond orderdisplay- the display type of the bond
-
addBond
Adds a bond to this container.- Specified by:
addBondin interfaceIAtomContainer- Parameters:
atom1- Id of the first atom of the Bond in [0,..]atom2- Id of the second atom of the Bond in [0,..]order- Bondorder
-
addLonePair
public void addLonePair(int atomID) Adds a LonePair to this Atom.- Specified by:
addLonePairin interfaceIAtomContainer- Parameters:
atomID- The atom number to which the LonePair is added in [0,..]
-
addSingleElectron
public void addSingleElectron(int atomID) Adds a SingleElectron to this Atom.- Specified by:
addSingleElectronin interfaceIAtomContainer- Parameters:
atomID- The atom number to which the SingleElectron is added in [0,..]
-
contains
True, if the AtomContainer contains the given atom object.- Specified by:
containsin interfaceIAtomContainer- Parameters:
atom- the atom this AtomContainer is searched for- Returns:
- True, if the AtomContainer contains the given atom object
-
contains
True, if the AtomContainer contains the given bond object.- Specified by:
containsin interfaceIAtomContainer- Parameters:
bond- the bond this AtomContainer is searched for- Returns:
- True, if the AtomContainer contains the given bond object
-
contains
True, if the AtomContainer contains the given LonePair object.- Specified by:
containsin interfaceIAtomContainer- Parameters:
lonePair- the LonePair this AtomContainer is searched for- Returns:
- True, if the AtomContainer contains the given LonePair object
-
contains
True, if the AtomContainer contains the given SingleElectron object.- Specified by:
containsin interfaceIAtomContainer- Parameters:
singleElectron- the SingleElectron this AtomContainer is searched for- Returns:
- True, if the AtomContainer contains the given SingleElectron object
-
contains
True, if the AtomContainer contains the given ElectronContainer object.- Specified by:
containsin interfaceIAtomContainer- Parameters:
electronContainer- ElectronContainer that is searched for- Returns:
- True, if the AtomContainer contains the given bond object
-
toString
Returns a one line description of this IChemObject.- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classObject- Returns:
- a String representation of this object
-
clone
Clones thisIChemObject. It clones the identifier, flags, properties and pointer vectors. The ChemObjectListeners are not cloned, and neither is the content of the pointer vectors.- Specified by:
clonein interfaceIAtomContainer- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classChemObject- Returns:
- The cloned object
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
stateChanged
Called by objects to notify objects that implemented this interface and registered with them as ChemObjectListeners.- Specified by:
stateChangedin interfaceIChemObjectListener- Parameters:
event- a ChemObjectChangeEvent object
-
isEmpty
public boolean isEmpty()Indicates whether this container is empty. The container is considered empty if there are no atoms. Bonds are not checked as a graph with no vertexes can not have edges.- Specified by:
isEmptyin interfaceIAtomContainer- Returns:
- whether the container is empty
-
getTitle
Access the title of the record.- Specified by:
getTitlein interfaceIAtomContainer- Returns:
- the title
-
setTitle
Modify the title of the record.- Specified by:
setTitlein interfaceIAtomContainer- Parameters:
title- the title
-