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: * BETWEEN.
15: */
16: public class BetweenNode extends Node {
17:
18: private Node arg;
19: private boolean not;
20: private Node from;
21: private Node to;
22:
23: public BetweenNode(Node arg, boolean not, Node from, Node to) {
24: this .arg = arg;
25: this .not = not;
26: this .from = from;
27: this .to = to;
28: }
29:
30: public Node getArg() {
31: return arg;
32: }
33:
34: public boolean isNot() {
35: return not;
36: }
37:
38: public Node getFrom() {
39: return from;
40: }
41:
42: public Node getTo() {
43: return to;
44: }
45:
46: public Object arrive(NodeVisitor v, Object msg) {
47: return v.arriveBetweenNode(this , msg);
48: }
49:
50: public String toStringImp() {
51: StringBuffer s = new StringBuffer();
52: s.append(arg);
53: if (not) {
54: s.append(" NOT");
55: }
56: s.append(" BETWEEN ");
57: s.append(from);
58: s.append(" AND ");
59: s.append(to);
60: return s.toString();
61: }
62:
63: public void resolve(ResolveContext rc) {
64: arg.resolve(rc);
65: from.resolve(rc);
66: to.resolve(rc);
67: }
68:
69: }
|