Class Divide

java.lang.Object
org.projog.clp.math.Divide
All Implemented Interfaces:
Expression

public final class Divide extends Object implements Expression
The result of dividing one Expression by another.
  • Field Details

    • left

      private final Expression left
      The dividend. What is being divided.
  • Constructor Details

  • Method Details

    • getMin

      public long getMin(ReadConstraintStore s)
      Specified by:
      getMin in interface Expression
    • getMax

      public long getMax(ReadConstraintStore s)
      Specified by:
      getMax in interface Expression
    • setMin

      public ExpressionResult setMin(ConstraintStore s, long min)
      Specified by:
      setMin in interface Expression
    • setMax

      public ExpressionResult setMax(ConstraintStore s, long max)
      Specified by:
      setMax in interface Expression
    • 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

      public void walk(Consumer<Expression> r)
      Description copied from interface: Expression
      Traverse this expression.

      If this expression is a composite then all its sub-expressions will be traversed.

      Specified by:
      walk in interface Expression
      Parameters:
      r - will be called for each Expression contained within this Expression.
    • replace

      Description copied from interface: Expression
      Returns a Expression with LeafExpressions in this Expression replaced with values returned from the given function.
      Specified by:
      replace in interface Expression
      Parameters:
      r - returns the LeafExpression to use as a replacement for the LeafExpression it is called with, or null if the original LeafExpression should continue to be used.
      Returns:
      a new Expression with LeafExpressions in this Expression replaced with versions returned from function.
    • toString

      public String toString()
      Overrides:
      toString in class Object