net.sf.saxon.pattern
Class CombinedNodeTest
java.lang.Object
net.sf.saxon.pattern.Pattern
net.sf.saxon.pattern.NodeTest
net.sf.saxon.pattern.CombinedNodeTest
- All Implemented Interfaces:
- ItemType, java.io.Serializable
- public class CombinedNodeTest
- extends NodeTest
A CombinedNodeTest combines two nodetests using one of the operators
union (=or), intersect (=and), difference (= "and not"). This arises
when optimizing a union (etc) of two path expressions using the same axis.
A CombinedNodeTest is also used to support constructs such as element(N,T),
which can be expressed as (element(N,*) AND element(*,T))
- Author:
- Serialized Form
Method Summary |
boolean |
allowsTextNodes()
Indicate whether this NodeTest is capable of matching text nodes |
boolean |
matches(int nodeType,
int fingerprint,
int annotation)
Test whether this node test is satisfied by a given node. |
java.lang.String |
toString()
Produce a representation of this type name for use in error messages. |
Methods inherited from class net.sf.saxon.pattern.Pattern |
getDefaultPriority, getFingerprint, getLineNumber, getNodeKind, getSystemId, internalMatches, make, setLineNumber, setOriginalText, setSystemId, simplify, typeCheck |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CombinedNodeTest
public CombinedNodeTest(NodeTest nt1,
int operator,
NodeTest nt2)
matches
public boolean matches(int nodeType,
int fingerprint,
int annotation)
- Test whether this node test is satisfied by a given node.
- Specified by:
matches
in class NodeTest
- Parameters:
nodeType
- The type of node to be matchedfingerprint
- identifies the expanded name of the node to be matched.
The value should be -1 for a node with no name.annotation
- The actual content type of the node
toString
public java.lang.String toString()
- Description copied from interface:
ItemType
- Produce a representation of this type name for use in error messages.
Where this is a QName, it will use conventional prefixes
- Specified by:
toString
in interface ItemType
- Overrides:
toString
in class Pattern
allowsTextNodes
public boolean allowsTextNodes()
- Indicate whether this NodeTest is capable of matching text nodes
- Specified by:
allowsTextNodes
in class NodeTest