Class AtomContainerSet

    • Field Detail

      • atomContainers

        protected IAtomContainer[] atomContainers
        Array of AtomContainers.
      • atomContainerCount

        protected int atomContainerCount
        Number of AtomContainers contained by this container.
      • multipliers

        protected Double[] multipliers
        Defines the number of instances of a certain molecule in the set. It is 1 by default.
      • growArraySize

        protected int growArraySize
        Amount by which the AtomContainers array grows when elements are added and the array is not large enough for that.
    • Constructor Detail

      • AtomContainerSet

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

      • addAtomContainer

        public void addAtomContainer​(IAtomContainer atomContainer)
        Adds an atomContainer to this container.
        Specified by:
        addAtomContainer in interface IAtomContainerSet
        Parameters:
        atomContainer - The atomContainer to be added to this container
      • removeAtomContainer

        public void removeAtomContainer​(IAtomContainer atomContainer)
        Removes an AtomContainer from this container.
        Specified by:
        removeAtomContainer in interface IAtomContainerSet
        Parameters:
        atomContainer - The atomContainer to be removed from this container
      • removeAtomContainer

        public void removeAtomContainer​(int pos)
        Removes an AtomContainer from this container.
        Specified by:
        removeAtomContainer in interface IAtomContainerSet
        Parameters:
        pos - The position of the AtomContainer to be removed from this container
      • replaceAtomContainer

        public void replaceAtomContainer​(int position,
                                         IAtomContainer container)
        Replace the AtomContainer at a specific position (array has to be large enough).
        Specified by:
        replaceAtomContainer in interface IAtomContainerSet
        Parameters:
        position - position in array for AtomContainer
        container - the replacement AtomContainer
      • setMultiplier

        public boolean setMultiplier​(IAtomContainer container,
                                     Double multiplier)
        Sets the coefficient of a AtomContainer to a given value.
        Specified by:
        setMultiplier in interface IAtomContainerSet
        Parameters:
        container - The AtomContainer for which the multiplier is set
        multiplier - The new multiplier for the AtomContatiner
        Returns:
        true if multiplier has been set
        See Also:
        getMultiplier(IAtomContainer)
      • setMultiplier

        public void setMultiplier​(int position,
                                  Double multiplier)
        Sets the coefficient of a AtomContainer to a given value.
        Specified by:
        setMultiplier in interface IAtomContainerSet
        Parameters:
        position - The position of the AtomContainer for which the multiplier is set in [0,..]
        multiplier - The new multiplier for the AtomContatiner at position
        See Also:
        getMultiplier(int)
      • setMultipliers

        public boolean setMultipliers​(Double[] newMultipliers)
        Sets the multipliers of the AtomContainers.
        Specified by:
        setMultipliers in interface IAtomContainerSet
        Parameters:
        newMultipliers - The new multipliers for the AtomContainers in this set
        Returns:
        true if multipliers have been set.
        See Also:
        getMultipliers()
      • addAtomContainer

        public void addAtomContainer​(IAtomContainer atomContainer,
                                     double multiplier)
        Adds an atomContainer to this container with the given multiplier.
        Specified by:
        addAtomContainer in interface IAtomContainerSet
        Parameters:
        atomContainer - The atomContainer to be added to this container
        multiplier - The multiplier of this atomContainer
      • add

        public void add​(IAtomContainerSet atomContainerSet)
        Adds all atomContainers in the AtomContainerSet to this container.
        Specified by:
        add in interface IAtomContainerSet
        Parameters:
        atomContainerSet - The AtomContainerSet
      • getAtomContainer

        public IAtomContainer getAtomContainer​(int number)
        Returns the AtomContainer at position number in the container.
        Specified by:
        getAtomContainer in interface IAtomContainerSet
        Parameters:
        number - The position of the AtomContainer to be returned.
        Returns:
        The AtomContainer at position number .
      • getMultiplier

        public Double getMultiplier​(int number)
        Returns the multiplier for the AtomContainer at position number in the container.
        Specified by:
        getMultiplier in interface IAtomContainerSet
        Parameters:
        number - The position of the multiplier of the AtomContainer to be returned.
        Returns:
        The multiplier for the AtomContainer at position number .
        See Also:
        setMultiplier(int, Double)
      • growAtomContainerArray

        protected void growAtomContainerArray()
        Grows the atomContainer array by a given size.
        See Also:
        growArraySize
      • getAtomContainerCount

        public int getAtomContainerCount()
        Returns the number of AtomContainers in this Container.
        Specified by:
        getAtomContainerCount in interface IAtomContainerSet
        Returns:
        The number of AtomContainers in this Container
      • toString

        public String toString()
        Returns the String representation of this AtomContainerSet.
        Specified by:
        toString in interface IChemObject
        Overrides:
        toString in class Object
        Returns:
        The String representation of this AtomContainerSet
      • stateChanged

        public void stateChanged​(IChemObjectChangeEvent event)
        Called by objects to which this object has registered as a listener.
        Specified by:
        stateChanged in interface IChemObjectListener
        Parameters:
        event - A change event pointing to the source of the change
      • isEmpty

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