Package org.openscience.cdk.silent
Class RingSet
- java.lang.Object
-
- org.openscience.cdk.silent.ChemObject
-
- org.openscience.cdk.silent.AtomContainerSet
-
- org.openscience.cdk.silent.RingSet
-
- All Implemented Interfaces:
Serializable
,Cloneable
,IAtomContainerSet
,ICDKObject
,IChemObject
,IChemObjectListener
,IRingSet
public class RingSet extends AtomContainerSet implements Serializable, IRingSet, Cloneable
Maintains a set of Ring objects.- See Also:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- silent
- Keywords:
- ring, set of
-
-
Field Summary
Fields Modifier and Type Field Description 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?-
Fields inherited from class org.openscience.cdk.silent.AtomContainerSet
atomContainerCount, atomContainers, growArraySize, multipliers
-
-
Constructor Summary
Constructors Constructor Description RingSet()
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(IRingSet ringSet)
Adds all rings of another RingSet if they are not already part of this ring set.Object
clone()
Clones thisRingSet
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.silent.AtomContainerSet
add, addAtomContainer, addAtomContainer, atomContainers, getAtomContainer, getAtomContainerCount, getMultiplier, getMultiplier, getMultipliers, growAtomContainerArray, isEmpty, removeAllAtomContainers, removeAtomContainer, removeAtomContainer, replaceAtomContainer, setMultiplier, setMultiplier, setMultipliers, sortAtomContainers, stateChanged
-
Methods inherited from class org.openscience.cdk.silent.ChemObject
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
-
Methods inherited from class java.lang.Object
equals, finalize, 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.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
-
-
-
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
-
-
Method Detail
-
getRings
public IRingSet getRings(IBond bond)
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.
-
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 interfaceIRingSet
- 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 useAtomContainerSet.addAtomContainer(org.openscience.cdk.interfaces.IAtomContainer)
-
contains
public boolean contains(IAtom atom)
True, if at least one of the rings in the ringset contains the given atom.
-
contains
public boolean contains(IAtomContainer ring)
Checks for presence of a ring in this RingSet.
-
clone
public Object clone() throws CloneNotSupportedException
Clones thisRingSet
including the Rings.- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classAtomContainerSet
- 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 interfaceIChemObject
- Overrides:
toString
in classAtomContainerSet
- Returns:
- The String representation of this RingSet
-
-