Class IntExpr

Direct Known Subclasses:
BaseIntExpr, IntVar

public class IntExpr extends PropagationBaseObject
The class IntExpr is the base of all integer expressions in
constraint programming.
It contains the basic protocol for an expression:
- setting and modifying its bound
- querying if it is bound
- listening to events modifying its bounds
- casting it into a variable (instance of IntVar)
  • Constructor Details

    • IntExpr

      public IntExpr(long cPtr, boolean cMemoryOwn)
  • Method Details

    • getCPtr

      public static long getCPtr(IntExpr obj)
    • swigRelease

      public static long swigRelease(IntExpr obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class PropagationBaseObject
    • delete

      public void delete()
      Overrides:
      delete in class PropagationBaseObject
    • min

      public long min()
    • setMin

      public void setMin(long m)
    • max

      public long max()
    • setMax

      public void setMax(long m)
    • range

      public void range(long[] l, long[] u)
      By default calls Min() and Max(), but can be redefined when Min and Max
      code can be factorized.
    • setRange

      public void setRange(long l, long u)
      This method sets both the min and the max of the expression.
    • setValue

      public void setValue(long v)
      This method sets the value of the expression.
    • bound

      public boolean bound()
      Returns true if the min and the max of the expression are equal.
    • isVar

      public boolean isVar()
      Returns true if the expression is indeed a variable.
    • var

      public IntVar var()
      Creates a variable from the expression.
    • varWithName

      public IntVar varWithName(String name)
      Creates a variable from the expression and set the name of the
      resulting var. If the expression is already a variable, then it
      will set the name of the expression, possibly overwriting it.
      This is just a shortcut to Var() followed by set_name().
    • whenRange

      public void whenRange(Demon d)
      Attach a demon that will watch the min or the max of the expression.
    • whenRange

      public void whenRange(Runnable closure)
      Attach a demon that will watch the min or the max of the expression.
    • accept

      public void accept(ModelVisitor visitor)
      Accepts the given visitor.