Package org.projog.clp.compare
Class LessThan
java.lang.Object
org.projog.clp.compare.LessThan
- All Implemented Interfaces:
Constraint,Expression
Enforces that the value of one
Expression is less than another.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLessThan(Expression left, Expression right) Enforces that the value ofleftis less than the value ofright. -
Method Summary
Modifier and TypeMethodDescriptionAttempts to enforce this constraint using the givenConstraintStore.(package private) static ConstraintResultenforce(Expression left, Expression right, ConstraintStore m) prevent(ConstraintStore constraintStore) Attempts to prevent this constraint using the givenConstraintStore.reify(ReadConstraintStore constraintStore) Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.toString()voidwalk(Consumer<Expression> r) Traverse this constraint.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.projog.clp.Constraint
getMax, getMin, setMax, setMinMethods inherited from interface org.projog.clp.Expression
setNot
-
Field Details
-
left
-
right
-
-
Constructor Details
-
LessThan
Enforces that the value ofleftis less than the value ofright.- Parameters:
left- the expression whose value must be less thanrightright- the expression whose value must be greater thanleft
-
-
Method Details
-
enforce
Description copied from interface:ConstraintAttempts to enforce this constraint using the givenConstraintStore.- Specified by:
enforcein interfaceConstraint
-
enforce
-
reify
- Specified by:
reifyin interfaceConstraint
-
prevent
Description copied from interface:ConstraintAttempts to prevent this constraint using the givenConstraintStore.- Specified by:
preventin 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- Parameters:
r- 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
-