1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
package jalview.schemabinding.version2; |
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
import org.exolab.castor.xml.Marshaller; |
15 |
|
import org.exolab.castor.xml.Unmarshaller; |
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
@version |
21 |
|
|
|
|
| 36% |
Uncovered Elements: 64 (100) |
Complexity: 43 |
Complexity Density: 0.77 |
|
22 |
|
public class JalviewUserColours implements java.io.Serializable |
23 |
|
{ |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
private java.lang.String _schemeName; |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
private java.lang.String _version; |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
private java.util.Vector _colourList; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
private java.util.Vector _filterList; |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
54 |
2 |
public JalviewUserColours()... |
55 |
|
{ |
56 |
2 |
super(); |
57 |
2 |
this._colourList = new java.util.Vector(); |
58 |
2 |
this._filterList = new java.util.Vector(); |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@param |
69 |
|
@throws |
70 |
|
|
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
10 |
public void addColour(final Colour vColour)... |
73 |
|
throws java.lang.IndexOutOfBoundsException |
74 |
|
{ |
75 |
10 |
this._colourList.addElement(vColour); |
76 |
|
} |
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
@param |
82 |
|
@param |
83 |
|
@throws |
84 |
|
|
85 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
0 |
public void addColour(final int index, final Colour vColour)... |
87 |
|
throws java.lang.IndexOutOfBoundsException |
88 |
|
{ |
89 |
0 |
this._colourList.add(index, vColour); |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@param |
96 |
|
@throws |
97 |
|
|
98 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
6 |
public void addFilter(final Filter vFilter)... |
100 |
|
throws java.lang.IndexOutOfBoundsException |
101 |
|
{ |
102 |
6 |
this._filterList.addElement(vFilter); |
103 |
|
} |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
@param |
109 |
|
@param |
110 |
|
@throws |
111 |
|
|
112 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
0 |
public void addFilter(final int index, final Filter vFilter)... |
114 |
|
throws java.lang.IndexOutOfBoundsException |
115 |
|
{ |
116 |
0 |
this._filterList.add(index, vFilter); |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
@return |
123 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
0 |
public java.util.Enumeration enumerateColour()... |
125 |
|
{ |
126 |
0 |
return this._colourList.elements(); |
127 |
|
} |
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
@return |
133 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
134 |
0 |
public java.util.Enumeration enumerateFilter()... |
135 |
|
{ |
136 |
0 |
return this._filterList.elements(); |
137 |
|
} |
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
@param |
143 |
|
@throws |
144 |
|
|
145 |
|
@return |
146 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
147 |
5 |
public Colour getColour(final int index)... |
148 |
|
throws java.lang.IndexOutOfBoundsException |
149 |
|
{ |
150 |
|
|
151 |
5 |
if (index < 0 || index >= this._colourList.size()) |
152 |
|
{ |
153 |
0 |
throw new IndexOutOfBoundsException( |
154 |
|
"getColour: Index value '" + index + "' not in range [0.." |
155 |
|
+ (this._colourList.size() - 1) + "]"); |
156 |
|
} |
157 |
|
|
158 |
5 |
return (Colour) _colourList.get(index); |
159 |
|
} |
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
@return |
169 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
170 |
3 |
public Colour[] getColour()... |
171 |
|
{ |
172 |
3 |
Colour[] array = new Colour[0]; |
173 |
3 |
return (Colour[]) this._colourList.toArray(array); |
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
|
|
179 |
|
@return |
180 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
181 |
6 |
public int getColourCount()... |
182 |
|
{ |
183 |
6 |
return this._colourList.size(); |
184 |
|
} |
185 |
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
@param |
190 |
|
@throws |
191 |
|
|
192 |
|
@return |
193 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
194 |
3 |
public Filter getFilter(final int index)... |
195 |
|
throws java.lang.IndexOutOfBoundsException |
196 |
|
{ |
197 |
|
|
198 |
3 |
if (index < 0 || index >= this._filterList.size()) |
199 |
|
{ |
200 |
0 |
throw new IndexOutOfBoundsException( |
201 |
|
"getFilter: Index value '" + index + "' not in range [0.." |
202 |
|
+ (this._filterList.size() - 1) + "]"); |
203 |
|
} |
204 |
|
|
205 |
3 |
return (Filter) _filterList.get(index); |
206 |
|
} |
207 |
|
|
208 |
|
|
209 |
|
|
210 |
|
|
211 |
|
|
212 |
|
|
213 |
|
|
214 |
|
|
215 |
|
@return |
216 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
217 |
3 |
public Filter[] getFilter()... |
218 |
|
{ |
219 |
3 |
Filter[] array = new Filter[0]; |
220 |
3 |
return (Filter[]) this._filterList.toArray(array); |
221 |
|
} |
222 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
@return |
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
228 |
4 |
public int getFilterCount()... |
229 |
|
{ |
230 |
4 |
return this._filterList.size(); |
231 |
|
} |
232 |
|
|
233 |
|
|
234 |
|
|
235 |
|
|
236 |
|
@return |
237 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
238 |
3 |
public java.lang.String getSchemeName()... |
239 |
|
{ |
240 |
3 |
return this._schemeName; |
241 |
|
} |
242 |
|
|
243 |
|
|
244 |
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
|
@return |
249 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
250 |
3 |
public java.lang.String getVersion()... |
251 |
|
{ |
252 |
3 |
return this._version; |
253 |
|
} |
254 |
|
|
255 |
|
|
256 |
|
|
257 |
|
|
258 |
|
@return |
259 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
260 |
0 |
public boolean isValid()... |
261 |
|
{ |
262 |
0 |
try |
263 |
|
{ |
264 |
0 |
validate(); |
265 |
|
} catch (org.exolab.castor.xml.ValidationException vex) |
266 |
|
{ |
267 |
0 |
return false; |
268 |
|
} |
269 |
0 |
return true; |
270 |
|
} |
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
|
275 |
|
@param |
276 |
|
@throws |
277 |
|
|
278 |
|
|
279 |
|
@throws |
280 |
|
|
281 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
282 |
1 |
public void marshal(final java.io.Writer out)... |
283 |
|
throws org.exolab.castor.xml.MarshalException, |
284 |
|
org.exolab.castor.xml.ValidationException |
285 |
|
{ |
286 |
1 |
Marshaller.marshal(this, out); |
287 |
|
} |
288 |
|
|
289 |
|
|
290 |
|
|
291 |
|
|
292 |
|
@param |
293 |
|
@throws |
294 |
|
|
295 |
|
@throws |
296 |
|
|
297 |
|
@throws |
298 |
|
|
299 |
|
|
300 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
301 |
0 |
public void marshal(final org.xml.sax.ContentHandler handler)... |
302 |
|
throws java.io.IOException, |
303 |
|
org.exolab.castor.xml.MarshalException, |
304 |
|
org.exolab.castor.xml.ValidationException |
305 |
|
{ |
306 |
0 |
Marshaller.marshal(this, handler); |
307 |
|
} |
308 |
|
|
309 |
|
|
310 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
311 |
0 |
public void removeAllColour()... |
312 |
|
{ |
313 |
0 |
this._colourList.clear(); |
314 |
|
} |
315 |
|
|
316 |
|
|
317 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
318 |
0 |
public void removeAllFilter()... |
319 |
|
{ |
320 |
0 |
this._filterList.clear(); |
321 |
|
} |
322 |
|
|
323 |
|
|
324 |
|
|
325 |
|
|
326 |
|
@param |
327 |
|
@return |
328 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
329 |
0 |
public boolean removeColour(final Colour vColour)... |
330 |
|
{ |
331 |
0 |
boolean removed = _colourList.remove(vColour); |
332 |
0 |
return removed; |
333 |
|
} |
334 |
|
|
335 |
|
|
336 |
|
|
337 |
|
|
338 |
|
@param |
339 |
|
@return |
340 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
341 |
0 |
public Colour removeColourAt(final int index)... |
342 |
|
{ |
343 |
0 |
java.lang.Object obj = this._colourList.remove(index); |
344 |
0 |
return (Colour) obj; |
345 |
|
} |
346 |
|
|
347 |
|
|
348 |
|
|
349 |
|
|
350 |
|
@param |
351 |
|
@return |
352 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
353 |
0 |
public boolean removeFilter(final Filter vFilter)... |
354 |
|
{ |
355 |
0 |
boolean removed = _filterList.remove(vFilter); |
356 |
0 |
return removed; |
357 |
|
} |
358 |
|
|
359 |
|
|
360 |
|
|
361 |
|
|
362 |
|
@param |
363 |
|
@return |
364 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
365 |
0 |
public Filter removeFilterAt(final int index)... |
366 |
|
{ |
367 |
0 |
java.lang.Object obj = this._filterList.remove(index); |
368 |
0 |
return (Filter) obj; |
369 |
|
} |
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
@param |
375 |
|
@param |
376 |
|
@throws |
377 |
|
|
378 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
379 |
0 |
public void setColour(final int index, final Colour vColour)... |
380 |
|
throws java.lang.IndexOutOfBoundsException |
381 |
|
{ |
382 |
|
|
383 |
0 |
if (index < 0 || index >= this._colourList.size()) |
384 |
|
{ |
385 |
0 |
throw new IndexOutOfBoundsException( |
386 |
|
"setColour: Index value '" + index + "' not in range [0.." |
387 |
|
+ (this._colourList.size() - 1) + "]"); |
388 |
|
} |
389 |
|
|
390 |
0 |
this._colourList.set(index, vColour); |
391 |
|
} |
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
|
@param |
397 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
398 |
0 |
public void setColour(final Colour[] vColourArray)... |
399 |
|
{ |
400 |
|
|
401 |
0 |
_colourList.clear(); |
402 |
|
|
403 |
0 |
for (int i = 0; i < vColourArray.length; i++) |
404 |
|
{ |
405 |
0 |
this._colourList.add(vColourArray[i]); |
406 |
|
} |
407 |
|
} |
408 |
|
|
409 |
|
|
410 |
|
|
411 |
|
|
412 |
|
@param |
413 |
|
@param |
414 |
|
@throws |
415 |
|
|
416 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
417 |
0 |
public void setFilter(final int index, final Filter vFilter)... |
418 |
|
throws java.lang.IndexOutOfBoundsException |
419 |
|
{ |
420 |
|
|
421 |
0 |
if (index < 0 || index >= this._filterList.size()) |
422 |
|
{ |
423 |
0 |
throw new IndexOutOfBoundsException( |
424 |
|
"setFilter: Index value '" + index + "' not in range [0.." |
425 |
|
+ (this._filterList.size() - 1) + "]"); |
426 |
|
} |
427 |
|
|
428 |
0 |
this._filterList.set(index, vFilter); |
429 |
|
} |
430 |
|
|
431 |
|
|
432 |
|
|
433 |
|
|
434 |
|
@param |
435 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
436 |
0 |
public void setFilter(final Filter[] vFilterArray)... |
437 |
|
{ |
438 |
|
|
439 |
0 |
_filterList.clear(); |
440 |
|
|
441 |
0 |
for (int i = 0; i < vFilterArray.length; i++) |
442 |
|
{ |
443 |
0 |
this._filterList.add(vFilterArray[i]); |
444 |
|
} |
445 |
|
} |
446 |
|
|
447 |
|
|
448 |
|
|
449 |
|
|
450 |
|
@param |
451 |
|
|
452 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
453 |
2 |
public void setSchemeName(final java.lang.String schemeName)... |
454 |
|
{ |
455 |
2 |
this._schemeName = schemeName; |
456 |
|
} |
457 |
|
|
458 |
|
|
459 |
|
|
460 |
|
|
461 |
|
|
462 |
|
|
463 |
|
@param |
464 |
|
|
465 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
466 |
0 |
public void setVersion(final java.lang.String version)... |
467 |
|
{ |
468 |
0 |
this._version = version; |
469 |
|
} |
470 |
|
|
471 |
|
|
472 |
|
|
473 |
|
|
474 |
|
@param |
475 |
|
@throws |
476 |
|
|
477 |
|
|
478 |
|
@throws |
479 |
|
|
480 |
|
@return |
481 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
482 |
1 |
public static jalview.schemabinding.version2.JalviewUserColours unmarshal(... |
483 |
|
final java.io.Reader reader) |
484 |
|
throws org.exolab.castor.xml.MarshalException, |
485 |
|
org.exolab.castor.xml.ValidationException |
486 |
|
{ |
487 |
1 |
return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller |
488 |
|
.unmarshal( |
489 |
|
jalview.schemabinding.version2.JalviewUserColours.class, |
490 |
|
reader); |
491 |
|
} |
492 |
|
|
493 |
|
|
494 |
|
|
495 |
|
|
496 |
|
@throws |
497 |
|
|
498 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
499 |
0 |
public void validate() throws org.exolab.castor.xml.ValidationException... |
500 |
|
{ |
501 |
0 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); |
502 |
0 |
validator.validate(this); |
503 |
|
} |
504 |
|
|
505 |
|
} |