Package com.icl.saxon.pattern
Class NodeTypeTest
java.lang.Object
com.icl.saxon.pattern.Pattern
com.icl.saxon.pattern.NodeTest
com.icl.saxon.pattern.NodeTypeTest
NodeTest is an interface that enables a test of whether a node has a particular
name and type. A NodeTypeTest matches the node type only.
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class com.icl.saxon.pattern.Pattern
originalText, staticContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal double
Determine the default priority of this node test when used on its own as a Patternshort
Determine the types of nodes to which this pattern applies.boolean
matches
(short nodeType, int fingerprint) Test whether this node test is satisfied by a given nodefinal boolean
Test whether this node test is satisfied by a given nodeMethods inherited from class com.icl.saxon.pattern.Pattern
getFingerprint, getLineNumber, getStaticContext, getSystemId, make, setOriginalText, setStaticContext, simplify, toString
-
Constructor Details
-
NodeTypeTest
public NodeTypeTest(short nodeType)
-
-
Method Details
-
matches
Test whether this node test is satisfied by a given node -
matches
public boolean matches(short nodeType, int fingerprint) Test whether this node test is satisfied by a given node -
getDefaultPriority
public final double getDefaultPriority()Determine the default priority of this node test when used on its own as a Pattern- Overrides:
getDefaultPriority
in classPattern
-
getNodeType
public short getNodeType()Determine the types of nodes to which this pattern applies. Used for optimisation.- Overrides:
getNodeType
in classPattern
- Returns:
- the type of node matched by this pattern. e.g. NodeInfo.ELEMENT or NodeInfo.TEXT
-