01: /*
02: * Copyright (C) 1999-2004 <a href="mailto:mandarax@jbdietrich.com">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package org.mandarax.jdbc.server.sql;
20:
21: /**
22: * Represents an untyped null value. Singleton class.
23: * @author <A HREF="mailto:mandarax@jbdietrich.com">Jens Dietrich</A>
24: * @version 3.3.2 <29 December 2004>
25: * @since 3.0
26: */
27:
28: public class Null extends ColumnTerm {
29:
30: public static Null NULL = new Null();
31:
32: /**
33: * Constructor.
34: * @param stringValue the value as string
35: */
36: private Null() {
37: super ();
38: }
39:
40: /**
41: * Compares objects.
42: * @param obj another object.
43: * @return a boolean
44: */
45: public boolean sameAs(Object obj) {
46: return obj == NULL;
47: }
48:
49: /**
50: * Gather the host variables.
51: * @param variables the list used to collect the variables
52: */
53: public void prepare(java.util.List variables) {
54: // nothing to do here
55: }
56:
57: /**
58: * Print the object on a buffer in order to display the parsed SQL.
59: * @param out a string bufer to print on
60: */
61: public void print(StringBuffer out) {
62: out.append("null");
63: }
64: }
|