예제 #1
0
        /// <summary>
        /// Adds a <code>Monomer</code> to this <code>Strand</code>. All atoms and
        /// bonds in the Monomer are added. NB: The <code>Monomer</code> will *not*
        /// "automatically" be connected to the <code>Strand</code>. That has to be
        /// done "manually" (as the "connection point" is not known).
        /// </summary>
        /// <param name="monomer">
        /// </param>

        /*public void addMonomer(Monomer monomer)	{
         * if (! monomers.contains(monomer.getMonomerName())) {
         * monomers.put(monomer.getMonomerName(), monomer);	// Adderas atomer etc? Nope!
         * }
         * }*/

        /// <summary> Removes a particular monomer, specified by its name.
        ///
        /// </summary>
        /// <param name="name">The name of the monomer to remove
        /// </param>
        public virtual void removeMonomer(System.String name)
        {
            if (monomers.ContainsKey(name))
            {
                Monomer monomer = (Monomer)monomers[name];
                this.remove(monomer);
                monomers.Remove(name);
            }
        }
예제 #2
0
        /// <summary> Contructs a new Strand.</summary>
        public Strand()
            : base()
        {
            // Stand stuff
            monomers = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable());
            Monomer oMonomer = new Monomer();

            oMonomer.MonomerName = "";
            oMonomer.MonomerType = "UNKNOWN";
            monomers[""]         = oMonomer;
            strandName           = "";
        }