1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.generated.session;
9
10
11
12
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.ArrayList;
19 import java.util.Enumeration;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
25
26
27
28
29
30
31 public class Context extends fr.in2p3.jsaga.generated.session.ConfigurableType
32 implements java.io.Serializable
33 {
34
35
36
37
38
39
40
41
42
43 private java.lang.String _id;
44
45
46
47
48 private java.util.ArrayList _dataList;
49
50
51
52
53 private java.util.ArrayList _jobList;
54
55
56
57
58 private java.util.ArrayList _includeList;
59
60
61
62
63 private java.util.ArrayList _excludeList;
64
65
66
67
68
69
70 public Context()
71 {
72 super();
73 _dataList = new ArrayList();
74 _jobList = new ArrayList();
75 _includeList = new ArrayList();
76 _excludeList = new ArrayList();
77 }
78
79
80
81
82
83
84
85
86
87
88
89
90
91 public void addData(fr.in2p3.jsaga.generated.session.Data vData)
92 throws java.lang.IndexOutOfBoundsException
93 {
94 _dataList.add(vData);
95 }
96
97
98
99
100
101
102
103
104
105 public void addData(int index, fr.in2p3.jsaga.generated.session.Data vData)
106 throws java.lang.IndexOutOfBoundsException
107 {
108 _dataList.add(index, vData);
109 }
110
111
112
113
114
115
116
117
118 public void addExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
119 throws java.lang.IndexOutOfBoundsException
120 {
121 _excludeList.add(vExclude);
122 }
123
124
125
126
127
128
129
130
131
132 public void addExclude(int index, fr.in2p3.jsaga.generated.session.Exclude vExclude)
133 throws java.lang.IndexOutOfBoundsException
134 {
135 _excludeList.add(index, vExclude);
136 }
137
138
139
140
141
142
143
144
145 public void addInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
146 throws java.lang.IndexOutOfBoundsException
147 {
148 _includeList.add(vInclude);
149 }
150
151
152
153
154
155
156
157
158
159 public void addInclude(int index, fr.in2p3.jsaga.generated.session.Include vInclude)
160 throws java.lang.IndexOutOfBoundsException
161 {
162 _includeList.add(index, vInclude);
163 }
164
165
166
167
168
169
170
171
172 public void addJob(fr.in2p3.jsaga.generated.session.Job vJob)
173 throws java.lang.IndexOutOfBoundsException
174 {
175 _jobList.add(vJob);
176 }
177
178
179
180
181
182
183
184
185
186 public void addJob(int index, fr.in2p3.jsaga.generated.session.Job vJob)
187 throws java.lang.IndexOutOfBoundsException
188 {
189 _jobList.add(index, vJob);
190 }
191
192
193
194
195
196 public void clearData()
197 {
198 _dataList.clear();
199 }
200
201
202
203
204
205 public void clearExclude()
206 {
207 _excludeList.clear();
208 }
209
210
211
212
213
214 public void clearInclude()
215 {
216 _includeList.clear();
217 }
218
219
220
221
222
223 public void clearJob()
224 {
225 _jobList.clear();
226 }
227
228
229
230
231
232
233
234
235 public java.util.Enumeration enumerateData()
236 {
237 return new org.exolab.castor.util.IteratorEnumeration(_dataList.iterator());
238 }
239
240
241
242
243
244
245
246
247 public java.util.Enumeration enumerateExclude()
248 {
249 return new org.exolab.castor.util.IteratorEnumeration(_excludeList.iterator());
250 }
251
252
253
254
255
256
257
258
259 public java.util.Enumeration enumerateInclude()
260 {
261 return new org.exolab.castor.util.IteratorEnumeration(_includeList.iterator());
262 }
263
264
265
266
267
268
269
270
271 public java.util.Enumeration enumerateJob()
272 {
273 return new org.exolab.castor.util.IteratorEnumeration(_jobList.iterator());
274 }
275
276
277
278
279
280
281
282
283
284 public fr.in2p3.jsaga.generated.session.Data getData(int index)
285 throws java.lang.IndexOutOfBoundsException
286 {
287
288 if ((index < 0) || (index > _dataList.size())) {
289 throw new IndexOutOfBoundsException();
290 }
291
292 return (fr.in2p3.jsaga.generated.session.Data) _dataList.get(index);
293 }
294
295
296
297
298
299
300
301
302 public fr.in2p3.jsaga.generated.session.Data[] getData()
303 {
304 int size = _dataList.size();
305 fr.in2p3.jsaga.generated.session.Data[] mArray = new fr.in2p3.jsaga.generated.session.Data[size];
306 for (int index = 0; index < size; index++) {
307 mArray[index] = (fr.in2p3.jsaga.generated.session.Data) _dataList.get(index);
308 }
309 return mArray;
310 }
311
312
313
314
315
316
317
318
319 public int getDataCount()
320 {
321 return _dataList.size();
322 }
323
324
325
326
327
328
329
330
331
332 public fr.in2p3.jsaga.generated.session.Exclude getExclude(int index)
333 throws java.lang.IndexOutOfBoundsException
334 {
335
336 if ((index < 0) || (index > _excludeList.size())) {
337 throw new IndexOutOfBoundsException();
338 }
339
340 return (fr.in2p3.jsaga.generated.session.Exclude) _excludeList.get(index);
341 }
342
343
344
345
346
347
348
349
350 public fr.in2p3.jsaga.generated.session.Exclude[] getExclude()
351 {
352 int size = _excludeList.size();
353 fr.in2p3.jsaga.generated.session.Exclude[] mArray = new fr.in2p3.jsaga.generated.session.Exclude[size];
354 for (int index = 0; index < size; index++) {
355 mArray[index] = (fr.in2p3.jsaga.generated.session.Exclude) _excludeList.get(index);
356 }
357 return mArray;
358 }
359
360
361
362
363
364
365
366
367 public int getExcludeCount()
368 {
369 return _excludeList.size();
370 }
371
372
373
374
375
376
377
378 public java.lang.String getId()
379 {
380 return this._id;
381 }
382
383
384
385
386
387
388
389
390
391 public fr.in2p3.jsaga.generated.session.Include getInclude(int index)
392 throws java.lang.IndexOutOfBoundsException
393 {
394
395 if ((index < 0) || (index > _includeList.size())) {
396 throw new IndexOutOfBoundsException();
397 }
398
399 return (fr.in2p3.jsaga.generated.session.Include) _includeList.get(index);
400 }
401
402
403
404
405
406
407
408
409 public fr.in2p3.jsaga.generated.session.Include[] getInclude()
410 {
411 int size = _includeList.size();
412 fr.in2p3.jsaga.generated.session.Include[] mArray = new fr.in2p3.jsaga.generated.session.Include[size];
413 for (int index = 0; index < size; index++) {
414 mArray[index] = (fr.in2p3.jsaga.generated.session.Include) _includeList.get(index);
415 }
416 return mArray;
417 }
418
419
420
421
422
423
424
425
426 public int getIncludeCount()
427 {
428 return _includeList.size();
429 }
430
431
432
433
434
435
436
437
438
439 public fr.in2p3.jsaga.generated.session.Job getJob(int index)
440 throws java.lang.IndexOutOfBoundsException
441 {
442
443 if ((index < 0) || (index > _jobList.size())) {
444 throw new IndexOutOfBoundsException();
445 }
446
447 return (fr.in2p3.jsaga.generated.session.Job) _jobList.get(index);
448 }
449
450
451
452
453
454
455
456
457 public fr.in2p3.jsaga.generated.session.Job[] getJob()
458 {
459 int size = _jobList.size();
460 fr.in2p3.jsaga.generated.session.Job[] mArray = new fr.in2p3.jsaga.generated.session.Job[size];
461 for (int index = 0; index < size; index++) {
462 mArray[index] = (fr.in2p3.jsaga.generated.session.Job) _jobList.get(index);
463 }
464 return mArray;
465 }
466
467
468
469
470
471
472
473
474 public int getJobCount()
475 {
476 return _jobList.size();
477 }
478
479
480
481
482
483
484
485
486 public boolean isValid()
487 {
488 try {
489 validate();
490 }
491 catch (org.exolab.castor.xml.ValidationException vex) {
492 return false;
493 }
494 return true;
495 }
496
497
498
499
500
501
502
503
504 public void marshal(java.io.Writer out)
505 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
506 {
507
508 Marshaller.marshal(this, out);
509 }
510
511
512
513
514
515
516
517
518 public void marshal(org.xml.sax.ContentHandler handler)
519 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
520 {
521
522 Marshaller.marshal(this, handler);
523 }
524
525
526
527
528
529
530
531
532
533 public boolean removeData(fr.in2p3.jsaga.generated.session.Data vData)
534 {
535 boolean removed = _dataList.remove(vData);
536 return removed;
537 }
538
539
540
541
542
543
544
545
546
547 public boolean removeExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
548 {
549 boolean removed = _excludeList.remove(vExclude);
550 return removed;
551 }
552
553
554
555
556
557
558
559
560
561 public boolean removeInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
562 {
563 boolean removed = _includeList.remove(vInclude);
564 return removed;
565 }
566
567
568
569
570
571
572
573
574
575 public boolean removeJob(fr.in2p3.jsaga.generated.session.Job vJob)
576 {
577 boolean removed = _jobList.remove(vJob);
578 return removed;
579 }
580
581
582
583
584
585
586
587
588
589 public void setData(int index, fr.in2p3.jsaga.generated.session.Data vData)
590 throws java.lang.IndexOutOfBoundsException
591 {
592
593 if ((index < 0) || (index > _dataList.size())) {
594 throw new IndexOutOfBoundsException();
595 }
596 _dataList.set(index, vData);
597 }
598
599
600
601
602
603
604
605
606 public void setData(fr.in2p3.jsaga.generated.session.Data[] dataArray)
607 {
608
609 _dataList.clear();
610 for (int i = 0; i < dataArray.length; i++) {
611 _dataList.add(dataArray[i]);
612 }
613 }
614
615
616
617
618
619
620
621
622
623 public void setExclude(int index, fr.in2p3.jsaga.generated.session.Exclude vExclude)
624 throws java.lang.IndexOutOfBoundsException
625 {
626
627 if ((index < 0) || (index > _excludeList.size())) {
628 throw new IndexOutOfBoundsException();
629 }
630 _excludeList.set(index, vExclude);
631 }
632
633
634
635
636
637
638
639
640 public void setExclude(fr.in2p3.jsaga.generated.session.Exclude[] excludeArray)
641 {
642
643 _excludeList.clear();
644 for (int i = 0; i < excludeArray.length; i++) {
645 _excludeList.add(excludeArray[i]);
646 }
647 }
648
649
650
651
652
653
654 public void setId(java.lang.String id)
655 {
656 this._id = id;
657 }
658
659
660
661
662
663
664
665
666
667 public void setInclude(int index, fr.in2p3.jsaga.generated.session.Include vInclude)
668 throws java.lang.IndexOutOfBoundsException
669 {
670
671 if ((index < 0) || (index > _includeList.size())) {
672 throw new IndexOutOfBoundsException();
673 }
674 _includeList.set(index, vInclude);
675 }
676
677
678
679
680
681
682
683
684 public void setInclude(fr.in2p3.jsaga.generated.session.Include[] includeArray)
685 {
686
687 _includeList.clear();
688 for (int i = 0; i < includeArray.length; i++) {
689 _includeList.add(includeArray[i]);
690 }
691 }
692
693
694
695
696
697
698
699
700
701 public void setJob(int index, fr.in2p3.jsaga.generated.session.Job vJob)
702 throws java.lang.IndexOutOfBoundsException
703 {
704
705 if ((index < 0) || (index > _jobList.size())) {
706 throw new IndexOutOfBoundsException();
707 }
708 _jobList.set(index, vJob);
709 }
710
711
712
713
714
715
716
717
718 public void setJob(fr.in2p3.jsaga.generated.session.Job[] jobArray)
719 {
720
721 _jobList.clear();
722 for (int i = 0; i < jobArray.length; i++) {
723 _jobList.add(jobArray[i]);
724 }
725 }
726
727
728
729
730
731
732
733
734
735 public static java.lang.Object unmarshal(java.io.Reader reader)
736 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
737 {
738 return (fr.in2p3.jsaga.generated.session.Context) Unmarshaller.unmarshal(fr.in2p3.jsaga.generated.session.Context.class, reader);
739 }
740
741
742
743
744
745 public void validate()
746 throws org.exolab.castor.xml.ValidationException
747 {
748 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
749 validator.validate(this);
750 }
751
752 }