org.openscience.cdk
Class BioPolymer

java.lang.Object
  extended by org.openscience.cdk.ChemObject
      extended by org.openscience.cdk.AtomContainer
          extended by org.openscience.cdk.Molecule
              extended by org.openscience.cdk.Polymer
                  extended by org.openscience.cdk.BioPolymer
All Implemented Interfaces:
Serializable, Cloneable, IAtomContainer, IBioPolymer, ICDKObject, IChemObject, IChemObjectListener, IMolecule, IPolymer
Direct Known Subclasses:
DebugBioPolymer, NNBioPolymer, PDBPolymer

public class BioPolymer
extends Polymer
implements Serializable, IBioPolymer

A BioPolymer is a subclass of a Polymer which is supposed to store additional informations about the Polymer which are connected to BioPolymers.

Author:
Edgar Luttmann , Martin Eklund
See Also:
Serialized Form
Keywords:
polymer, biopolymer
Created on:
2001-08-06
Belongs to CDK module:
data
Source code:
HEAD

Constructor Summary
BioPolymer()
          Constructs a new Polymer to store the Strands.
 
Method Summary
 void addAtom(IAtom oAtom, IMonomer oMonomer, IStrand oStrand)
          Adds the atom to a specified Strand and a specified Monomer.
 void addAtom(IAtom oAtom, IStrand oStrand)
          Adds the atom oAtom to a specified Strand, whereas the Monomer is unspecified.
 Object clone()
          Clones this AtomContainer object and its content.
 IMonomer getMonomer(String monName, String strandName)
          Retrieves a Monomer object by specifying its name.
 int getMonomerCount()
          Returns the number of monomers present in BioPolymer.
 Collection<String> getMonomerNames()
          Returns a collection of the names of all Monomers in this BioPolymer.
 IStrand getStrand(String cName)
          Retrieves a Monomer object by specifying its name.
 int getStrandCount()
          Returns the number of strands present in the BioPolymer.
 Collection<String> getStrandNames()
          Returns a collection of the names of all Strands in this BioPolymer.
 Map<String,IStrand> getStrands()
          Returns a Map containing the strands in the Polymer.
 void removeStrand(String name)
          Removes a particular strand, specified by its name.
 String toString()
          Returns a one line string representation of this Atom.
 
Methods inherited from class org.openscience.cdk.Polymer
addAtom, getMonomer, removeMonomer
 
Methods inherited from class org.openscience.cdk.AtomContainer
add, addAtom, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, singleElectrons, stateChanged, stereoElements
 
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.IBioPolymer
addAtom
 
Methods inherited from interface org.openscience.cdk.interfaces.IPolymer
addAtom, getMonomer, removeMonomer
 
Methods inherited from interface org.openscience.cdk.interfaces.IAtomContainer
add, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, singleElectrons, stereoElements
 
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
 
Methods inherited from interface org.openscience.cdk.interfaces.IChemObjectListener
stateChanged
 

Constructor Detail

BioPolymer

public BioPolymer()
Constructs a new Polymer to store the Strands.

Method Detail

addAtom

public void addAtom(IAtom oAtom,
                    IStrand oStrand)
Adds the atom oAtom to a specified Strand, whereas the Monomer is unspecified. Hence the atom will be added to a Monomer of type UNKNOWN in the specified Strand.

Specified by:
addAtom in interface IBioPolymer
Parameters:
oAtom - The atom to add
oStrand - The strand the atom belongs to

addAtom

public void addAtom(IAtom oAtom,
                    IMonomer oMonomer,
                    IStrand oStrand)
Adds the atom to a specified Strand and a specified Monomer.

Specified by:
addAtom in interface IBioPolymer
Parameters:
oAtom -
oMonomer -
oStrand -

getMonomerCount

public int getMonomerCount()
Returns the number of monomers present in BioPolymer.

Specified by:
getMonomerCount in interface IBioPolymer
Specified by:
getMonomerCount in interface IPolymer
Overrides:
getMonomerCount in class Polymer
Returns:
number of monomers

getMonomer

public IMonomer getMonomer(String monName,
                           String strandName)
Retrieves a Monomer object by specifying its name. [You have to specify the strand to enable monomers with the same name in different strands. There is at least one such case: every strand contains a monomer called "".]

Specified by:
getMonomer in interface IBioPolymer
Parameters:
monName - The name of the monomer to look for
strandName - The name of the strand to look for
Returns:
The Monomer object which was asked for

getMonomerNames

public Collection<String> getMonomerNames()
Returns a collection of the names of all Monomers in this BioPolymer.

Specified by:
getMonomerNames in interface IBioPolymer
Specified by:
getMonomerNames in interface IPolymer
Overrides:
getMonomerNames in class Polymer
Returns:
a Collection of all the monomer names.

getStrandCount

public int getStrandCount()
Returns the number of strands present in the BioPolymer.

Specified by:
getStrandCount in interface IBioPolymer
Returns:
number of strands

getStrand

public IStrand getStrand(String cName)
Retrieves a Monomer object by specifying its name.

Specified by:
getStrand in interface IBioPolymer
Parameters:
cName - The name of the monomer to look for
Returns:
The Monomer object which was asked for

getStrandNames

public Collection<String> getStrandNames()
Returns a collection of the names of all Strands in this BioPolymer.

Specified by:
getStrandNames in interface IBioPolymer
Returns:
a Collection of all the strand names.

removeStrand

public void removeStrand(String name)
Removes a particular strand, specified by its name.

Specified by:
removeStrand in interface IBioPolymer
Parameters:
name - name of the strand to remove

getStrands

public Map<String,IStrand> getStrands()
Description copied from interface: IBioPolymer
Returns a Map containing the strands in the Polymer.

Specified by:
getStrands in interface IBioPolymer
Returns:
hashtable containing the monomers in the strand.

toString

public String toString()
Description copied from class: Molecule
Returns a one line string representation of this Atom. Methods is conform RFC #9.

Specified by:
toString in interface IChemObject
Overrides:
toString in class Polymer
Returns:
The string representation of this Atom

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: AtomContainer
Clones this AtomContainer object and its content.

Specified by:
clone in interface IChemObject
Overrides:
clone in class Polymer
Returns:
The cloned object
Throws:
CloneNotSupportedException - if the IChemObject cannot be cloned
See Also:
ChemObject.shallowCopy()