Class LessThan

  • All Implemented Interfaces:
    Constraint, Expression

    public final class LessThan
    extends java.lang.Object
    implements Constraint
    Enforces that the value of one Expression is less than another.
    • Constructor Detail

      • LessThan

        public LessThan​(Expression left,
                        Expression right)
        Enforces that the value of left is less than the value of right.
        Parameters:
        left - the expression whose value must be less than right
        right - the expression whose value must be greater than left
    • Method Detail

      • walk

        public void walk​(java.util.function.Consumer<Expression> r)
        Description copied from interface: Constraint
        Traverse this constraint.
        Specified by:
        walk in interface Constraint
        Specified by:
        walk in interface Expression
        Parameters:
        r - will be called for each Expression contained within this Constraint.
      • replace

        public LessThan replace​(java.util.function.Function<LeafExpression,​LeafExpression> r)
        Description copied from interface: Constraint
        Returns new Constraint with LeafExpressions in this Constraint replaced with values returned from the given function.
        Specified by:
        replace in interface Constraint
        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 Constraint with LeafExpressions in this Constraint replaced with versions returned from function.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object