Esempio n. 1
0
 /// <summary> Adds a profCourse to this network.
 /// If the profCourse is already in the nework, this invocation has no effect.
 /// </summary>
 /// <param name="pc">the profCourse to be added
 /// </param>
 /// <returns> the variable itself
 /// </returns>
 /// <throws>  NullPointerException if <tt>v</tt> is <tt>null</tt> </throws>
 /// <throws>  IllegalArgumentException if <tt>v</tt> is already added to another network </throws>
 protected internal virtual Professor Add(Professor pc)
 {
     if (!professors.Contains(pc))
     {
         if (pc.Index >= 0)
         {
             throw new ArgumentException();
         }
         pc.Index = professors.Count;
         professors.Add(pc);
     }
     return pc;
 }
Esempio n. 2
0
 protected internal static String ToString(Professor[] pc)
 {
     String s = "";
     if (pc != null)
     {
         String delim = "";
         for (int i = 0; i < pc.Length; i++)
         {
             s += (delim + pc[i]);
             delim = ",";
         }
     }
     return "{" + s + "}";
 }