예제 #1
0
        /// <summary>
        /// Substitutes the matching formal attribute values of the element
        /// with the values in the substitute attributes.
        /// </summary>
        /// <param name="substitutes">The list of substitute attribute/value pairs</param>
        /// <returns>A deep copy of the empty element with values substituted</returns>
        public EmptyElement SubstituteCopy(ArrayList substitutes)
        {
            EmptyElement xerox = copy();

            // null valued subs remove attrs from the list, so itterate in reverse
            for (int a = xerox.countAttributes() - 1; a > -1; a--)
            {     // if formal values are found, substitute
                String value = xerox.getAttributeValue(a);
                foreach (Substitute sub in substitutes)
                {
                    if (sub.formal.Equals(value))
                    {
                        xerox.addAttribute(xerox.getAttributeName(a), sub.value);
                    }
                }
            }
            return(xerox);
        }
예제 #2
0
 /**
  * Gets the name of a parameter by index number, starting at zero.
  * @param index a zero-based indicator of the parameter to examine.
  * @return the name of the indexed parameter or null if not found.
  */
 public string getParameterName(int index)
 {
     return(m_params.getAttributeName(index));
 }