Package org.openscience.cdk
Class ChemSequence
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- org.openscience.cdk.ChemSequence
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ICDKObject
,IChemObject
,IChemObjectListener
,IChemSequence
- Direct Known Subclasses:
DebugChemSequence
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:
- Serialized Form
- Source code:
- main
- Belongs to CDK module:
- data
- Keywords:
- animation, reaction
-
-
Field Summary
Fields Modifier and Type Field Description protected int
chemModelCount
Number of ChemModels contained by this container.protected IChemModel[]
chemModels
Array of ChemModels.protected int
growArraySize
Amount by which the chemModels array grows when elements are added and the array is not large enough for that.
-
Constructor Summary
Constructors Constructor Description ChemSequence()
Constructs an empty ChemSequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChemModel(IChemModel chemModel)
Adds an chemModel to this container.Iterable<IChemModel>
chemModels()
Returns an Iterable to ChemModels in this container.Object
clone()
Clones thisIChemObject
.IChemModel
getChemModel(int number)
Returns the ChemModel at positionnumber
in the container.int
getChemModelCount()
Returns the number of ChemModels in this Container.protected void
growChemModelArray()
Grows the chemModel array by a given size.void
removeChemModel(int pos)
Remove a ChemModel from this ChemSequence.void
stateChanged(IChemObjectChangeEvent event)
Called by objects to which this object has registered as a listener.String
toString()
Returns a one line description of this IChemObject.-
Methods inherited from class org.openscience.cdk.ChemObject
addListener, addProperties, compare, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
-
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, addProperties, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
-
Method Detail
-
addChemModel
public void addChemModel(IChemModel chemModel)
Adds an chemModel to this container.- Specified by:
addChemModel
in interfaceIChemSequence
- Parameters:
chemModel
- The chemModel to be added to this container- See Also:
getChemModel(int)
-
removeChemModel
public void removeChemModel(int pos)
Remove a ChemModel from this ChemSequence.- Specified by:
removeChemModel
in interfaceIChemSequence
- 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 interfaceIChemSequence
- Returns:
- The Iterable to ChemModels in this container
- See Also:
addChemModel(org.openscience.cdk.interfaces.IChemModel)
-
getChemModel
public IChemModel getChemModel(int number)
Returns the ChemModel at positionnumber
in the container.- Specified by:
getChemModel
in interfaceIChemSequence
- Parameters:
number
- The position of the ChemModel to be returned.- Returns:
- The ChemModel at position
number
. - See Also:
addChemModel(org.openscience.cdk.interfaces.IChemModel)
-
growChemModelArray
protected void growChemModelArray()
Grows the chemModel array by a given size.- See Also:
growArraySize
-
getChemModelCount
public int getChemModelCount()
Returns the number of ChemModels in this Container.- Specified by:
getChemModelCount
in interfaceIChemSequence
- 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 interfaceIChemObject
- Overrides:
toString
in classObject
- Returns:
- a String representation of this object
-
clone
public Object clone() throws CloneNotSupportedException
Description copied from class:ChemObject
Clones thisIChemObject
. 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 interfaceIChemObject
- Overrides:
clone
in classChemObject
- 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 interfaceIChemObjectListener
- Parameters:
event
- A change event pointing to the source of the change
-
-