Class Divide

  • All Implemented Interfaces:
    Expression

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

      • left

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

        private final Expression right
        The divisor. What the divided is being divided by.
    • Method Detail

      • 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​(java.util.function.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

        public Divide replace​(java.util.function.Function<LeafExpression,​LeafExpression> r)
        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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object