Package org.openscience.cdk
Class ChemFile
- java.lang.Object
-
- org.openscience.cdk.ChemObject
-
- 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
- Source code:
- main
- Belongs to CDK module:
- data
-
-
Field Summary
Fields Modifier and Type Field Description protected int
chemSequenceCount
Number of ChemSequences contained by this container.protected IChemSequence[]
chemSequences
Array of ChemSquences.protected int
growArraySize
Amount by which the chemsequence array grows when elements are added and the array is not large enough for that.-
Fields inherited from interface org.openscience.cdk.interfaces.IChemObject
ALIPHATIC, AROMATIC, CONJUGATED, HYDROGEN_BOND_ACCEPTOR, HYDROGEN_BOND_DONOR, IN_RING, MAPPED, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED
-
-
Constructor Summary
Constructors Constructor Description ChemFile()
Constructs an empty ChemFile.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 positionnumber
in the container.int
getChemSequenceCount()
Returns the number of ChemSequences in this Container.protected void
growChemSequenceArray()
Grows the ChemSequence array by a given size.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, addProperties, clear, compare, flags, getBuilder, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, 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, clear, flags, getFlag, getFlags, getFlagValue, getID, getListenerCount, getNotification, getProperties, getProperty, getProperty, is, notifyChanged, notifyChanged, removeListener, removeProperty, set, setFlag, setFlags, setID, setNotification, setProperties, setProperty
-
-
-
-
Field Detail
-
chemSequences
protected IChemSequence[] chemSequences
Array of ChemSquences.
-
chemSequenceCount
protected int chemSequenceCount
Number of ChemSequences contained by this container.
-
growArraySize
protected int growArraySize
Amount by which the chemsequence array grows when elements are added and the array is not large enough for that.
-
-
Method Detail
-
addChemSequence
public void addChemSequence(IChemSequence chemSequence)
Adds a ChemSequence to this container.- Specified by:
addChemSequence
in interfaceIChemFile
- 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 interfaceIChemFile
- 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 interfaceIChemFile
- 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 positionnumber
in the container.- Specified by:
getChemSequence
in interfaceIChemFile
- Parameters:
number
- The position of the ChemSequence to be returned.- Returns:
- The ChemSequence at position
number
. - See Also:
addChemSequence(org.openscience.cdk.interfaces.IChemSequence)
-
growChemSequenceArray
protected void growChemSequenceArray()
Grows the ChemSequence array by a given size.- See Also:
growArraySize
-
getChemSequenceCount
public int getChemSequenceCount()
Returns the number of ChemSequences in this Container.- Specified by:
getChemSequenceCount
in interfaceIChemFile
- 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 interfaceIChemObject
- Overrides:
toString
in classObject
- Returns:
- String representation of the Object
-
clone
public Object clone() throws CloneNotSupportedException
Allows for getting an clone of this object.- Specified by:
clone
in interfaceIChemObject
- Overrides:
clone
in classChemObject
- 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 interfaceIChemObjectListener
- Parameters:
event
- A change event pointing to the source of the change
-
-