public class ReactionSet extends ChemObject implements Serializable, IReactionSet, IChemObjectListener, Cloneable
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);
}
Constructor and Description |
---|
ReactionSet()
Constructs an empty ReactionSet.
|
Modifier and Type | Method and Description |
---|---|
void |
addReaction(IReaction reaction)
Adds an reaction to this container.
|
Object |
clone()
Clones this
ReactionSet and the contained Reaction s
too. |
IReaction |
getReaction(int number)
Returns the Reaction at position
number in the
container. |
int |
getReactionCount()
Returns the number of Reactions in this Container.
|
boolean |
isEmpty()
Returns true if this IReactionSet is empty.
|
Iterable<IReaction> |
reactions()
Get an iterator for this reaction set.
|
void |
removeAllReactions()
Removes all Reactions from this container.
|
void |
removeReaction(int pos)
Remove a reaction from this set.
|
void |
removeReaction(IReaction relevantReaction)
Removes all instances of a reaction from this IReactionSet.
|
void |
stateChanged(IChemObjectChangeEvent event)
Called by objects to notify objects that implemented this interface
and registered with them as ChemObjectListeners.
|
String |
toString()
Returns a one line description of this IChemObject.
|
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
getBuilder
public void addReaction(IReaction reaction)
addReaction
in interface IReactionSet
reaction
- The reaction to be added to this containerpublic void removeReaction(int pos)
removeReaction
in interface IReactionSet
pos
- The position of the reaction to be removed.public IReaction getReaction(int number)
number
in the
container.getReaction
in interface IReactionSet
number
- The position of the Reaction to be returnednumber
public Iterable<IReaction> reactions()
reactions
in interface IReactionSet
public int getReactionCount()
getReactionCount
in interface IReactionSet
public String toString()
IChemObject
toString
in interface IChemObject
toString
in class Object
public Object clone() throws CloneNotSupportedException
ReactionSet
and the contained Reaction
s
too.clone
in interface IChemObject
clone
in class ChemObject
CloneNotSupportedException
- if the IChemObject cannot be clonedpublic void removeAllReactions()
removeAllReactions
in interface IReactionSet
public void stateChanged(IChemObjectChangeEvent event)
IChemObjectListener
stateChanged
in interface IChemObjectListener
event
- a ChemObjectChangeEvent objectpublic void removeReaction(IReaction relevantReaction)
IReactionSet
removeReaction
in interface IReactionSet
relevantReaction
- the reaction to removepublic boolean isEmpty()
isEmpty
in interface IReactionSet
Copyright © 2021. All rights reserved.