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: * IS EMPTY and IS NOT EMPTY.
15: */
16: public class EmptyCompNode extends Node {
17:
18: // todo make sure path is PathNode in annotate
19: private Node path;
20: private boolean not;
21:
22: public EmptyCompNode(Node path, boolean not) {
23: this .path = path;
24: this .not = not;
25: }
26:
27: public PathNode getPath() {
28: return (PathNode) path;
29: }
30:
31: public boolean isNot() {
32: return not;
33: }
34:
35: public Object arrive(NodeVisitor v, Object msg) {
36: return v.arriveEmptyCompNode(this , msg);
37: }
38:
39: public String toStringImp() {
40: StringBuffer s = new StringBuffer();
41: s.append(path);
42: s.append(not ? " IS NOT EMPTY" : " IS EMPTY");
43: return s.toString();
44: }
45:
46: public void resolve(ResolveContext rc) {
47: path.resolve(rc);
48: }
49:
50: }
|