net.sf.saxon.pattern
Class UnionPattern
- Container, PatternFinder, Serializable, SourceLocator
public class UnionPattern
A pattern formed as the union (or) of two other patterns
allocateSlots , analyze , getColumnNumber , getDefaultPriority , getDependencies , getExecutable , getFingerprint , getHostLanguage , getLineNumber , getLocationProvider , getNodeKind , getNodeTest , getPublicId , getSystemId , internalMatches , iterateSubExpressions , make , makeSearchExpression , matches , promote , replaceSubExpression , selectNodes , setExecutable , setLineNumber , setOriginalText , setSystemId , simplify , toString |
UnionPattern
public UnionPattern(Pattern p1,
Pattern p2)
Constructor
p1
- the left-hand operandp2
- the right-hand operand
allocateSlots
public int allocateSlots(ExpressionContext env,
int nextFree)
Allocate slots to any variables used within the pattern
- allocateSlots in interface Pattern
env
- the static context in the XSLT stylesheetnextFree
- the next slot that is free to be allocated
- the next slot that is free to be allocated
getDependencies
public int getDependencies()
Get the dependencies of the pattern. The only possible dependency for a pattern is
on local variables. This is analyzed in those patterns where local variables may appear.
- getDependencies in interface Pattern
- the dependencies, as a bit-significant mask
getLHS
public Pattern getLHS()
Get the LHS of the union
getNodeKind
public int getNodeKind()
Determine the types of nodes to which this pattern applies. Used for optimisation.
For patterns that match nodes of several types, return Node.NODE
- getNodeKind in interface Pattern
- the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
getNodeTest
public NodeTest getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy
- getNodeTest in interface Pattern
getRHS
public Pattern getRHS()
Get the RHS of the union
iterateSubExpressions
public Iterator iterateSubExpressions()
Iterate over the subexpressions within this pattern
- iterateSubExpressions in interface Pattern
- an iterator over the subexpressions.
matches
public boolean matches(NodeInfo e,
XPathContext context)
throws XPathException
Determine if the supplied node matches the pattern
- matches in interface Pattern
e
- the node to be compared
- true if the node matches either of the operand patterns
setExecutable
public void setExecutable(Executable executable)
Set the executable containing this pattern
- setExecutable in interface Pattern
executable
- the executable
setLineNumber
public void setLineNumber(int lineNumber)
Override method to set the system ID, so it's set on both halves
- setLineNumber in interface Pattern
setOriginalText
public void setOriginalText(String pattern)
Set the original text
- setOriginalText in interface Pattern
setSystemId
public void setSystemId(String systemId)
Override method to set the system ID, so it's set on both halves
- setSystemId in interface Pattern