Package org.projog.clp.math
Class Divide
java.lang.Object
org.projog.clp.math.Divide
- All Implemented Interfaces:
Expression
The result of dividing one
Expression by another.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExpressionThe dividend.private final ExpressionThe divisor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longcalcLeftMax(long right, long target) private static longcalcRightMax(long left, long target) private static longcalcRightMin(long left, long target) longlongReturns aExpressionwithLeafExpressions in thisExpressionreplaced with values returned from the given function.setMax(ConstraintStore s, long max) setMin(ConstraintStore s, long min) toString()voidwalk(Consumer<Expression> r) Traverse this expression.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.projog.clp.Expression
setNot
-
Field Details
-
left
The dividend. What is being divided. -
right
The divisor. What the divided is being divided by.
-
-
Constructor Details
-
Divide
-
-
Method Details
-
getMin
- Specified by:
getMinin interfaceExpression
-
getMax
- Specified by:
getMaxin interfaceExpression
-
setMin
- Specified by:
setMinin interfaceExpression
-
setMax
- Specified by:
setMaxin interfaceExpression
-
calcLeftMax
private static long calcLeftMax(long right, long target) -
calcRightMin
private static long calcRightMin(long left, long target) -
calcRightMax
private static long calcRightMax(long left, long target) -
walk
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
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
-