Class Polymer

All Implemented Interfaces:
Serializable, Cloneable, IAtomContainer, ICDKObject, IChemObject, IChemObjectListener, IPolymer
Direct Known Subclasses:
BioPolymer, DebugPolymer

public class Polymer extends AtomContainer implements Serializable, IPolymer
Subclass of Molecule to store Polymer specific attributes that a Polymer has.
Author:
Edgar Luttmann <edgar@uni-paderborn.de>, Martin Eklund <martin.eklund@farmbio.uu.se>
See Also:
Source code:
main
Belongs to CDK module:
data
Keywords:
polymer
Created on:
2001-08-06
  • Constructor Details

    • Polymer

      public Polymer()
      Constructs a new Polymer to store the Monomers.
  • Method Details

    • addAtom

      public void addAtom(IAtom oAtom, IMonomer oMonomer)
      Adds the atom oAtom to a specified Monomer.
      Specified by:
      addAtom in interface IPolymer
      Parameters:
      oAtom - The atom to add
      oMonomer - The monomer the atom belongs to
    • getMonomerCount

      public int getMonomerCount()
      Returns the number of monomers present in the Polymer.
      Specified by:
      getMonomerCount in interface IPolymer
      Returns:
      number of monomers
    • getMonomer

      public IMonomer getMonomer(String cName)
      Retrieves a Monomer object by specifying its name.
      Specified by:
      getMonomer in interface IPolymer
      Parameters:
      cName - The name of the monomer 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 polymer.
      Specified by:
      getMonomerNames in interface IPolymer
      Returns:
      a Collection of all the monomer names.
    • removeMonomer

      public void removeMonomer(String name)
      Removes a particular monomer, specified by its name.
      Specified by:
      removeMonomer in interface IPolymer
      Parameters:
      name - The name of the monomer to remove
    • toString

      public String toString()
      Description copied from class: AtomContainer
      Returns a one line description of this IChemObject.
      Specified by:
      toString in interface IChemObject
      Overrides:
      toString in class AtomContainer
      Returns:
      a String representation of this object
    • clone

      public IPolymer clone() throws CloneNotSupportedException
      Description copied from class: AtomContainer
      Clones this IChemObject. 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 interface IAtomContainer
      Specified by:
      clone in interface IChemObject
      Specified by:
      clone in interface IPolymer
      Overrides:
      clone in class AtomContainer
      Returns:
      The cloned object
      Throws:
      CloneNotSupportedException - if the IChemObject cannot be cloned