Class CoreOperationCompare

Direct Known Subclasses:
CoreOperationEqual, CoreOperationNotEqual

public abstract class CoreOperationCompare extends CoreOperation
Common superclass for the implementations of Expression for the operations "=" and "!=".
  • Constructor Details Link icon

    • CoreOperationCompare Link icon

      Constructs a new CoreOperationCompare.
      Parameters:
      arg1 - left operand
      arg2 - right operand
    • CoreOperationCompare Link icon

      protected CoreOperationCompare(Expression arg1, Expression arg2, boolean invert)
      Constructs a new CoreOperationCompare.
      Parameters:
      arg1 - left operand
      arg2 - right operand
      invert - whether to invert (not) the comparison
  • Method Details Link icon

    • computeValue Link icon

      public 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
    • contains Link icon

      protected boolean contains(Iterator it, Object value)
      Tests whether it contains value.
      Parameters:
      it - Iterator to check
      value - for which to look
      Returns:
      whether value was found
    • equal Link icon

      protected boolean equal(EvalContext context, Expression left, Expression right)
      Compares two values.
      Parameters:
      context - evaluation context
      left - operand
      right - operand
      Returns:
      whether left = right in XPath terms
    • equal Link icon

      protected boolean equal(Object l, Object r)
      Tests whether l equals r in XPath terms.
      Parameters:
      l - left operand
      r - right operand
      Returns:
      whether l = r
    • findMatch Link icon

      protected boolean findMatch(Iterator lit, Iterator rit)
      Tests whether lit intersects rit.
      Parameters:
      lit - left Iterator
      rit - right Iterator
      Returns:
      boolean
    • getPrecedence Link icon

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

      protected 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