Package org.openscience.cdk
Class ReactionSet
java.lang.Object
org.openscience.cdk.ChemObject
org.openscience.cdk.ReactionSet
- All Implemented Interfaces:
Serializable,Cloneable,ICDKObject,IChemObject,IChemObjectListener,IReactionSet
- Direct Known Subclasses:
DebugReactionSet,ReactionChain,ReactionScheme
public class ReactionSet
extends ChemObject
implements Serializable, IReactionSet, IChemObjectListener, Cloneable
A set of reactions, for example those taking part in a reaction.
To retrieve the reactions from the set, there are two options:
Iterator reactions = reactionSet.reactions();
while (reactions.hasNext()) {
IReaction reaction = (IReaction)reactions.next();
}
and
for (int i=0; i < reactionSet.getReactionCount(); i++) {
IReaction reaction = reactionSet.getReaction(i);
}
- See Also:
- Keywords:
- reaction
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReaction(IReaction reaction) Adds an reaction to this container.clone()Clones thisReactionSetand the containedReactions too.getReaction(int number) Returns the Reaction at positionnumberin the container.intReturns the number of Reactions in this Container.booleanisEmpty()Returns true if this IReactionSet is empty.Get an iterator for this reaction set.voidRemoves all Reactions from this container.voidremoveReaction(int pos) Remove a reaction from this set.voidremoveReaction(IReaction relevantReaction) Removes all instances of a reaction from this IReactionSet.voidCalled by objects to notify objects that implemented this interface and registered with them as ChemObjectListeners.toString()Returns a one line description of this IChemObject.Methods 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, setProperty, shallowCopyMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setProperty
-
Constructor Details
-
ReactionSet
public ReactionSet()Constructs an empty ReactionSet.
-
-
Method Details
-
addReaction
Adds an reaction to this container.- Specified by:
addReactionin interfaceIReactionSet- Parameters:
reaction- The reaction to be added to this container
-
removeReaction
public void removeReaction(int pos) Remove a reaction from this set.- Specified by:
removeReactionin interfaceIReactionSet- Parameters:
pos- The position of the reaction to be removed.
-
getReaction
Returns the Reaction at positionnumberin the container.- Specified by:
getReactionin interfaceIReactionSet- Parameters:
number- The position of the Reaction to be returned- Returns:
- The Reaction at position
number
-
reactions
Get an iterator for this reaction set.- Specified by:
reactionsin interfaceIReactionSet- Returns:
- A new Iterator for this ReactionSet.
-
getReactionCount
public int getReactionCount()Returns the number of Reactions in this Container.- Specified by:
getReactionCountin interfaceIReactionSet- Returns:
- The number of Reactions in this Container
-
toString
Description copied from interface:IChemObjectReturns a one line description of this IChemObject.- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classObject- Returns:
- a String representation of this object
-
clone
Clones thisReactionSetand the containedReactions too.- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classChemObject- Returns:
- The cloned ReactionSet
- Throws:
CloneNotSupportedException- if the IChemObject cannot be cloned
-
removeAllReactions
public void removeAllReactions()Removes all Reactions from this container.- Specified by:
removeAllReactionsin interfaceIReactionSet
-
stateChanged
Description copied from interface:IChemObjectListenerCalled by objects to notify objects that implemented this interface and registered with them as ChemObjectListeners.- Specified by:
stateChangedin interfaceIChemObjectListener- Parameters:
event- a ChemObjectChangeEvent object
-
removeReaction
Description copied from interface:IReactionSetRemoves all instances of a reaction from this IReactionSet.- Specified by:
removeReactionin interfaceIReactionSet- Parameters:
relevantReaction- the reaction to remove
-
isEmpty
public boolean isEmpty()Returns true if this IReactionSet is empty.- Specified by:
isEmptyin interfaceIReactionSet- Returns:
- a boolean indicating if this ring set no reactions
-