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: * OR.
15: */
16: public class OrNode extends Node {
17:
18: private Node argsList;
19:
20: public OrNode(Node argsList) {
21: this .argsList = argsList;
22: }
23:
24: public Node getArgsList() {
25: return argsList;
26: }
27:
28: public Object arrive(NodeVisitor v, Object msg) {
29: return v.arriveOrNode(this , msg);
30: }
31:
32: public String toStringImp() {
33: StringBuffer s = new StringBuffer();
34: s.append(argsList);
35: if (argsList != null) {
36: for (Node e = argsList.getNext(); e != null; e = e
37: .getNext()) {
38: s.append(" OR ");
39: s.append(e);
40: }
41: }
42: return s.toString();
43: }
44:
45: public void resolve(ResolveContext rc) {
46: resolve(argsList, rc);
47: }
48:
49: }
|