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
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intNumber of ChemSequences contained by this container.protected IChemSequence[]Array of ChemSquences.protected intAmount 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, MARKUSH, NOT_IN_RING, PLACED, REACTIVE_CENTER, SINGLE_OR_DOUBLE, TYPEABLE, VISITED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChemSequence(IChemSequence chemSequence) Adds a ChemSequence to this container.Returns the Iterable to ChemSequences of this container.clone()Allows for getting an clone of this object.getChemSequence(int number) Returns the ChemSequence at positionnumberin the container.intReturns the number of ChemSequences in this Container.protected voidGrows the ChemSequence array by a given size.voidremoveChemSequence(int pos) Removes a ChemSequence from this container.voidCalled by objects to which this object has registered as a listener.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, shallowCopyMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilderMethods 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 Details
-
chemSequences
Array of ChemSquences. -
chemSequenceCount
protected int chemSequenceCountNumber of ChemSequences contained by this container. -
growArraySize
protected int growArraySizeAmount by which the chemsequence array grows when elements are added and the array is not large enough for that.
-
-
Constructor Details
-
ChemFile
public ChemFile()Constructs an empty ChemFile.
-
-
Method Details
-
addChemSequence
Adds a ChemSequence to this container.- Specified by:
addChemSequencein interfaceIChemFile- Parameters:
chemSequence- The chemSequence to be added to this container- See Also:
-
removeChemSequence
public void removeChemSequence(int pos) Removes a ChemSequence from this container.- Specified by:
removeChemSequencein interfaceIChemFile- Parameters:
pos- The position from which to remove- See Also:
-
chemSequences
Returns the Iterable to ChemSequences of this container.- Specified by:
chemSequencesin interfaceIChemFile- Returns:
- The Iterable to ChemSequences of this container
- See Also:
-
getChemSequence
Returns the ChemSequence at positionnumberin the container.- Specified by:
getChemSequencein interfaceIChemFile- Parameters:
number- The position of the ChemSequence to be returned.- Returns:
- The ChemSequence at position
number. - See Also:
-
growChemSequenceArray
protected void growChemSequenceArray()Grows the ChemSequence array by a given size.- See Also:
-
getChemSequenceCount
public int getChemSequenceCount()Returns the number of ChemSequences in this Container.- Specified by:
getChemSequenceCountin interfaceIChemFile- Returns:
- The number of ChemSequences in this Container
-
toString
Returns a String representation of this class. It implements RFC #9.- Specified by:
toStringin interfaceIChemObject- Overrides:
toStringin classObject- Returns:
- String representation of the Object
-
clone
Allows for getting an clone of this object.- Specified by:
clonein interfaceIChemObject- Overrides:
clonein classChemObject- Returns:
- a clone of this object
- Throws:
CloneNotSupportedException
-
stateChanged
Called by objects to which this object has registered as a listener.- Specified by:
stateChangedin interfaceIChemObjectListener- Parameters:
event- A change event pointing to the source of the change
-