Class IntExpr
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.PropagationBaseObject
com.google.ortools.constraintsolver.IntExpr
- Direct Known Subclasses:
BaseIntExpr
,IntVar
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)
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)
-
Field Summary
Fields inherited from class com.google.ortools.constraintsolver.BaseObject
swigCMemOwn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ModelVisitor visitor) Accepts the given visitor.boolean
bound()
Returns true if the min and the max of the expression are equal.void
delete()
protected void
finalize()
static long
boolean
isVar()
Returns true if the expression is indeed a variable.long
max()
long
min()
void
range
(long[] l, long[] u) By default calls Min() and Max(), but can be redefined when Min and Max
code can be factorized.void
setMax
(long m) void
setMin
(long m) void
setRange
(long l, long u) This method sets both the min and the max of the expression.void
setValue
(long v) This method sets the value of the expression.static long
swigRelease
(IntExpr obj) var()
Creates a variable from the expression.varWithName
(String name) Creates a variable from the expression and set the name of the
resulting var.void
Attach a demon that will watch the min or the max of the expression.void
Attach a demon that will watch the min or the max of the expression.Methods inherited from class com.google.ortools.constraintsolver.PropagationBaseObject
baseName, enqueueDelayedDemon, enqueueVar, freezeQueue, getCPtr, hasName, name, reset_action_on_fail, set_variable_to_clean_on_fail, setName, solver, swigRelease, toString, unfreezeQueue
Methods inherited from class com.google.ortools.constraintsolver.BaseObject
getCPtr, swigRelease
-
Constructor Details
-
IntExpr
public IntExpr(long cPtr, boolean cMemoryOwn)
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classPropagationBaseObject
-
delete
public void delete()- Overrides:
delete
in classPropagationBaseObject
-
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
Creates a variable from the expression. -
varWithName
-
whenRange
Attach a demon that will watch the min or the max of the expression. -
whenRange
Attach a demon that will watch the min or the max of the expression. -
accept
Accepts the given visitor.
-