An abstract class for constraints. A constraint is a component of a constraint network. See Network for example programs to construct constraints and Add them to a constraint network.
Exemplo n.º 1
0
 /// <summary> Adds a constraint to this network.
 /// If the constraint is already in the nework, this invocation has no effect.
 /// Please notice that variables in the constraint are not automatically added.
 /// </summary>
 /// <param name="c">the constraint to be added
 /// </param>
 /// <returns> the constraint itself
 /// </returns>
 /// <throws>  NullPointerException if <tt>c</tt> is <tt>null</tt> </throws>
 /// <throws>  IllegalArgumentException if <tt>c</tt> is already added to another network </throws>
 protected internal virtual Constraint ADD(Constraint c)
 {
     if (!_constraints.Contains(c))
     {
         if (c.Index >= 0)
         {
             throw new ArgumentException();
         }
         c.Index = _constraints.Count;
         _constraints.Add(c);
     }
     return c;
 }
Exemplo n.º 2
0
 public ConstraintToken(Constraint value)
 {
     _value = value;
 }