Package com.icl.saxon.pattern
Class UnionPattern
java.lang.Object
com.icl.saxon.pattern.Pattern
com.icl.saxon.pattern.UnionPattern
A pattern formed as the union (or) of two other patterns
-
Field Summary
FieldsFields inherited from class com.icl.saxon.pattern.Pattern
originalText, staticContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLHS()
Get the LHS of the unionshort
Determine the types of nodes to which this pattern applies.getRHS()
Get the RHS of the unionboolean
Determine if the supplied node matches the patternvoid
setOriginalText
(String pattern) Set the original textsimplify()
Simplify the pattern: perform any context-independent optimisationsMethods inherited from class com.icl.saxon.pattern.Pattern
getDefaultPriority, getFingerprint, getLineNumber, getStaticContext, getSystemId, make, setStaticContext, toString
-
Field Details
-
p1
-
p2
-
-
Constructor Details
-
UnionPattern
Constructor- Parameters:
p1
- the left-hand operandp2
- the right-hand operand
-
-
Method Details
-
simplify
Simplify the pattern: perform any context-independent optimisations- Overrides:
simplify
in classPattern
- Returns:
- the optimised Pattern
- Throws:
XPathException
-
setOriginalText
Set the original text- Overrides:
setOriginalText
in classPattern
-
matches
Determine if the supplied node matches the pattern- Specified by:
matches
in classPattern
- Parameters:
e
- The NodeInfo representing the Element or other node to be tested against the Patternc
- The context in which the match is to take place. Only relevant if the pattern uses variables.- Returns:
- true if the node matches either of the operand patterns
- Throws:
XPathException
-
getNodeType
public short getNodeType()Determine the types of nodes to which this pattern applies. Used for optimisation. For patterns that match nodes of several types, return Node.NODE- Overrides:
getNodeType
in classPattern
- Returns:
- the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
-
getLHS
Get the LHS of the union -
getRHS
Get the RHS of the union
-