jd.xml.xpath.axis
Class NodeTestUnion

java.lang.Object
  extended byjd.xml.xpath.axis.NodeTest
      extended byjd.xml.xpath.axis.NodeTestUnion

public class NodeTestUnion
extends NodeTest

A NodeTest implementation which accepts a node if it is accepted by at least one of two NodeTests.


Field Summary
 
Fields inherited from class jd.xml.xpath.axis.NodeTest
EXACT, NO, WILDCARD
 
Constructor Summary
NodeTestUnion(NodeTest test1, NodeTest test2)
           
 
Method Summary
 void accept(NodeTestVisitor visitor)
          Accept a NodeTestVisitor.
 boolean accept(XPathNode node, int principalType)
          Return true if one of the tests accept the node.
 double calculatePriority()
          Throws an InternalError since this class is not used by patterns
 int matchNames()
          Return how the NodeTest accepts regarding their names.
 String toString()
          Return a string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NodeTestUnion

public NodeTestUnion(NodeTest test1,
                     NodeTest test2)
Method Detail

accept

public boolean accept(XPathNode node,
                      int principalType)
Return true if one of the tests accept the node.

Specified by:
accept in class NodeTest
Parameters:
node - the tested node
principalType - the principal node type as determined by the associated axis

calculatePriority

public double calculatePriority()
Throws an InternalError since this class is not used by patterns

Specified by:
calculatePriority in class NodeTest

matchNames

public int matchNames()
Description copied from class: NodeTest
Return how the NodeTest accepts regarding their names.

Specified by:
matchNames in class NodeTest
See Also:
NodeTest.NO, NodeTest.WILDCARD, NodeTest.EXACT

accept

public void accept(NodeTestVisitor visitor)
Accept a NodeTestVisitor.

Specified by:
accept in class NodeTest

toString

public String toString()
Return a string representation.

Specified by:
toString in class NodeTest