01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.ejb.query;
12:
13: /**
14: * NULL or IS NOT NULL.
15: */
16: public class NullCompNode extends Node {
17:
18: private Node arg;
19: private boolean not;
20:
21: public NullCompNode(Node arg, boolean not) {
22: this .arg = arg;
23: this .not = not;
24: }
25:
26: public Node getArg() {
27: return arg;
28: }
29:
30: public boolean isNot() {
31: return not;
32: }
33:
34: public Object arrive(NodeVisitor v, Object msg) {
35: return v.arriveNullCompNode(this , msg);
36: }
37:
38: public String toStringImp() {
39: StringBuffer s = new StringBuffer();
40: s.append(arg);
41: s.append(not ? " IS NOT NULL" : " IS NULL");
42: return s.toString();
43: }
44:
45: public void resolve(ResolveContext rc) {
46: arg.resolve(rc);
47: }
48:
49: }
|