Ejemplo n.º 1
0
        /// <summary>creates a method with the filled member variables</summary>
        /// <returns> the String representation of the created method
        /// </returns>
        public override System.String ToString()
        {
            System.String theMethod;

            // add the comments and visibility to the method
            theMethod  = INDENT + "/**\n" + vectorToString(1, description, " * ") + vectorToString(1, comments, " * ") + "    */\n";
            theMethod += (INDENT + visibility);

            // check if its a constructor
            if (returnType != null)
            {
                theMethod += returnType;
            }

            // add the paramters to the method
            theMethod += name;
            if (params_Renamed.Count > 0)
            {
                theMethod += ("(" + SupportClass.CollectionToString(params_Renamed).Replace('[', ' ').Replace(']', ' ') + ")");
            }
            else
            {
                theMethod += "()";
            }

            // check if its throwing an exception
            if (throwing != null)
            {
                theMethod += (" throws " + throwing);
            }

            // create the body of the method
            theMethod += (" {\n" + vectorToString(2, body, "") + INDENT + "}\n");
            return(theMethod);
        }
 public virtual String format(System.Collections.IDictionary parameters)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.Append('!');
     sb.Append(id);
     sb.Append('!');
     if (parameters != null && parameters.Count != 0)
     {
         sb.Append(' ');
         sb.Append(SupportClass.CollectionToString(parameters));
     }
     return(sb.ToString());
 }
Ejemplo n.º 3
0
 /// <summary>for debugging </summary>
 public override String ToString()
 {
     return(SupportClass.CollectionToString(m_locations));
 }
Ejemplo n.º 4
0
 /// <summary> Sets the given property to the given vector value, if both are allowed by any existing ruleset</summary>
 /// <param name="propertyName">The property to be set
 /// </param>
 /// <param name="propertyValue">The value that the property will be set to
 /// </param>
 public virtual void  setProperty(System.String propertyName, System.Collections.ArrayList propertyValue)
 {
     System.Collections.ArrayList oldValue = getProperty(propertyName);
     if (oldValue != null && vectorEquals(oldValue, propertyValue))
     {
         //No point in redundantly setting values!
         return;
     }
     if (rulesList.Count == 0)
     {
         writeValue(propertyName, propertyValue);
     }
     else
     {
         bool valid = true;
         System.Collections.IEnumerator en = propertyValue.GetEnumerator();
         //UPGRADE_TODO: Method 'java.util.Enumeration.hasMoreElements' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationhasMoreElements'"
         while (en.MoveNext())
         {
             // RL - checkPropertyAllowed is implicit in checkValueAllowed
             //UPGRADE_TODO: Method 'java.util.Enumeration.nextElement' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilEnumerationnextElement'"
             if (!checkValueAllowed(propertyName, (System.String)en.Current))
             {
                 valid = false;
             }
         }
         if (valid)
         {
             writeValue(propertyName, propertyValue);
             notifyChanges(propertyName);
         }
         //#if debug.output==verbose
         else
         {
             System.Console.Out.WriteLine("Property Manager: Unable to write value (" + SupportClass.CollectionToString(propertyValue) + ") to " + propertyName);
         }
         //#endif
     }
 }
Ejemplo n.º 5
0
 /// <summary> Helper for subclass implementations of toString(  ).
 ///
 /// </summary>
 /// <param name="vertexSet">the vertex set V to be printed
 /// </param>
 /// <param name="edgeSet">the edge set E to be printed
 ///
 /// </param>
 /// <returns> a string representation of (V,E)
 /// </returns>
 protected internal virtual System.String toStringFromSets(System.Collections.ICollection vertexSet, System.Collections.ICollection edgeSet)
 {
     return("(" + SupportClass.CollectionToString(vertexSet) + ", " + SupportClass.CollectionToString(edgeSet) + ")");
 }