Class ExprNode

    • Constructor Detail

      • ExprNode

        public ExprNode()
    • Method Detail

      • isSatisfied

        public boolean isSatisfied​(Binding binding,
                                   FunctionEnv funcEnv)
        Description copied from interface: Expr
        Test whether a Constraint is satisfied, given a set of bindings Includes error propagation and Effective Boolean Value rules.
        Specified by:
        isSatisfied in interface Expr
        Parameters:
        binding - The bindings
        funcEnv - FunctionEnv
        Returns:
        true or false
      • isExpr

        public boolean isExpr()
      • getExpr

        public final Expr getExpr()
      • eval

        public abstract NodeValue eval​(Binding binding,
                                       FunctionEnv env)
        Description copied from interface: Expr
        Evaluate this expression against the binding
        Specified by:
        eval in interface Expr
      • hashCode

        public abstract int hashCode()
        Description copied from interface: Expr
        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.

        Specified by:
        hashCode in interface Expr
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object other)
        Specified by:
        equals in interface Expr
        Overrides:
        equals in class java.lang.Object
      • equalsBySyntax

        public final boolean equalsBySyntax​(Expr other)
        Specified by:
        equalsBySyntax in interface Expr
      • equals

        public abstract boolean equals​(Expr other,
                                       boolean bySyntax)
        Description copied from interface: Expr
        General equality operation - consider this to be 'protected'
        Specified by:
        equals in interface Expr
      • deepCopy

        public final Expr deepCopy()
        Description copied from interface: Expr
        Deep copy
        Specified by:
        deepCopy in interface Expr
      • copySubstitute

        public abstract Expr copySubstitute​(Binding binding)
        Description copied from interface: Expr
        Deep copy with substitution
        Specified by:
        copySubstitute in interface Expr
      • applyNodeTransform

        public abstract Expr applyNodeTransform​(NodeTransform transform)
        Description copied from interface: Expr
        Rewrite, applying a node->node transformation
        Specified by:
        applyNodeTransform in interface Expr
      • isVariable

        public boolean isVariable()
        Description copied from interface: Expr
        Answer whether this is a variable.
        Specified by:
        isVariable in interface Expr
      • getVarName

        public java.lang.String getVarName()
        Description copied from interface: Expr
        Variable name (returns null if not a variable)
        Specified by:
        getVarName in interface Expr
      • getExprVar

        public ExprVar getExprVar()
        Description copied from interface: Expr
        Variable (or null)
        Specified by:
        getExprVar in interface Expr
      • asVar

        public Var asVar()
        Description copied from interface: Expr
        Convert to a Var variable.
        Specified by:
        asVar in interface Expr
      • isConstant

        public boolean isConstant()
        Description copied from interface: Expr
        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
        Specified by:
        isConstant in interface Expr
      • getConstant

        public NodeValue getConstant()
        Description copied from interface: Expr
        NodeValue constant (returns null if not a constant)
        Specified by:
        getConstant in interface Expr
      • isFunction

        public boolean isFunction()
        Description copied from interface: Expr
        Answer whether this is a function.
        Specified by:
        isFunction in interface Expr
      • getFunction

        public ExprFunction getFunction()
        Description copied from interface: Expr
        Get the function (returns null if not a function)
        Specified by:
        getFunction in interface Expr
      • isGraphPattern

        public boolean isGraphPattern()
      • getGraphPattern

        public Op getGraphPattern()
      • toString

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