Package org.openscience.cdk.silent
Class Ring
- java.lang.Object
-
- org.openscience.cdk.silent.ChemObject
-
- org.openscience.cdk.silent.AtomContainer
-
- org.openscience.cdk.silent.Ring
-
- All Implemented Interfaces:
Serializable
,Cloneable
,IAtomContainer
,ICDKObject
,IChemObject
,IChemObjectListener
,IRing
public class Ring extends AtomContainer implements Serializable, IRing
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:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- silent
- 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, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
-
Constructor Summary
Constructors Constructor Description Ring()
Constructs an empty ring.Ring(int ringSize)
Constructs an empty ring that will have a certain size.Ring(int ringSize, String elementSymbol)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IRing
clone()
Clones thisIChemObject
.int
getBondOrderSum()
Returns the sum of all bond orders in the ring.IBond
getNextBond(IBond bond, IAtom atom)
Returns the next bond in order, relative to a given bond and atom.int
getRingSize()
Returns the number of atoms\edges in this ring.String
toString()
Returns a one line description of this IChemObject.-
Methods inherited from class org.openscience.cdk.silent.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, stereoElements
-
Methods inherited from class org.openscience.cdk.silent.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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.IAtomContainer
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, 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, stereoElements
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods 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, setProperty
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObjectListener
stateChanged
-
-
-
-
Constructor Detail
-
Ring
public Ring()
Constructs an empty ring.
-
Ring
public Ring(IAtomContainer atomContainer)
Constructs a ring from the atoms in an IAtomContainer object.- Parameters:
atomContainer
- The IAtomContainer object containing the atoms to form the ring
-
Ring
public Ring(int ringSize, String elementSymbol)
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 Detail
-
getRingSize
public int getRingSize()
Returns the number of atoms\edges in this ring.- Specified by:
getRingSize
in interfaceIRing
- Returns:
- The number of atoms\edges in this ring
-
getNextBond
public IBond getNextBond(IBond bond, IAtom atom)
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:
getNextBond
in 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:
getBondOrderSum
in interfaceIRing
- Returns:
- the sum of all bond orders in the ring
-
clone
public IRing clone() throws CloneNotSupportedException
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:
clone
in interfaceIAtomContainer
- Specified by:
clone
in interfaceIChemObject
- Specified by:
clone
in interfaceIRing
- Overrides:
clone
in classAtomContainer
- Returns:
- The cloned object
- Throws:
CloneNotSupportedException
- if the IChemObject cannot be cloned
-
toString
public String toString()
Description copied from class:AtomContainer
Returns a one line description of this IChemObject.- Specified by:
toString
in interfaceIChemObject
- Overrides:
toString
in classAtomContainer
- Returns:
- a String representation of this object
-
-