net.sf.saxon.pattern
public class NodeTestPattern extends Pattern
Constructor Summary | |
---|---|
NodeTestPattern() | |
NodeTestPattern(NodeTest test) |
Method Summary | |
---|---|
boolean | equals(Object other)
Determine whether this pattern is the same as another pattern |
double | getDefaultPriority()
Determine the default priority of this node test when used on its own as a Pattern |
int | getFingerprint()
Determine the name fingerprint of nodes to which this pattern applies. |
int | getNodeKind()
Determine the types of nodes to which this pattern applies. |
NodeTest | getNodeTest()
Get a NodeTest that all the nodes matching this pattern must satisfy |
int | hashCode()
Hashcode supporting equals() |
boolean | matches(NodeInfo node, XPathContext context)
Determine whether this Pattern matches the given Node. |
void | setNodeTest(NodeTest test) |
String | toString()
Display the pattern for diagnostics |
Parameters: other the other object
Returns: A fingerprint that the nodes must match, or -1 if it can match multiple fingerprints
Returns: the type of node matched by this pattern. e.g. Type.ELEMENT or Type.TEXT
Parameters: node The NodeInfo representing the Element or other node to be tested against the Pattern context The context in which the match is to take place. Only relevant if the pattern uses variables, or contains calls on functions such as document() or key(). Not used (and can be set to null) in the case of patterns that are NodeTests
Returns: true if the node matches the Pattern, false otherwise