blob: 33a0952fb72858828b4176f35e0e41898c0cfeba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.variables;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IIndexedValue;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
/**
* A parition (subrange) of values of an indexed value
*/
public class IndexedValuePartition implements IIndexedValue {
// the starting offset of this parition, into the associated collection
private int fOffset;
// the length of this partition
private int fLength;
// the indexed value
private IIndexedValue fValue;
/**
* Creates a parition for an indexed value.
*
* @param value indexed value
* @param offset beginning offset of this partition (into the value)
* @param length the length of this parition
*/
public IndexedValuePartition(IIndexedValue value, int offset, int length) {
fValue = value;
fOffset = offset;
fLength = length;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getSize()
*/
@Override
public int getSize() {
return fLength;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
*/
@Override
public IVariable getVariable(int offset) throws DebugException {
return fValue.getVariable(offset);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
@Override
public String getReferenceTypeName() throws DebugException {
return fValue.getReferenceTypeName();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
@Override
public String getValueString() {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
@Override
public IVariable[] getVariables() throws DebugException {
return getVariables(fOffset, fLength);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
@Override
public boolean hasVariables() {
return fLength > 0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
@Override
public boolean isAllocated() throws DebugException {
return fValue.isAllocated();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
@Override
public IDebugTarget getDebugTarget() {
return fValue.getDebugTarget();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
@Override
public ILaunch getLaunch() {
return fValue.getLaunch();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
@Override
public String getModelIdentifier() {
return fValue.getModelIdentifier();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
@Override
public Object getAdapter(Class adapter) {
return fValue.getAdapter(adapter);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
*/
@Override
public IVariable[] getVariables(int offset, int length) throws DebugException {
return fValue.getVariables(offset, length);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
*/
@Override
public int getInitialOffset() {
return fOffset;
}
}
|