Class ReactionSet

    • Constructor Detail

      • ReactionSet

        public ReactionSet()
        Constructs an empty ReactionSet.
    • Method Detail

      • addReaction

        public void addReaction​(IReaction reaction)
        Adds an reaction to this container.
        Specified by:
        addReaction in interface IReactionSet
        Parameters:
        reaction - The reaction to be added to this container
      • removeReaction

        public void removeReaction​(int pos)
        Remove a reaction from this set.
        Specified by:
        removeReaction in interface IReactionSet
        Parameters:
        pos - The position of the reaction to be removed.
      • getReaction

        public IReaction getReaction​(int number)
        Returns the Reaction at position number in the container.
        Specified by:
        getReaction in interface IReactionSet
        Parameters:
        number - The position of the Reaction to be returned
        Returns:
        The Reaction at position number
      • getReactionCount

        public int getReactionCount()
        Returns the number of Reactions in this Container.
        Specified by:
        getReactionCount in interface IReactionSet
        Returns:
        The number of Reactions in this Container
      • toString

        public String toString()
        Description copied from interface: IChemObject
        Returns a one line description of this IChemObject.
        Specified by:
        toString in interface IChemObject
        Overrides:
        toString in class Object
        Returns:
        a String representation of this object
      • removeAllReactions

        public void removeAllReactions()
        Removes all Reactions from this container.
        Specified by:
        removeAllReactions in interface IReactionSet
      • stateChanged

        public void stateChanged​(IChemObjectChangeEvent event)
        Description copied from interface: IChemObjectListener
        Called by objects to notify objects that implemented this interface and registered with them as ChemObjectListeners.
        Specified by:
        stateChanged in interface IChemObjectListener
        Parameters:
        event - a ChemObjectChangeEvent object
      • removeReaction

        public void removeReaction​(IReaction relevantReaction)
        Description copied from interface: IReactionSet
        Removes all instances of a reaction from this IReactionSet.
        Specified by:
        removeReaction in interface IReactionSet
        Parameters:
        relevantReaction - the reaction to remove
      • isEmpty

        public boolean isEmpty()
        Returns true if this IReactionSet is empty.
        Specified by:
        isEmpty in interface IReactionSet
        Returns:
        a boolean indicating if this ring set no reactions