Class ChemSequence

java.lang.Object
org.openscience.cdk.silent.ChemObject
org.openscience.cdk.silent.ChemSequence
All Implemented Interfaces:
Serializable, Cloneable, ICDKObject, IChemObject, IChemObjectListener, IChemSequence

public class ChemSequence extends ChemObject implements Serializable, IChemSequence, IChemObjectListener, Cloneable
A sequence of ChemModels, which can, for example, be used to store the course of a reaction. Each state of the reaction would be stored in one ChemModel.
See Also:
Keywords:
animation, reaction
  • Field Details

    • chemModels

      protected IChemModel[] chemModels
      Array of ChemModels.
    • chemModelCount

      protected int chemModelCount
      Number of ChemModels contained by this container.
    • growArraySize

      protected final int growArraySize
      Amount by which the chemModels array grows when elements are added and the array is not large enough for that.
      See Also:
  • Constructor Details

    • ChemSequence

      public ChemSequence()
      Constructs an empty ChemSequence.
  • Method Details

    • addChemModel

      public void addChemModel(IChemModel chemModel)
      Adds an chemModel to this container.
      Specified by:
      addChemModel in interface IChemSequence
      Parameters:
      chemModel - The chemModel to be added to this container
      See Also:
    • removeChemModel

      public void removeChemModel(int pos)
      Remove a ChemModel from this ChemSequence.
      Specified by:
      removeChemModel in interface IChemSequence
      Parameters:
      pos - The position of the ChemModel to be removed.
    • chemModels

      public Iterable<IChemModel> chemModels()
      Returns an Iterable to ChemModels in this container.
      Specified by:
      chemModels in interface IChemSequence
      Returns:
      The Iterable to ChemModels in this container
      See Also:
    • getChemModel

      public IChemModel getChemModel(int number)
      Returns the ChemModel at position number in the container.
      Specified by:
      getChemModel in interface IChemSequence
      Parameters:
      number - The position of the ChemModel to be returned.
      Returns:
      The ChemModel at position number.
      See Also:
    • growChemModelArray

      protected void growChemModelArray()
      Grows the chemModel array by a given size.
      See Also:
    • getChemModelCount

      public int getChemModelCount()
      Returns the number of ChemModels in this Container.
      Specified by:
      getChemModelCount in interface IChemSequence
      Returns:
      The number of ChemModels 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
    • clone

      public Object clone() throws CloneNotSupportedException
      Description copied from class: ChemObject
      Clones this IChemObject. It clones the identifier, flags, properties and pointer vectors. The ChemObjectListeners are not cloned, and neither is the content of the pointer vectors.
      Specified by:
      clone in interface IChemObject
      Overrides:
      clone in class ChemObject
      Returns:
      The cloned object
      Throws:
      CloneNotSupportedException - if the IChemObject cannot be cloned
    • 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