Class Polymer

    • Constructor Detail

      • Polymer

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

      • 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