01: /*
02: * (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: * [see end of file]
04: */
05:
06: package com.hp.hpl.jena.graph;
07:
08: import com.hp.hpl.jena.shared.PrefixMapping;
09:
10: /**
11: A Node_ANY (there should be only one) is a meta-node that is used to stand
12: for any other node in a query.
13: @author kers
14: */
15:
16: public class Node_ANY extends Node_Fluid {
17: /* package */Node_ANY() {
18: super ("");
19: }
20:
21: /** Node_ANY's are only equal to other Node_ANY's */
22: public boolean equals(Object other) {
23: return other instanceof Node_ANY;
24: }
25:
26: public Object visitWith(NodeVisitor v) {
27: return v.visitAny(this );
28: }
29:
30: public boolean matches(Node other) {
31: return other != null;
32: }
33:
34: public String toString() {
35: return "ANY";
36: }
37:
38: public String toString(PrefixMapping pm, boolean quoting) {
39: return "ANY";
40: }
41: }
42:
43: /*
44: * (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
45: * All rights reserved.
46: *
47: * Redistribution and use in source and binary forms, with or without
48: * modification, are permitted provided that the following conditions
49: * are met:
50: * 1. Redistributions of source code must retain the above copyright
51: * notice, this list of conditions and the following disclaimer.
52: * 2. Redistributions in binary form must reproduce the above copyright
53: * notice, this list of conditions and the following disclaimer in the
54: * documentation and/or other materials provided with the distribution.
55: * 3. The name of the author may not be used to endorse or promote products
56: * derived from this software without specific prior written permission.
57: *
58: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
59: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
60: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
61: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
62: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
63: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
64: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
65: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
66: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
67: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68: */
|