net.sf.saxon.pattern
public class UnionPattern extends Pattern
Field Summary | |
---|---|
protected Pattern | p1 |
protected Pattern | p2 |
Constructor Summary | |
---|---|
UnionPattern(Pattern p1, Pattern p2)
Constructor
|
Method Summary | |
---|---|
int | allocateSlots(StaticContext env, SlotManager slotManager, int nextFree)
Allocate slots to any variables used within the pattern
|
Pattern | analyze(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the pattern.
|
boolean | equals(Object other)
Determine whether this pattern is the same as another pattern |
void | gatherComponentPatterns(Set set)
Gather the component (non-union) patterns of this union pattern |
int | getDependencies()
Get the dependencies of the pattern. |
Pattern | getLHS()
Get the LHS of the union
|
int | getNodeKind()
Determine the types of nodes to which this pattern applies. |
NodeTest | getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy |
Pattern | getRHS()
Get the RHS of the union
|
int | hashCode()
Hashcode supporting equals() |
Iterator | iterateSubExpressions()
Iterate over the subexpressions within this pattern |
boolean | matches(NodeInfo e, XPathContext context)
Determine if the supplied node matches the pattern
|
void | promote(PromotionOffer offer, Expression parent)
Offer promotion for subexpressions within this pattern. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace a subexpression by a replacement subexpression |
void | setExecutable(Executable executable)
Set the executable containing this pattern
|
void | setLineNumber(int lineNumber)
Override method to set the system ID, so it's set on both halves |
void | setOriginalText(String pattern)
Set the original text |
void | setSystemId(String systemId)
Override method to set the system ID, so it's set on both halves |
Pattern | simplify(ExpressionVisitor visitor)
Simplify the pattern: perform any context-independent optimisations
|
Parameters: p1 the left-hand operand p2 the right-hand operand
Parameters: env the static context in the XSLT stylesheet slotManager nextFree the next slot that is free to be allocated @return the next slot that is free to be allocated
Returns: the optimised Pattern
Parameters: other the other object
Parameters: set the set into which the components will be added
Returns: the dependencies, as a bit-significant mask
Returns: the first operand of the union
Returns: the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
Returns: the second operand of the union
Returns: an iterator over the subexpressions.
Parameters: e the node to be compared
Returns: true if the node matches either of the operand patterns
Unlike the corresponding method on Expression, this method does not return anything: it can make internal changes to the pattern, but cannot return a different pattern. Only certain kinds of promotion are applicable within a pattern: specifically, promotions affecting local variable references within the pattern.
Parameters: offer details of the offer, for example the offer to move expressions that don't depend on the context to an outer level in the containing expression parent
Throws: net.sf.saxon.trans.XPathException if any error is detected
Parameters: original the expression to be replaced replacement the new expression to be inserted in its place
Returns: true if the replacement was carried out
Parameters: executable the executable
Parameters: visitor an expression visitor