Class BioPolymer

    • 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 -
      • 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
      • 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: AtomContainer
        Returns a one line description of this IChemObject.
        Specified by:
        toString in interface IChemObject
        Overrides:
        toString in class Polymer
        Returns:
        a String representation of this object