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 TypeMethodDescriptionvoidaccept(ModelVisitor visitor) Accepts the given visitor.booleanbound()Returns true if the min and the max of the expression are equal.voiddelete()protected voidfinalize()static longbooleanisVar()Returns true if the expression is indeed a variable.longmax()longmin()voidrange(long[] l, long[] u) By default calls Min() and Max(), but can be redefined when Min and Max
code can be factorized.voidsetMax(long m) voidsetMin(long m) voidsetRange(long l, long u) This method sets both the min and the max of the expression.voidsetValue(long v) This method sets the value of the expression.static longswigRelease(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.voidAttach a demon that will watch the min or the max of the expression.voidAttach 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, unfreezeQueueMethods 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:
finalizein classPropagationBaseObject
-
delete
public void delete()- Overrides:
deletein 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.
-