Class SingletonIntersectExpression

All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator

public class SingletonIntersectExpression extends VennExpression
This expression is equivalent to (A intersect B) in the case where A has cardinality zero-or-one. This is handled as a special case because the standard sort-merge algorithm involves an unnecessary sort on B.
See Also:
  • Constructor Details

    • SingletonIntersectExpression

      public SingletonIntersectExpression(Expression p1, int op, Expression p2)
      Special case of an intersect expression where the first argument is a singleton
      Parameters:
      p1 - the first argument, always a singleton
      op - the operator, always Token.INTERSECT
      p2 - the second argument
  • Method Details

    • copy

      public Expression copy()
      Copy an expression. This makes a deep copy.
      Overrides:
      copy in class VennExpression
      Returns:
      the copy of the original expression
    • iterate

      public SequenceIterator iterate(XPathContext c) throws XPathException
      Iterate over the value of the expression. The result will always be sorted in document order, with duplicates eliminated
      Overrides:
      iterate in class VennExpression
      Parameters:
      c - The context for evaluation
      Returns:
      a SequenceIterator representing the union of the two operands
      Throws:
      XPathException - if any dynamic error occurs evaluating the expression
    • effectiveBooleanValue

      public boolean effectiveBooleanValue(XPathContext c) throws XPathException
      Get the effective boolean value. In the case of a union expression, this is reduced to an OR expression, for efficiency
      Overrides:
      effectiveBooleanValue in class VennExpression
      Parameters:
      c - The context in which the expression is to be evaluated
      Returns:
      the effective boolean value
      Throws:
      XPathException - if any dynamic error occurs evaluating the expression
    • getExpressionName

      public String getExpressionName()
      Description copied from class: VennExpression
      Get a name identifying the kind of expression, in terms meaningful to a user.
      Overrides:
      getExpressionName in class VennExpression
      Returns:
      a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.
    • displayOperator

      protected String displayOperator()
      Display the operator used by this binary expression
      Overrides:
      displayOperator in class BinaryExpression
      Returns:
      String representation of the operator (for diagnostic display only)