Package org.projog.clp
Class Variable
java.lang.Object
org.projog.clp.Variable
- All Implemented Interfaces:
Constraint,Expression,LeafExpression
An expression that can have one or more possible numeric values.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempts to enforce this constraint using the givenConstraintStore.(package private) intgetId()longlongAttempts to prevent this constraint using the givenConstraintStore.replace(Function<LeafExpression, LeafExpression> function) Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.setMax(ConstraintStore s, long max) setMin(ConstraintStore s, long min) setNot(ConstraintStore s, long not) setValue(ConstraintStore s, long value) toString()voidwalk(Consumer<Expression> r) Traverse this constraint.
-
Field Details
-
TRUE
private static final int TRUE- See Also:
-
FALSE
private static final int FALSE- See Also:
-
id
private final int id
-
-
Constructor Details
-
Variable
Variable(int id) - See Also:
-
-
Method Details
-
getId
int getId() -
getMin
- Specified by:
getMinin interfaceConstraint- Specified by:
getMinin interfaceExpression
-
getMax
- Specified by:
getMaxin interfaceConstraint- Specified by:
getMaxin interfaceExpression
-
setValue
-
setNot
- Specified by:
setNotin interfaceExpression
-
setMin
- Specified by:
setMinin interfaceConstraint- Specified by:
setMinin interfaceExpression
-
setMax
- Specified by:
setMaxin interfaceConstraint- Specified by:
setMaxin interfaceExpression
-
enforce
Description copied from interface:ConstraintAttempts to enforce this constraint using the givenConstraintStore.- Specified by:
enforcein interfaceConstraint
-
prevent
Description copied from interface:ConstraintAttempts to prevent this constraint using the givenConstraintStore.- Specified by:
preventin interfaceConstraint
-
reify
- Specified by:
reifyin interfaceConstraint
-
walk
Description copied from interface:ConstraintTraverse this constraint.- Specified by:
walkin interfaceConstraint- Specified by:
walkin interfaceExpression- Parameters:
r- will be called for eachExpressioncontained within thisConstraint.
-
replace
Description copied from interface:ConstraintReturns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.- Specified by:
replacein interfaceConstraint- Specified by:
replacein interfaceExpression- Specified by:
replacein interfaceLeafExpression- Parameters:
function- returns theLeafExpressionto use as a replacement for theLeafExpressionit is called with, ornullif the originalLeafExpressionshould continue to be used.- Returns:
- a new
ConstraintwithLeafExpressions in thisConstraintreplaced with versions returned fromfunction.
-
toString
-