KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > query > ParamNodeProxy


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo.query;
13
14 import com.versant.core.metadata.ClassMetaData;
15
16 /**
17  * This is created for repeat usages of a parameter in an expression. It
18  * delegates method calls back to the original ParamNode.
19  */

20 public class ParamNodeProxy extends LeafNode {
21
22     private ParamNode paramNode;
23
24     public ParamNodeProxy(ParamNode p) {
25         this.paramNode = p;
26     }
27
28     public Object JavaDoc accept(NodeVisitor visitor, Object JavaDoc[] results) {
29       return visitor.visitParamNode(this.paramNode, results);
30     }
31
32     public ParamNode getParamNode() {
33         return paramNode;
34     }
35
36     public String JavaDoc toString() {
37         return super.toString() + " for " + paramNode;
38     }
39
40     public Field visit(MemVisitor visitor, Object JavaDoc obj) {
41         return visitor.visitParamNodeProxy(this, obj);
42     }
43
44     public String JavaDoc getType() {
45         return paramNode.getType();
46     }
47
48     public String JavaDoc getIdentifier() {
49         return paramNode.getIdentifier();
50     }
51
52     public Class JavaDoc getCls() {
53         return paramNode.getCls();
54     }
55
56     public ClassMetaData getCmd() {
57         return paramNode.getCmd();
58     }
59
60     public Object JavaDoc getValue() {
61         return paramNode.getValue();
62     }
63
64     public int getIndex() {
65         return paramNode.getIndex();
66     }
67
68     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
69         return v.arriveParamNodeProxy(this, msg);
70     }
71
72 }
73
74
Popular Tags