net.sf.saxon.pattern
Class CombinedNodeTest

java.lang.Object
  extended bynet.sf.saxon.pattern.Pattern
      extended bynet.sf.saxon.pattern.NodeTest
          extended bynet.sf.saxon.pattern.CombinedNodeTest
All Implemented Interfaces:
ItemType, 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

Field Summary
 
Fields inherited from class net.sf.saxon.pattern.Pattern
originalText
 
Constructor Summary
CombinedNodeTest(NodeTest nt1, int operator, NodeTest nt2)
           
 
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.
 String toString()
          Produce a representation of this type name for use in error messages.
 
Methods inherited from class net.sf.saxon.pattern.NodeTest
getNodeTest, getPrimitiveType, getSuperType, isSameType, matches, matchesItem
 
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
 

Constructor Detail

CombinedNodeTest

public CombinedNodeTest(NodeTest nt1,
                        int operator,
                        NodeTest nt2)
Method Detail

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 matched
fingerprint - 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 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