KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
15  * This is created for repeat usages of a variable in an expression. It
16  * delegates method calls back to the original VarNode.
17  */

18 public class VarNodeProxy extends LeafNode implements VarNodeIF {
19
20     private VarNode varNode;
21
22     public VarNodeProxy(VarNode v) {
23         this.varNode = v;
24     }
25
26     public Object JavaDoc accept(NodeVisitor visitor, Object JavaDoc[] results) {
27       return visitor.visitVarNode(this.varNode, results);
28     }
29
30     public VarNode getVarNode() {
31         return varNode;
32     }
33
34     public String JavaDoc toString() {
35         return super.toString() + " for " + varNode;
36     }
37
38     public Field visit(MemVisitor visitor, Object JavaDoc obj) {
39         return visitor.visitVarNodeProxy(this, obj);
40     }
41
42     public String JavaDoc getType() {
43         return varNode.getType();
44     }
45
46     public String JavaDoc getIdentifier() {
47         return varNode.getIdentifier();
48     }
49
50     public Class JavaDoc getCls() {
51         return varNode.getCls();
52     }
53
54     public void setUsedInProjection(boolean usedInProjection) {
55         varNode.setUsedInProjection(usedInProjection);
56     }
57
58     public boolean isUsedInProjection() {
59         return varNode.isUsedInProjection();
60     }
61
62     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
63         return v.arriveVarNodeProxy(this, msg);
64     }
65
66 }
67
Popular Tags