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
 
 
 
| Method Summary | 
|  Pattern | getLHS()Get the LHS of the union
 | 
|  Pattern | getRHS()Get the RHS of the union
 | 
|  int | getType()Determine the types of nodes to which this pattern applies.
 | 
|  boolean | isRelative()Determine if the pattern uses positional filters
 | 
|  boolean | matches(NodeInfo e,
        Context c)Determine if the supplied node matches the pattern
 | 
|  Pattern | simplify()Simplify the pattern: perform any context-independent optimisations
 | 
|  java.lang.String | toString()Get a string representation of the pattern
 | 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
p1
protected Pattern p1
p2
protected Pattern p2
UnionPattern
public UnionPattern(Pattern p1,
                    Pattern p2)
- Constructor- 
- Parameters:
- p1- the left-hand operand
- p2- the right-hand operand
 
simplify
public Pattern simplify()
                 throws org.xml.sax.SAXException
- Simplify the pattern: perform any context-independent optimisations- 
- Overrides:
- simplifyin class- Pattern
 
- Following copied from class: com.icl.saxon.pattern.Pattern
- 
- Returns:
- the optimised Pattern
 
matches
public boolean matches(NodeInfo e,
                       Context c)
                throws org.xml.sax.SAXException
- Determine if the supplied node matches the pattern- 
- Overrides:
- matchesin class- Pattern
 
- 
- Returns:
- true if the node matches either of the operand patterns
 
getType
public int getType()
- 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:
- getTypein class- Pattern
 
- 
- Returns:
- the type of node matched by this pattern. e.g. Node.ELEMENT or Node.TEXT
 
toString
public java.lang.String toString()
- Get a string representation of the pattern- 
- Overrides:
- toStringin class- java.lang.Object
 
isRelative
public boolean isRelative()
                   throws org.xml.sax.SAXException
- Determine if the pattern uses positional filters- 
- Overrides:
- isRelativein class- Pattern
 
getLHS
public Pattern getLHS()
- Get the LHS of the union
getRHS
public Pattern getRHS()
- Get the RHS of the union