Class CoreOperationRelationalExpression

    • Constructor Detail

      • CoreOperationRelationalExpression

        protected CoreOperationRelationalExpression​(Expression[] args)
        Create a new CoreOperationRelationalExpression.
        Parameters:
        args - arguments
    • Method Detail

      • computeValue

        public final java.lang.Object computeValue​(EvalContext context)
        Description copied from class: Expression
        Evaluates the expression. If the result is a node set, returns the first element of the node set.
        Specified by:
        computeValue in class CoreOperation
        Parameters:
        context - evaluation context
        Returns:
        Object
      • getPrecedence

        protected final int getPrecedence()
        Description copied from class: CoreOperation
        Computes the precedence of the operation.
        Specified by:
        getPrecedence in class CoreOperation
        Returns:
        int precedence
      • isSymmetric

        protected final boolean isSymmetric()
        Description copied from class: CoreOperation
        Returns true if the operation is not sensitive to the order of arguments, e.g. "=", "and" etc, and false if it is, e.g. "<=", "div".
        Specified by:
        isSymmetric in class CoreOperation
        Returns:
        boolean
      • evaluateCompare

        protected abstract boolean evaluateCompare​(int compare)
        Template method for subclasses to evaluate the result of a comparison.
        Parameters:
        compare - result of comparison to evaluate
        Returns:
        ultimate operation success/failure
      • compute

        private boolean compute​(java.lang.Object left,
                                java.lang.Object right)
        Compare left to right.
        Parameters:
        left - left operand
        right - right operand
        Returns:
        operation success/failure
      • reduce

        private java.lang.Object reduce​(java.lang.Object o)
        Reduce an operand for comparison.
        Parameters:
        o - Object to reduce
        Returns:
        reduced operand
      • containsMatch

        private boolean containsMatch​(java.util.Iterator it,
                                      java.lang.Object value)
        Learn whether any element returned from an Iterator matches a given value.
        Parameters:
        it - Iterator
        value - to look for
        Returns:
        whether a match was found
      • findMatch

        private boolean findMatch​(java.util.Iterator lit,
                                  java.util.Iterator rit)
        Learn whether there is an intersection between two Iterators.
        Parameters:
        lit - left Iterator
        rit - right Iterator
        Returns:
        whether a match was found