Package org.projog.clp.compare
Class LessThanOrEqualTo
- java.lang.Object
-
- org.projog.clp.compare.LessThanOrEqualTo
-
- All Implemented Interfaces:
Constraint,Expression
public final class LessThanOrEqualTo extends java.lang.Object implements Constraint
Enforces that the value of oneExpressionis less than or equal to another.
-
-
Field Summary
Fields Modifier and Type Field Description private Expressionleftprivate Expressionright
-
Constructor Summary
Constructors Constructor Description LessThanOrEqualTo(Expression left, Expression right)Enforces that the value ofleftis less than or equal to the value ofright.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConstraintResultenforce(ConstraintStore m)Attempts to enforce this constraint using the givenConstraintStore.(package private) static ConstraintResultenforce(Expression left, Expression right, ConstraintStore m)ConstraintResultprevent(ConstraintStore constraintStore)Attempts to prevent this constraint using the givenConstraintStore.ConstraintResultreify(ReadConstraintStore constraintStore)LessThanOrEqualToreplace(java.util.function.Function<LeafExpression,LeafExpression> r)Returns newConstraintwithLeafExpressions in thisConstraintreplaced with values returned from the given function.java.lang.StringtoString()voidwalk(java.util.function.Consumer<Expression> r)Traverse this constraint.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.projog.clp.Constraint
getMax, getMin, setMax, setMin
-
Methods inherited from interface org.projog.clp.Expression
setNot
-
-
-
-
Field Detail
-
left
private final Expression left
-
right
private final Expression right
-
-
Constructor Detail
-
LessThanOrEqualTo
public LessThanOrEqualTo(Expression left, Expression right)
Enforces that the value ofleftis less than or equal to the value ofright.- Parameters:
left- the expression whose value must be less than or equal torightright- the expression whose value must be greater than or equal toleft
-
-
Method Detail
-
enforce
public ConstraintResult enforce(ConstraintStore m)
Description copied from interface:ConstraintAttempts to enforce this constraint using the givenConstraintStore.- Specified by:
enforcein interfaceConstraint
-
enforce
static ConstraintResult enforce(Expression left, Expression right, ConstraintStore m)
-
reify
public ConstraintResult reify(ReadConstraintStore constraintStore)
- Specified by:
reifyin interfaceConstraint
-
prevent
public ConstraintResult prevent(ConstraintStore constraintStore)
Description copied from interface:ConstraintAttempts to prevent this constraint using the givenConstraintStore.- Specified by:
preventin interfaceConstraint
-
walk
public void walk(java.util.function.Consumer<Expression> r)
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
public LessThanOrEqualTo replace(java.util.function.Function<LeafExpression,LeafExpression> r)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-