Package org.projog.clp.math
Class Add
- java.lang.Object
-
- org.projog.clp.math.Add
-
- All Implemented Interfaces:
Expression
public final class Add extends java.lang.Object implements Expression
The sum of twoExpressions.
-
-
Field Summary
Fields Modifier and Type Field Description private Expressionleftprivate Expressionright
-
Constructor Summary
Constructors Constructor Description Add(Expression left, Expression right)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetMax(ReadConstraintStore s)longgetMin(ReadConstraintStore s)Addreplace(java.util.function.Function<LeafExpression,LeafExpression> r)Returns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.ExpressionResultsetMax(ConstraintStore s, long max)ExpressionResultsetMin(ConstraintStore s, long min)java.lang.StringtoString()voidwalk(java.util.function.Consumer<Expression> r)Traverse this expression.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.projog.clp.Expression
setNot
-
-
-
-
Field Detail
-
left
private final Expression left
-
right
private final Expression right
-
-
Constructor Detail
-
Add
public Add(Expression left, Expression right)
-
-
Method Detail
-
getMin
public long getMin(ReadConstraintStore s)
- Specified by:
getMinin interfaceExpression
-
getMax
public long getMax(ReadConstraintStore s)
- Specified by:
getMaxin interfaceExpression
-
setMin
public ExpressionResult setMin(ConstraintStore s, long min)
- Specified by:
setMinin interfaceExpression
-
setMax
public ExpressionResult setMax(ConstraintStore s, long max)
- Specified by:
setMaxin interfaceExpression
-
walk
public void walk(java.util.function.Consumer<Expression> r)
Description copied from interface:ExpressionTraverse this expression.If this expression is a composite then all its sub-expressions will be traversed.
- Specified by:
walkin interfaceExpression- Parameters:
r- will be called for eachExpressioncontained within thisExpression.
-
replace
public Add replace(java.util.function.Function<LeafExpression,LeafExpression> r)
Description copied from interface:ExpressionReturns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.- 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
ExpressionwithLeafExpressions in thisExpressionreplaced with versions returned fromfunction.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-