KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > views > variables > IndexedValuePartition


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.debug.internal.ui.views.variables;
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.IIndexedValue;
17 import org.eclipse.debug.core.model.IVariable;
18
19 /**
20  * A parition (subrange) of values of an indexed value
21  */

22 public class IndexedValuePartition implements IIndexedValue {
23
24     // the starting offset of this parition, into the associated collection
25
private int fOffset;
26     
27     // the length of this partition
28
private int fLength;
29
30     // the indexed value
31
private IIndexedValue fValue;
32     
33     /**
34      * Creates a parition for an indexed value.
35      *
36      * @param value indexed value
37      * @param offset beginning offset of this partition (into the value)
38      * @param length the length of this parition
39      */

40     public IndexedValuePartition(IIndexedValue value, int offset, int length) {
41         fValue = value;
42         fOffset = offset;
43         fLength = length;
44     }
45     
46     /* (non-Javadoc)
47      * @see org.eclipse.debug.core.model.IIndexedValue#getSize()
48      */

49     public int getSize() {
50         return fLength;
51     }
52
53     /* (non-Javadoc)
54      * @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
55      */

56     public IVariable getVariable(int offset) throws DebugException {
57         return fValue.getVariable(offset);
58     }
59
60     /* (non-Javadoc)
61      * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
62      */

63     public String JavaDoc getReferenceTypeName() throws DebugException {
64         return fValue.getReferenceTypeName();
65     }
66
67     /* (non-Javadoc)
68      * @see org.eclipse.debug.core.model.IValue#getValueString()
69      */

70     public String JavaDoc getValueString() {
71         return ""; //$NON-NLS-1$
72
}
73
74     /* (non-Javadoc)
75      * @see org.eclipse.debug.core.model.IValue#getVariables()
76      */

77     public IVariable[] getVariables() throws DebugException {
78         return getVariables(fOffset, fLength);
79     }
80
81     /* (non-Javadoc)
82      * @see org.eclipse.debug.core.model.IValue#hasVariables()
83      */

84     public boolean hasVariables() {
85         return fLength > 0;
86     }
87
88     /* (non-Javadoc)
89      * @see org.eclipse.debug.core.model.IValue#isAllocated()
90      */

91     public boolean isAllocated() throws DebugException {
92         return fValue.isAllocated();
93     }
94
95     /* (non-Javadoc)
96      * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
97      */

98     public IDebugTarget getDebugTarget() {
99         return fValue.getDebugTarget();
100     }
101
102     /* (non-Javadoc)
103      * @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
104      */

105     public ILaunch getLaunch() {
106         return fValue.getLaunch();
107     }
108
109     /* (non-Javadoc)
110      * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
111      */

112     public String JavaDoc getModelIdentifier() {
113         return fValue.getModelIdentifier();
114     }
115
116     /* (non-Javadoc)
117      * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
118      */

119     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
120         return fValue.getAdapter(adapter);
121     }
122
123     /* (non-Javadoc)
124      * @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
125      */

126     public IVariable[] getVariables(int offset, int length) throws DebugException {
127         return fValue.getVariables(offset, length);
128     }
129
130     /* (non-Javadoc)
131      * @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
132      */

133     public int getInitialOffset() {
134         return fOffset;
135     }
136
137 }
138
Popular Tags