Package org.projog.clp.math
Class Multiply
- java.lang.Object
-
- org.projog.clp.math.Multiply
-
- All Implemented Interfaces:
Expression
public final class Multiply extends java.lang.Object implements Expression
The product of twoExpressions.
-
-
Field Summary
Fields Modifier and Type Field Description private Expressionleftprivate Expressionright
-
Constructor Summary
Constructors Constructor Description Multiply(Expression left, Expression right)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static longdivideRoundDown(long dividend, long divisor)private static longdivideWhole(long dividend, long divisor)longgetMax(ReadConstraintStore s)longgetMin(ReadConstraintStore s)Multiplyreplace(java.util.function.Function<LeafExpression,LeafExpression> r)Returns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.ExpressionResultsetMax(ConstraintStore s, long max)private static ExpressionResultsetMax(ConstraintStore s, Expression left, long max, long leftMax, long rightMin, long rightMax, java.util.function.BiFunction<java.lang.Long,java.lang.Long,java.lang.Long> f)ExpressionResultsetMin(ConstraintStore s, long min)private static ExpressionResultsetMin(ConstraintStore s, Expression left, long min, long leftMin, long rightMin, long rightMax, java.util.function.BiFunction<java.lang.Long,java.lang.Long,java.lang.Long> f)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
-
Multiply
public Multiply(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
-
setMax
private static ExpressionResult setMax(ConstraintStore s, Expression left, long max, long leftMax, long rightMin, long rightMax, java.util.function.BiFunction<java.lang.Long,java.lang.Long,java.lang.Long> f)
-
setMin
private static ExpressionResult setMin(ConstraintStore s, Expression left, long min, long leftMin, long rightMin, long rightMax, java.util.function.BiFunction<java.lang.Long,java.lang.Long,java.lang.Long> f)
-
divideRoundDown
private static long divideRoundDown(long dividend, long divisor)
-
divideWhole
private static long divideWhole(long dividend, long divisor)
-
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 Multiply 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
-
-