1
2
3
4
5
6
7
8 package org.sourceforge.mbeanmonitoring.report.castor;
9
10
11
12
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17
18
19
20
21
22 public class Stat implements java.io.Serializable {
23
24
25
26
27
28
29
30
31
32 private java.lang.String _name;
33
34
35
36
37 private java.util.Vector _methodStatList;
38
39
40
41
42
43
44 public Stat() {
45 super();
46 this._methodStatList = new java.util.Vector();
47 }
48
49
50
51
52
53
54
55
56
57
58
59
60
61 public void addMethodStat(
62 final org.sourceforge.mbeanmonitoring.report.castor.MethodStat vMethodStat)
63 throws java.lang.IndexOutOfBoundsException {
64 this._methodStatList.addElement(vMethodStat);
65 }
66
67
68
69
70
71
72
73
74
75 public void addMethodStat(
76 final int index,
77 final org.sourceforge.mbeanmonitoring.report.castor.MethodStat vMethodStat)
78 throws java.lang.IndexOutOfBoundsException {
79 this._methodStatList.add(index, vMethodStat);
80 }
81
82
83
84
85
86
87
88
89 public java.util.Enumeration enumerateMethodStat(
90 ) {
91 return this._methodStatList.elements();
92 }
93
94
95
96
97
98
99
100
101
102
103
104 public org.sourceforge.mbeanmonitoring.report.castor.MethodStat getMethodStat(
105 final int index)
106 throws java.lang.IndexOutOfBoundsException {
107
108 if (index < 0 || index >= this._methodStatList.size()) {
109 throw new IndexOutOfBoundsException("getMethodStat: Index value '" + index + "' not in range [0.." + (this._methodStatList.size() - 1) + "]");
110 }
111
112 return (org.sourceforge.mbeanmonitoring.report.castor.MethodStat) _methodStatList.get(index);
113 }
114
115
116
117
118
119
120
121
122
123
124 public org.sourceforge.mbeanmonitoring.report.castor.MethodStat[] getMethodStat(
125 ) {
126 org.sourceforge.mbeanmonitoring.report.castor.MethodStat[] array = new org.sourceforge.mbeanmonitoring.report.castor.MethodStat[0];
127 return (org.sourceforge.mbeanmonitoring.report.castor.MethodStat[]) this._methodStatList.toArray(array);
128 }
129
130
131
132
133
134
135 public int getMethodStatCount(
136 ) {
137 return this._methodStatList.size();
138 }
139
140
141
142
143
144
145 public java.lang.String getName(
146 ) {
147 return this._name;
148 }
149
150
151
152
153
154
155 public boolean isValid(
156 ) {
157 try {
158 validate();
159 } catch (org.exolab.castor.xml.ValidationException vex) {
160 return false;
161 }
162 return true;
163 }
164
165
166
167
168
169
170
171
172
173
174 public void marshal(
175 final java.io.Writer out)
176 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
177 Marshaller.marshal(this, out);
178 }
179
180
181
182
183
184
185
186
187
188
189
190
191 public void marshal(
192 final org.xml.sax.ContentHandler handler)
193 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
194 Marshaller.marshal(this, handler);
195 }
196
197
198
199 public void removeAllMethodStat(
200 ) {
201 this._methodStatList.clear();
202 }
203
204
205
206
207
208
209
210 public boolean removeMethodStat(
211 final org.sourceforge.mbeanmonitoring.report.castor.MethodStat vMethodStat) {
212 boolean removed = _methodStatList.remove(vMethodStat);
213 return removed;
214 }
215
216
217
218
219
220
221
222 public org.sourceforge.mbeanmonitoring.report.castor.MethodStat removeMethodStatAt(
223 final int index) {
224 java.lang.Object obj = this._methodStatList.remove(index);
225 return (org.sourceforge.mbeanmonitoring.report.castor.MethodStat) obj;
226 }
227
228
229
230
231
232
233
234
235
236 public void setMethodStat(
237 final int index,
238 final org.sourceforge.mbeanmonitoring.report.castor.MethodStat vMethodStat)
239 throws java.lang.IndexOutOfBoundsException {
240
241 if (index < 0 || index >= this._methodStatList.size()) {
242 throw new IndexOutOfBoundsException("setMethodStat: Index value '" + index + "' not in range [0.." + (this._methodStatList.size() - 1) + "]");
243 }
244
245 this._methodStatList.set(index, vMethodStat);
246 }
247
248
249
250
251
252
253 public void setMethodStat(
254 final org.sourceforge.mbeanmonitoring.report.castor.MethodStat[] vMethodStatArray) {
255
256 _methodStatList.clear();
257
258 for (int i = 0; i < vMethodStatArray.length; i++) {
259 this._methodStatList.add(vMethodStatArray[i]);
260 }
261 }
262
263
264
265
266
267
268 public void setName(
269 final java.lang.String name) {
270 this._name = name;
271 }
272
273
274
275
276
277
278
279
280
281
282
283
284 public static org.sourceforge.mbeanmonitoring.report.castor.Stat unmarshal(
285 final java.io.Reader reader)
286 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
287 return (org.sourceforge.mbeanmonitoring.report.castor.Stat) Unmarshaller.unmarshal(org.sourceforge.mbeanmonitoring.report.castor.Stat.class, reader);
288 }
289
290
291
292
293
294
295
296 public void validate(
297 )
298 throws org.exolab.castor.xml.ValidationException {
299 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
300 validator.validate(this);
301 }
302
303 }