Class UnionContext

All Implemented Interfaces:
Iterator, ExpressionContext

public class UnionContext extends NodeSetContext
EvalContext that represents a union between other contexts - result of a union operation like (a | b)
  • Constructor Details

    • UnionContext

      public UnionContext(EvalContext parentContext, EvalContext[] contexts)
      Constructs a new UnionContext.
      Parameters:
      parentContext - parent context
      contexts - child contexts
  • Method Details

    • getDocumentOrder

      public int getDocumentOrder()
      Description copied from class: EvalContext
      Determines the document order for this context.
      Overrides:
      getDocumentOrder in class EvalContext
      Returns:
      1 ascending order, -1 descending order, 0 - does not require ordering
    • setPosition

      public boolean setPosition(int position)
      Description copied from class: EvalContext
      Moves the current position to the specified index. Used with integer predicates to quickly get to the n'th element of the node set. Returns false if the position is out of the node set range. You can call it with 0 as the position argument to restart the iteration.
      Overrides:
      setPosition in class NodeSetContext
      Parameters:
      position - to set
      Returns:
      boolean