KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > pattern > NoNodeTest


1 package com.icl.saxon.pattern;
2 import com.icl.saxon.om.NodeInfo;
3 import com.icl.saxon.expr.XPathException;
4
5 /**
6   * NodeTest is an interface that enables a test of whether a node has a particular
7   * name and type. A NoNodeTest matches no nodes.
8   *
9   * @author <A HREF="mailto:mhkay@iclway.co.uk>Michael H. Kay</A>
10   */

11
12 public final class NoNodeTest extends NodeTest {
13     
14     private static NoNodeTest instance = new NoNodeTest();
15
16     /**
17     * Get a NoNodeTest instance
18     */

19     
20     public static NoNodeTest getInstance() {
21         return instance;
22     }
23
24     public final short getNodeType() {
25         return NodeInfo.NONE;
26     }
27
28     /**
29     * Test whether this node test is satisfied by a given node
30     */

31
32     public final boolean matches(NodeInfo node) {
33         return false;
34     }
35
36     /**
37     * Test whether this node test is satisfied by a given node
38     * @param nodeType The type of node to be matched
39     * @param fingerprint identifies the expanded name of the node to be matched
40     */

41
42     public boolean matches(short nodeType, int fingerprint) {
43         return false;
44     }
45
46     /**
47     * Determine the default priority of this node test when used on its own as a Pattern
48     */

49
50     public final double getDefaultPriority() {
51         return -0.5;
52     }
53
54 }
55
56 //
57
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
58
// you may not use this file except in compliance with the License. You may obtain a copy of the
59
// License at http://www.mozilla.org/MPL/
60
//
61
// Software distributed under the License is distributed on an "AS IS" basis,
62
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
63
// See the License for the specific language governing rights and limitations under the License.
64
//
65
// The Original Code is: all this file.
66
//
67
// The Initial Developer of the Original Code is
68
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
69
//
70
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
71
//
72
// Contributor(s): none.
73
//
74
Popular Tags