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: * ALL ANY SOME.
15: */
16: public class AllOrAnyNode extends Node {
17:
18: private boolean all;
19: private SelectNode subquery;
20:
21: public AllOrAnyNode(boolean all, SelectNode subquery) {
22: this .all = all;
23: this .subquery = subquery;
24: }
25:
26: public boolean isAll() {
27: return all;
28: }
29:
30: public SelectNode getSubquery() {
31: return subquery;
32: }
33:
34: public Object arrive(NodeVisitor v, Object msg) {
35: return v.arriveAllOrAnyNode(this , msg);
36: }
37:
38: public String toStringImp() {
39: StringBuffer s = new StringBuffer();
40: s.append(all ? "ALL (" : "ANY (");
41: s.append(subquery);
42: s.append(')');
43: return s.toString();
44: }
45:
46: public void resolve(ResolveContext rc) {
47: subquery.resolve(rc);
48: }
49:
50: }
|