org.openscience.cdk
Class RingSet

java.lang.Object
  extended by org.openscience.cdk.ChemObject
      extended by org.openscience.cdk.AtomContainerSet
          extended by org.openscience.cdk.RingSet
All Implemented Interfaces:
Serializable, Cloneable, IAtomContainerSet, ICDKObject, IChemObject, IChemObjectListener, IRingSet
Direct Known Subclasses:
DebugRingSet, NNRingSet

public class RingSet
extends AtomContainerSet
implements Serializable, IRingSet, Cloneable

Maintains a set of Ring objects.

See Also:
Serialized Form
Keywords:
ring, set of
Belongs to CDK module:
data
Source code:
HEAD

Field Summary
static int LARGE_FIRST
          Flag to denote that the set is order with the largest ring first?
static int SMALL_FIRST
          Flag to denote that the set is order with the smallest ring first?
 
Constructor Summary
RingSet()
          The constructor.
 
Method Summary
 void add(IRingSet ringSet)
          Adds all rings of another RingSet if they are not already part of this ring set.
 Object clone()
          Clones this RingSet including the Rings.
 boolean contains(IAtom atom)
          True, if at least one of the rings in the ringset contains the given atom.
 boolean contains(IAtomContainer ring)
          Checks for presence of a ring in this RingSet.
 IRingSet getConnectedRings(IRing ring)
          Returns all the rings in the RingSet that share one or more atoms with a given ring.
 IRingSet getRings(IAtom atom)
          Returns a vector of all rings that this atom is part of.
 IRingSet getRings(IBond bond)
          Returns a vector of all rings that this bond is part of.
 String toString()
          Returns the String representation of this RingSet.
 
Methods inherited from class org.openscience.cdk.AtomContainerSet
add, addAtomContainer, addAtomContainer, atomContainers, getAtomContainer, getAtomContainerCount, getMultiplier, getMultiplier, getMultipliers, removeAllAtomContainers, removeAtomContainer, removeAtomContainer, replaceAtomContainer, setMultiplier, setMultiplier, setMultipliers, sortAtomContainers, stateChanged
 
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.IAtomContainerSet
add, addAtomContainer, addAtomContainer, atomContainers, getAtomContainer, getAtomContainerCount, getMultiplier, getMultiplier, getMultipliers, removeAllAtomContainers, removeAtomContainer, removeAtomContainer, replaceAtomContainer, setMultiplier, setMultiplier, setMultipliers, sortAtomContainers
 
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
 

Field Detail

LARGE_FIRST

public static final int LARGE_FIRST
Flag to denote that the set is order with the largest ring first?

See Also:
Constant Field Values

SMALL_FIRST

public static final int SMALL_FIRST
Flag to denote that the set is order with the smallest ring first?

See Also:
Constant Field Values
Constructor Detail

RingSet

public RingSet()
The constructor.

Method Detail

getRings

public IRingSet getRings(IBond bond)
Returns a vector of all rings that this bond is part of.

Specified by:
getRings in interface IRingSet
Parameters:
bond - The bond to be checked
Returns:
A vector of all rings that this bond is part of

getRings

public IRingSet getRings(IAtom atom)
Returns a vector of all rings that this atom is part of.

Specified by:
getRings in interface IRingSet
Parameters:
atom - The atom to be checked
Returns:
A vector of all rings that this bond is part of

getConnectedRings

public IRingSet getConnectedRings(IRing ring)
Returns all the rings in the RingSet that share one or more atoms with a given ring.

Specified by:
getConnectedRings in interface IRingSet
Parameters:
ring - A ring with which all return rings must share one or more atoms
Returns:
All the rings that share one or more atoms with a given ring.

add

public void add(IRingSet ringSet)
Adds all rings of another RingSet if they are not already part of this ring set. If you want to add a single ring to the set use AtomContainerSet.addAtomContainer(org.openscience.cdk.interfaces.IAtomContainer)

Specified by:
add in interface IRingSet
Parameters:
ringSet - the ring set to be united with this one.

contains

public boolean contains(IAtom atom)
True, if at least one of the rings in the ringset contains the given atom.

Specified by:
contains in interface IRingSet
Parameters:
atom - Atom to check
Returns:
true, if the ringset contains the atom

contains

public boolean contains(IAtomContainer ring)
Checks for presence of a ring in this RingSet.

Specified by:
contains in interface IRingSet
Parameters:
ring - The ring to check
Returns:
true if ring is part of RingSet

clone

public Object clone()
             throws CloneNotSupportedException
Clones this RingSet including the Rings.

Specified by:
clone in interface IChemObject
Overrides:
clone in class AtomContainerSet
Returns:
The cloned object
Throws:
CloneNotSupportedException - if the IChemObject cannot be cloned

toString

public String toString()
Returns the String representation of this RingSet.

Specified by:
toString in interface IChemObject
Overrides:
toString in class AtomContainerSet
Returns:
The String representation of this RingSet