Interface Expr

    • Method Detail

      • isSatisfied

        boolean isSatisfied​(Binding binding,
                            FunctionEnv execCxt)
        Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.
        binding - The bindings
        execCxt - FunctionEnv
        true or false
      • copySubstitute

        Expr copySubstitute​(Binding binding)
        Deep copy with substitution
      • applyNodeTransform

        Expr applyNodeTransform​(NodeTransform transform)
        Rewrite, applying a node->node transformation
      • deepCopy

        Expr deepCopy()
        Deep copy
      • isVariable

        boolean isVariable()
        Answer whether this is a variable.
      • getVarName

        java.lang.String getVarName()
        Variable name (returns null if not a variable)
      • getExprVar

        ExprVar getExprVar()
        Variable (or null)
      • asVar

        Var asVar()
        Convert to a Var variable.
      • isConstant

        boolean isConstant()
        Answer whether this is a constant expression - false includes "don't know" No constant folding so "false" from an expression that evaluates to a constant
      • getConstant

        NodeValue getConstant()
        NodeValue constant (returns null if not a constant)
      • isFunction

        boolean isFunction()
        Answer whether this is a function.
      • getFunction

        ExprFunction getFunction()
        Get the function (returns null if not a function)
      • hashCode

        int hashCode()
        Expr are used in both syntax and algebra. There is no syntax to algebra translation step because the parser uses operator precedence to build the right evaluation structure directly.

        The exceptions to this are the NOT EXISTS and EXISTS expressions which involve a query pattern. As a result there are different ways in syntax to produce the same algebra form.

        Two Expr are considered equal if they are equal as algebra expressions. hashCode and equals must implement that.

        There is also equalsBySyntax. Because two different syntax forms can yield the same algebra, but two different algebra forms must be different syntax, equalsBySyntax implies equals (by alegbra).

        Hence, different hashCode => not equalsBySyntax.

        hashCode in class java.lang.Object
      • equals

        boolean equals​(java.lang.Object other)
        equals in class java.lang.Object
      • equalsBySyntax

        boolean equalsBySyntax​(Expr other)
      • equals

        boolean equals​(Expr other,
                       boolean bySyntax)
        General equality operation - consider this to be 'protected'