com.icl.saxon.pattern

Class NameTest

public class NameTest extends NodeTest

NodeTest is an interface that enables a test of whether a node has a particular name and type. A NameTest matches the node type and the namespace URI and the local name.

Author: Michael H. Kay

Constructor Summary
NameTest(short nodeType, int nameCode)
NameTest(NodeInfo node)
Create a NameTest for nodes of the same type and name as a given node
Method Summary
doublegetDefaultPriority()
Determine the default priority of this node test when used on its own as a Pattern
intgetFingerprint()
Get the fingerprint required
shortgetNodeType()
Determine the types of nodes to which this pattern applies.
booleanmatches(NodeInfo node)
Test whether this node test is satisfied by a given node
booleanmatches(short nodeType, int nameCode)
Test whether this node test is satisfied by a given node

Constructor Detail

NameTest

public NameTest(short nodeType, int nameCode)

NameTest

public NameTest(NodeInfo node)
Create a NameTest for nodes of the same type and name as a given node

Method Detail

getDefaultPriority

public final double getDefaultPriority()
Determine the default priority of this node test when used on its own as a Pattern

getFingerprint

public int getFingerprint()
Get the fingerprint required

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 NodeInfo.NODE

Returns: the type of node matched by this pattern. e.g. NodeInfo.ELEMENT or NodeInfo.TEXT

matches

public final boolean matches(NodeInfo node)
Test whether this node test is satisfied by a given node

matches

public boolean matches(short nodeType, int nameCode)
Test whether this node test is satisfied by a given node

Parameters: nodeType The type of node to be matched fingerprint identifies the expanded name of the node to be matched