KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > core > logicalstructures > LogicalObjectStructureValue


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

11 package org.eclipse.jdt.internal.debug.core.logicalstructures;
12
13 import org.eclipse.debug.core.DebugException;
14 import org.eclipse.debug.core.ILaunch;
15 import org.eclipse.debug.core.model.IDebugTarget;
16 import org.eclipse.debug.core.model.IVariable;
17 import org.eclipse.jdt.debug.core.IJavaFieldVariable;
18 import org.eclipse.jdt.debug.core.IJavaObject;
19 import org.eclipse.jdt.debug.core.IJavaThread;
20 import org.eclipse.jdt.debug.core.IJavaType;
21 import org.eclipse.jdt.debug.core.IJavaValue;
22 import org.eclipse.jdt.debug.core.IJavaVariable;
23
24 /**
25  * A proxy to an object representing the logical structure of that object.
26  */

27 public class LogicalObjectStructureValue implements IJavaObject {
28     
29     private IJavaObject fObject;
30     private IJavaVariable[] fVariables;
31     
32     /**
33      * Constructs a proxy to the given object, with the given variables
34      * as children.
35      *
36      * @param object original object
37      */

38     public LogicalObjectStructureValue(IJavaObject object, IJavaVariable[] variables) {
39         fObject = object;
40         fVariables = variables;
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, boolean)
45      */

46     public IJavaValue sendMessage(String JavaDoc selector, String JavaDoc signature, IJavaValue[] args, IJavaThread thread, boolean superSend) throws DebugException {
47         return fObject.sendMessage(selector, signature, args, thread, superSend);
48     }
49
50     /* (non-Javadoc)
51      * @see org.eclipse.jdt.debug.core.IJavaObject#sendMessage(java.lang.String, java.lang.String, org.eclipse.jdt.debug.core.IJavaValue[], org.eclipse.jdt.debug.core.IJavaThread, java.lang.String)
52      */

53     public IJavaValue sendMessage(String JavaDoc selector, String JavaDoc signature, IJavaValue[] args, IJavaThread thread, String JavaDoc typeSignature) throws DebugException {
54         return fObject.sendMessage(selector, signature, args, thread, typeSignature);
55     }
56
57     /* (non-Javadoc)
58      * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, boolean)
59      */

60     public IJavaFieldVariable getField(String JavaDoc name, boolean superField) throws DebugException {
61         return fObject.getField(name, superField);
62     }
63
64     /* (non-Javadoc)
65      * @see org.eclipse.jdt.debug.core.IJavaObject#getField(java.lang.String, java.lang.String)
66      */

67     public IJavaFieldVariable getField(String JavaDoc name, String JavaDoc typeSignature) throws DebugException {
68         return fObject.getField(name, typeSignature);
69     }
70
71     /* (non-Javadoc)
72      * @see org.eclipse.jdt.debug.core.IJavaValue#getSignature()
73      */

74     public String JavaDoc getSignature() throws DebugException {
75         return fObject.getSignature();
76     }
77
78     /* (non-Javadoc)
79      * @see org.eclipse.jdt.debug.core.IJavaValue#getGenericSignature()
80      */

81     public String JavaDoc getGenericSignature() throws DebugException {
82         return fObject.getGenericSignature();
83     }
84
85     /* (non-Javadoc)
86      * @see org.eclipse.jdt.debug.core.IJavaValue#getJavaType()
87      */

88     public IJavaType getJavaType() throws DebugException {
89         return fObject.getJavaType();
90     }
91
92     /* (non-Javadoc)
93      * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
94      */

95     public String JavaDoc getReferenceTypeName() throws DebugException {
96         return fObject.getReferenceTypeName();
97     }
98
99     /* (non-Javadoc)
100      * @see org.eclipse.debug.core.model.IValue#getValueString()
101      */

102     public String JavaDoc getValueString() throws DebugException {
103         return fObject.getValueString();
104     }
105
106     /* (non-Javadoc)
107      * @see org.eclipse.debug.core.model.IValue#isAllocated()
108      */

109     public boolean isAllocated() throws DebugException {
110         return fObject.isAllocated();
111     }
112
113     /* (non-Javadoc)
114      * @see org.eclipse.debug.core.model.IValue#getVariables()
115      */

116     public IVariable[] getVariables() {
117         return fVariables;
118     }
119
120     /* (non-Javadoc)
121      * @see org.eclipse.debug.core.model.IValue#hasVariables()
122      */

123     public boolean hasVariables() {
124         return fVariables.length > 0;
125     }
126
127     /* (non-Javadoc)
128      * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
129      */

130     public String JavaDoc getModelIdentifier() {
131         return fObject.getModelIdentifier();
132     }
133
134     /* (non-Javadoc)
135      * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
136      */

137     public IDebugTarget getDebugTarget() {
138         return fObject.getDebugTarget();
139     }
140
141     /* (non-Javadoc)
142      * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
143      */

144     public ILaunch getLaunch() {
145         return fObject.getLaunch();
146     }
147
148     /* (non-Javadoc)
149      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
150      */

151     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
152         return fObject.getAdapter(adapter);
153     }
154     
155     
156
157     /* (non-Javadoc)
158      * @see org.eclipse.jdt.debug.core.IJavaObject#getWaitingThreads()
159      */

160     public IJavaThread[] getWaitingThreads() throws DebugException {
161         return null;
162     }
163     
164     
165     /* (non-Javadoc)
166      * @see org.eclipse.jdt.debug.core.IJavaObject#getOwningThread()
167      */

168     public IJavaThread getOwningThread() throws DebugException {
169         return null;
170     }
171
172     /* (non-Javadoc)
173      * @see org.eclipse.jdt.debug.core.IJavaObject#getReferringObjects(long)
174      */

175     public IJavaObject[] getReferringObjects(long max) throws DebugException {
176         return fObject.getReferringObjects(max);
177     }
178 }
179
Popular Tags