Package com.icl.saxon.pattern
Class UnionPattern
- java.lang.Object
-
- com.icl.saxon.pattern.Pattern
-
- com.icl.saxon.pattern.UnionPattern
-
public class UnionPattern extends Pattern
A pattern formed as the union (or) of two other patterns
-
-
Field Summary
Fields Modifier and Type Field Description protected Patternp1protected Patternp2-
Fields inherited from class com.icl.saxon.pattern.Pattern
originalText, staticContext
-
-
Constructor Summary
Constructors Constructor Description UnionPattern(Pattern p1, Pattern p2)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatterngetLHS()Get the LHS of the unionshortgetNodeType()Determine the types of nodes to which this pattern applies.PatterngetRHS()Get the RHS of the unionbooleanmatches(NodeInfo e, Context c)Determine if the supplied node matches the patternvoidsetOriginalText(java.lang.String pattern)Set the original textPatternsimplify()Simplify the pattern: perform any context-independent optimisations-
Methods inherited from class com.icl.saxon.pattern.Pattern
getDefaultPriority, getFingerprint, getLineNumber, getStaticContext, getSystemId, make, setStaticContext, toString
-
-
-
-
Method Detail
-
simplify
public Pattern simplify() throws XPathException
Simplify the pattern: perform any context-independent optimisations- Overrides:
simplifyin classPattern- Returns:
- the optimised Pattern
- Throws:
XPathException
-
setOriginalText
public void setOriginalText(java.lang.String pattern)
Set the original text- Overrides:
setOriginalTextin classPattern
-
matches
public boolean matches(NodeInfo e, Context c) throws XPathException
Determine if the supplied node matches the pattern- Specified by:
matchesin 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:
getNodeTypein classPattern- Returns:
- the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
-
getLHS
public Pattern getLHS()
Get the LHS of the union
-
getRHS
public Pattern getRHS()
Get the RHS of the union
-
-