Class IntVar
java.lang.Object
com.google.ortools.constraintsolver.BaseObject
com.google.ortools.constraintsolver.PropagationBaseObject
com.google.ortools.constraintsolver.IntExpr
com.google.ortools.constraintsolver.IntVar
- Direct Known Subclasses:
- BooleanVar
The class IntVar is a subset of IntExpr. In addition to the
IntExpr protocol, it offers persistence, removing values from the domains,
and a finer model for events.
IntExpr protocol, it offers persistence, removing values from the domains,
and a finer model for events.
- 
Field SummaryFields inherited from class com.google.ortools.constraintsolver.BaseObjectswigCMemOwn
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaccept(ModelVisitor visitor) Accepts the given visitor.booleancontains(long v) This method returns whether the value 'v' is in the domain of the
 variable.voiddelete()protected voidfinalize()static longintindex()Returns the index of the variable.isDifferent(long constant) isEqual(long constant) IsEqualisGreaterOrEqual(long constant) isLessOrEqual(long constant) booleanisVar()Returns true if the expression is indeed a variable.makeDomainIterator(boolean reversible) Creates a domain iterator.makeHoleIterator(boolean reversible) Creates a hole iterator.longoldMax()Returns the previous max.longoldMin()Returns the previous min.voidremoveInterval(long l, long u) This method removes the interval 'l' ..voidremoveValue(long v) This method removes the value 'v' from the domain of the variable.voidremoveValues(long[] values) This method remove the values from the domain of the variable.voidsetValue(long[] values) This method intersects the current domain with the values in the array.longsize()This method returns the number of values in the domain of the variable.static longswigRelease(IntVar obj) longvalue()This method returns the value of the variable.var()Creates a variable from the expression.intvarType()voidThis method attaches a demon that will be awakened when the
 variable is bound.voidThis method attaches a closure that will be awakened when the
 variable is bound.voidwhenDomain(Demon d) This method attaches a demon that will watch any domain
 modification of the domain of the variable.voidwhenDomain(Runnable closure) This method attaches a closure that will watch any domain
 modification of the domain of the variable.Methods inherited from class com.google.ortools.constraintsolver.IntExprbound, getCPtr, max, min, range, setMax, setMin, setRange, setValue, swigRelease, varWithName, whenRange, whenRangeMethods inherited from class com.google.ortools.constraintsolver.PropagationBaseObjectbaseName, 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.BaseObjectgetCPtr, swigRelease
- 
Constructor Details- 
IntVarpublic IntVar(long cPtr, boolean cMemoryOwn) 
 
- 
- 
Method Details- 
getCPtr
- 
swigRelease
- 
finalize
- 
delete
- 
isVar
- 
var
- 
valuepublic long value()This method returns the value of the variable. This method checks
 before that the variable is bound.
- 
removeValuepublic void removeValue(long v) This method removes the value 'v' from the domain of the variable.
- 
removeIntervalpublic void removeInterval(long l, long u) This method removes the interval 'l' .. 'u' from the domain of
 the variable. It assumes that 'l' <= 'u'.
- 
removeValuespublic void removeValues(long[] values) This method remove the values from the domain of the variable.
- 
setValuepublic void setValue(long[] values) This method intersects the current domain with the values in the array.
- 
whenBoundThis method attaches a demon that will be awakened when the
 variable is bound.
- 
whenBoundThis method attaches a closure that will be awakened when the
 variable is bound.
- 
whenDomainThis method attaches a demon that will watch any domain
 modification of the domain of the variable.
- 
whenDomainThis method attaches a closure that will watch any domain
 modification of the domain of the variable.
- 
sizepublic long size()This method returns the number of values in the domain of the variable.
- 
containspublic boolean contains(long v) This method returns whether the value 'v' is in the domain of the
 variable.
- 
makeHoleIteratorCreates a hole iterator. When 'reversible' is false, the returned
 object is created on the normal C++ heap and the solver does NOT
 take ownership of the object.
- 
makeDomainIteratorCreates a domain iterator. When 'reversible' is false, the
 returned object is created on the normal C++ heap and the solver
 does NOT take ownership of the object.
- 
oldMinpublic long oldMin()Returns the previous min.
- 
oldMaxpublic long oldMax()Returns the previous max.
- 
varTypepublic int varType()
- 
acceptAccepts the given visitor.
- 
isEqualIsEqual
- 
isDifferent
- 
isGreaterOrEqual
- 
isLessOrEqual
- 
indexpublic int index()Returns the index of the variable.
 
-