org.openscience.cdk
Class ChemFile

java.lang.Object
  extended by org.openscience.cdk.ChemObject
      extended by org.openscience.cdk.ChemFile
All Implemented Interfaces:
Serializable, Cloneable, ICDKObject, IChemFile, IChemObject, IChemObjectListener
Direct Known Subclasses:
DebugChemFile

public class ChemFile
extends ChemObject
implements Serializable, Cloneable, IChemFile, IChemObjectListener

A Object containing a number of ChemSequences. This is supposed to be the top level container, which can contain all the concepts stored in a chemical document

Author:
steinbeck
See Also:
Serialized Form
Belongs to CDK module:
data
Source code:
cdk-1.4.x

Constructor Summary
ChemFile()
          Constructs an empty ChemFile.
 
Method Summary
 void addChemSequence(IChemSequence chemSequence)
          Adds a ChemSequence to this container.
 Iterable<IChemSequence> chemSequences()
          Returns the Iterable to ChemSequences of this container.
 Object clone()
          Allows for getting an clone of this object.
 IChemSequence getChemSequence(int number)
          Returns the ChemSequence at position number in the container.
 int getChemSequenceCount()
          Returns the number of ChemSequences in this Container.
 void removeChemSequence(int pos)
          Removes a ChemSequence from this container.
 void stateChanged(IChemObjectChangeEvent event)
          Called by objects to which this object has registered as a listener.
 String toString()
          Returns a String representation of this class.
 
Methods inherited from class org.openscience.cdk.ChemObject
addListener, compare, getBuilder, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
 
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
 

Constructor Detail

ChemFile

public ChemFile()
Constructs an empty ChemFile.

Method Detail

addChemSequence

public void addChemSequence(IChemSequence chemSequence)
Adds a ChemSequence to this container.

Specified by:
addChemSequence in interface IChemFile
Parameters:
chemSequence - The chemSequence to be added to this container
See Also:
chemSequences

removeChemSequence

public void removeChemSequence(int pos)
Removes a ChemSequence from this container.

Specified by:
removeChemSequence in interface IChemFile
Parameters:
pos - The position from which to remove
See Also:
chemSequences, addChemSequence(org.openscience.cdk.interfaces.IChemSequence)

chemSequences

public Iterable<IChemSequence> chemSequences()
Returns the Iterable to ChemSequences of this container.

Specified by:
chemSequences in interface IChemFile
Returns:
The Iterable to ChemSequences of this container
See Also:
addChemSequence(org.openscience.cdk.interfaces.IChemSequence)

getChemSequence

public IChemSequence getChemSequence(int number)
Returns the ChemSequence at position number in the container.

Specified by:
getChemSequence in interface IChemFile
Parameters:
number - The position of the ChemSequence to be returned.
Returns:
The ChemSequence at position number.
See Also:
addChemSequence(org.openscience.cdk.interfaces.IChemSequence)

getChemSequenceCount

public int getChemSequenceCount()
Returns the number of ChemSequences in this Container.

Specified by:
getChemSequenceCount in interface IChemFile
Returns:
The number of ChemSequences in this Container

toString

public String toString()
Returns a String representation of this class. It implements RFC #9.

Specified by:
toString in interface IChemObject
Overrides:
toString in class Object
Returns:
String representation of the Object

clone

public Object clone()
             throws CloneNotSupportedException
Allows for getting an clone of this object.

Specified by:
clone in interface IChemObject
Overrides:
clone in class ChemObject
Returns:
a clone of this 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