Package org.openscience.cdk
Class Ring
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.AtomContainer
org.openscience.cdk.Ring
- All Implemented Interfaces:
Serializable,Cloneable,IAtomContainer,ICDKObject,IChemObject,IChemObjectListener,IRing
- Direct Known Subclasses:
DebugRing
Class representing a ring structure in a molecule.
A ring is a linear sequence of
N atoms interconnected to each other by covalent bonds,
such that atom i (1 < i < N) is bonded to
atom i-1 and atom i + 1 and atom 1 is bonded to atom N and atom 2.
- See Also:
- Keywords:
- ring
-
Field Summary
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED -
Constructor Summary
ConstructorsConstructorDescriptionRing()Constructs an empty ring.Ring(int ringSize) Constructs an empty ring that will have a certain size.Constructs a ring that will have a certain number of atoms of the given elements.Ring(IAtomContainer atomContainer) Constructs a ring from the atoms in an IAtomContainer object. -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones thisIChemObject.intReturns the sum of all bond orders in the ring.getNextBond(IBond bond, IAtom atom) Returns the next bond in order, relative to a given bond and atom.intReturns the number of atoms\edges in this ring.toString()Returns a one line description of this IChemObject.Methods inherited from class org.openscience.cdk.AtomContainer
add, addAtom, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, getTitle, indexOf, indexOf, indexOf, indexOf, isEmpty, lonePairs, newAtom, newAtom, newBond, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeAtomOnly, removeAtomOnly, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, setStereoElements, setTitle, shallowCopy, singleElectrons, stateChanged, stereoElementsMethods inherited from class org.openscience.cdk.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, setPropertyMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.IAtomContainer
add, addAtom, addBond, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, getTitle, indexOf, indexOf, indexOf, indexOf, isEmpty, lonePairs, newAtom, newAtom, newAtom, newAtom, newBond, newBond, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeAtomOnly, removeAtomOnly, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, setStereoElements, setTitle, singleElectrons, stereoElementsMethods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilderMethods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setPropertyMethods inherited from interface org.openscience.cdk.interfaces.IChemObjectListener
stateChanged
-
Constructor Details
-
Ring
public Ring()Constructs an empty ring. -
Ring
Constructs a ring from the atoms in an IAtomContainer object.- Parameters:
atomContainer- The IAtomContainer object containing the atoms to form the ring
-
Ring
Constructs a ring that will have a certain number of atoms of the given elements.- Parameters:
ringSize- The number of atoms and bonds the ring will haveelementSymbol- The element of the atoms the ring will have
-
Ring
public Ring(int ringSize) Constructs an empty ring that will have a certain size.- Parameters:
ringSize- The size (number of atoms) the ring will have
-
-
Method Details
-
getRingSize
public int getRingSize()Returns the number of atoms\edges in this ring.- Specified by:
getRingSizein interfaceIRing- Returns:
- The number of atoms\edges in this ring
-
getNextBond
Returns the next bond in order, relative to a given bond and atom. Example: Let the ring be composed of 0-1, 1-2, 2-3 and 3-0. A request getNextBond(1-2, 2) will return Bond 2-3.- Specified by:
getNextBondin interfaceIRing- Parameters:
bond- A bond for which an atom from a consecutive bond is soughtatom- A atom from the bond above to assign a search direction- Returns:
- The next bond in the order given by the above assignment
-
getBondOrderSum
public int getBondOrderSum()Returns the sum of all bond orders in the ring.- Specified by:
getBondOrderSumin interfaceIRing- Returns:
- the sum of all bond orders in the ring
-
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- Specified by:
clonein interfaceIRing- Overrides:
clonein classAtomContainer- Returns:
- The cloned object
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
toString
Description copied from class:AtomContainerReturns a one line description of this IChemObject.- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classAtomContainer- Returns:
- a String representation of this object
-