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 _resourceList;
59
60
61
62
63 private java.util.ArrayList _includeList;
64
65
66
67
68 private java.util.ArrayList _excludeList;
69
70
71
72
73
74
75 public Context()
76 {
77 super();
78 _dataList = new ArrayList();
79 _jobList = new ArrayList();
80 _resourceList = new ArrayList();
81 _includeList = new ArrayList();
82 _excludeList = new ArrayList();
83 }
84
85
86
87
88
89
90
91
92
93
94
95
96
97 public void addData(fr.in2p3.jsaga.generated.session.Data vData)
98 throws java.lang.IndexOutOfBoundsException
99 {
100 _dataList.add(vData);
101 }
102
103
104
105
106
107
108
109
110
111 public void addData(int index, fr.in2p3.jsaga.generated.session.Data vData)
112 throws java.lang.IndexOutOfBoundsException
113 {
114 _dataList.add(index, vData);
115 }
116
117
118
119
120
121
122
123
124 public void addExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
125 throws java.lang.IndexOutOfBoundsException
126 {
127 _excludeList.add(vExclude);
128 }
129
130
131
132
133
134
135
136
137
138 public void addExclude(int index, fr.in2p3.jsaga.generated.session.Exclude vExclude)
139 throws java.lang.IndexOutOfBoundsException
140 {
141 _excludeList.add(index, vExclude);
142 }
143
144
145
146
147
148
149
150
151 public void addInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
152 throws java.lang.IndexOutOfBoundsException
153 {
154 _includeList.add(vInclude);
155 }
156
157
158
159
160
161
162
163
164
165 public void addInclude(int index, fr.in2p3.jsaga.generated.session.Include vInclude)
166 throws java.lang.IndexOutOfBoundsException
167 {
168 _includeList.add(index, vInclude);
169 }
170
171
172
173
174
175
176
177
178 public void addJob(fr.in2p3.jsaga.generated.session.Job vJob)
179 throws java.lang.IndexOutOfBoundsException
180 {
181 _jobList.add(vJob);
182 }
183
184
185
186
187
188
189
190
191
192 public void addJob(int index, fr.in2p3.jsaga.generated.session.Job vJob)
193 throws java.lang.IndexOutOfBoundsException
194 {
195 _jobList.add(index, vJob);
196 }
197
198
199
200
201
202
203
204
205 public void addResource(fr.in2p3.jsaga.generated.session.Resource vResource)
206 throws java.lang.IndexOutOfBoundsException
207 {
208 _resourceList.add(vResource);
209 }
210
211
212
213
214
215
216
217
218
219 public void addResource(int index, fr.in2p3.jsaga.generated.session.Resource vResource)
220 throws java.lang.IndexOutOfBoundsException
221 {
222 _resourceList.add(index, vResource);
223 }
224
225
226
227
228
229 public void clearData()
230 {
231 _dataList.clear();
232 }
233
234
235
236
237
238 public void clearExclude()
239 {
240 _excludeList.clear();
241 }
242
243
244
245
246
247 public void clearInclude()
248 {
249 _includeList.clear();
250 }
251
252
253
254
255
256 public void clearJob()
257 {
258 _jobList.clear();
259 }
260
261
262
263
264
265 public void clearResource()
266 {
267 _resourceList.clear();
268 }
269
270
271
272
273
274
275
276
277 public java.util.Enumeration enumerateData()
278 {
279 return new org.exolab.castor.util.IteratorEnumeration(_dataList.iterator());
280 }
281
282
283
284
285
286
287
288
289 public java.util.Enumeration enumerateExclude()
290 {
291 return new org.exolab.castor.util.IteratorEnumeration(_excludeList.iterator());
292 }
293
294
295
296
297
298
299
300
301 public java.util.Enumeration enumerateInclude()
302 {
303 return new org.exolab.castor.util.IteratorEnumeration(_includeList.iterator());
304 }
305
306
307
308
309
310
311
312
313 public java.util.Enumeration enumerateJob()
314 {
315 return new org.exolab.castor.util.IteratorEnumeration(_jobList.iterator());
316 }
317
318
319
320
321
322
323
324
325 public java.util.Enumeration enumerateResource()
326 {
327 return new org.exolab.castor.util.IteratorEnumeration(_resourceList.iterator());
328 }
329
330
331
332
333
334
335
336
337
338 public fr.in2p3.jsaga.generated.session.Data getData(int index)
339 throws java.lang.IndexOutOfBoundsException
340 {
341
342 if ((index < 0) || (index > _dataList.size())) {
343 throw new IndexOutOfBoundsException();
344 }
345
346 return (fr.in2p3.jsaga.generated.session.Data) _dataList.get(index);
347 }
348
349
350
351
352
353
354
355
356 public fr.in2p3.jsaga.generated.session.Data[] getData()
357 {
358 int size = _dataList.size();
359 fr.in2p3.jsaga.generated.session.Data[] mArray = new fr.in2p3.jsaga.generated.session.Data[size];
360 for (int index = 0; index < size; index++) {
361 mArray[index] = (fr.in2p3.jsaga.generated.session.Data) _dataList.get(index);
362 }
363 return mArray;
364 }
365
366
367
368
369
370
371
372
373 public int getDataCount()
374 {
375 return _dataList.size();
376 }
377
378
379
380
381
382
383
384
385
386 public fr.in2p3.jsaga.generated.session.Exclude getExclude(int index)
387 throws java.lang.IndexOutOfBoundsException
388 {
389
390 if ((index < 0) || (index > _excludeList.size())) {
391 throw new IndexOutOfBoundsException();
392 }
393
394 return (fr.in2p3.jsaga.generated.session.Exclude) _excludeList.get(index);
395 }
396
397
398
399
400
401
402
403
404 public fr.in2p3.jsaga.generated.session.Exclude[] getExclude()
405 {
406 int size = _excludeList.size();
407 fr.in2p3.jsaga.generated.session.Exclude[] mArray = new fr.in2p3.jsaga.generated.session.Exclude[size];
408 for (int index = 0; index < size; index++) {
409 mArray[index] = (fr.in2p3.jsaga.generated.session.Exclude) _excludeList.get(index);
410 }
411 return mArray;
412 }
413
414
415
416
417
418
419
420
421 public int getExcludeCount()
422 {
423 return _excludeList.size();
424 }
425
426
427
428
429
430
431
432 public java.lang.String getId()
433 {
434 return this._id;
435 }
436
437
438
439
440
441
442
443
444
445 public fr.in2p3.jsaga.generated.session.Include getInclude(int index)
446 throws java.lang.IndexOutOfBoundsException
447 {
448
449 if ((index < 0) || (index > _includeList.size())) {
450 throw new IndexOutOfBoundsException();
451 }
452
453 return (fr.in2p3.jsaga.generated.session.Include) _includeList.get(index);
454 }
455
456
457
458
459
460
461
462
463 public fr.in2p3.jsaga.generated.session.Include[] getInclude()
464 {
465 int size = _includeList.size();
466 fr.in2p3.jsaga.generated.session.Include[] mArray = new fr.in2p3.jsaga.generated.session.Include[size];
467 for (int index = 0; index < size; index++) {
468 mArray[index] = (fr.in2p3.jsaga.generated.session.Include) _includeList.get(index);
469 }
470 return mArray;
471 }
472
473
474
475
476
477
478
479
480 public int getIncludeCount()
481 {
482 return _includeList.size();
483 }
484
485
486
487
488
489
490
491
492
493 public fr.in2p3.jsaga.generated.session.Job getJob(int index)
494 throws java.lang.IndexOutOfBoundsException
495 {
496
497 if ((index < 0) || (index > _jobList.size())) {
498 throw new IndexOutOfBoundsException();
499 }
500
501 return (fr.in2p3.jsaga.generated.session.Job) _jobList.get(index);
502 }
503
504
505
506
507
508
509
510
511 public fr.in2p3.jsaga.generated.session.Job[] getJob()
512 {
513 int size = _jobList.size();
514 fr.in2p3.jsaga.generated.session.Job[] mArray = new fr.in2p3.jsaga.generated.session.Job[size];
515 for (int index = 0; index < size; index++) {
516 mArray[index] = (fr.in2p3.jsaga.generated.session.Job) _jobList.get(index);
517 }
518 return mArray;
519 }
520
521
522
523
524
525
526
527
528 public int getJobCount()
529 {
530 return _jobList.size();
531 }
532
533
534
535
536
537
538
539
540
541 public fr.in2p3.jsaga.generated.session.Resource getResource(int index)
542 throws java.lang.IndexOutOfBoundsException
543 {
544
545 if ((index < 0) || (index > _resourceList.size())) {
546 throw new IndexOutOfBoundsException();
547 }
548
549 return (fr.in2p3.jsaga.generated.session.Resource) _resourceList.get(index);
550 }
551
552
553
554
555
556
557
558
559 public fr.in2p3.jsaga.generated.session.Resource[] getResource()
560 {
561 int size = _resourceList.size();
562 fr.in2p3.jsaga.generated.session.Resource[] mArray = new fr.in2p3.jsaga.generated.session.Resource[size];
563 for (int index = 0; index < size; index++) {
564 mArray[index] = (fr.in2p3.jsaga.generated.session.Resource) _resourceList.get(index);
565 }
566 return mArray;
567 }
568
569
570
571
572
573
574
575
576 public int getResourceCount()
577 {
578 return _resourceList.size();
579 }
580
581
582
583
584
585
586
587
588 public boolean isValid()
589 {
590 try {
591 validate();
592 }
593 catch (org.exolab.castor.xml.ValidationException vex) {
594 return false;
595 }
596 return true;
597 }
598
599
600
601
602
603
604
605
606 public void marshal(java.io.Writer out)
607 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
608 {
609
610 Marshaller.marshal(this, out);
611 }
612
613
614
615
616
617
618
619
620 public void marshal(org.xml.sax.ContentHandler handler)
621 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
622 {
623
624 Marshaller.marshal(this, handler);
625 }
626
627
628
629
630
631
632
633
634
635 public boolean removeData(fr.in2p3.jsaga.generated.session.Data vData)
636 {
637 boolean removed = _dataList.remove(vData);
638 return removed;
639 }
640
641
642
643
644
645
646
647
648
649 public boolean removeExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
650 {
651 boolean removed = _excludeList.remove(vExclude);
652 return removed;
653 }
654
655
656
657
658
659
660
661
662
663 public boolean removeInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
664 {
665 boolean removed = _includeList.remove(vInclude);
666 return removed;
667 }
668
669
670
671
672
673
674
675
676
677 public boolean removeJob(fr.in2p3.jsaga.generated.session.Job vJob)
678 {
679 boolean removed = _jobList.remove(vJob);
680 return removed;
681 }
682
683
684
685
686
687
688
689
690
691 public boolean removeResource(fr.in2p3.jsaga.generated.session.Resource vResource)
692 {
693 boolean removed = _resourceList.remove(vResource);
694 return removed;
695 }
696
697
698
699
700
701
702
703
704
705 public void setData(int index, fr.in2p3.jsaga.generated.session.Data vData)
706 throws java.lang.IndexOutOfBoundsException
707 {
708
709 if ((index < 0) || (index > _dataList.size())) {
710 throw new IndexOutOfBoundsException();
711 }
712 _dataList.set(index, vData);
713 }
714
715
716
717
718
719
720
721
722 public void setData(fr.in2p3.jsaga.generated.session.Data[] dataArray)
723 {
724
725 _dataList.clear();
726 for (int i = 0; i < dataArray.length; i++) {
727 _dataList.add(dataArray[i]);
728 }
729 }
730
731
732
733
734
735
736
737
738
739 public void setExclude(int index, fr.in2p3.jsaga.generated.session.Exclude vExclude)
740 throws java.lang.IndexOutOfBoundsException
741 {
742
743 if ((index < 0) || (index > _excludeList.size())) {
744 throw new IndexOutOfBoundsException();
745 }
746 _excludeList.set(index, vExclude);
747 }
748
749
750
751
752
753
754
755
756 public void setExclude(fr.in2p3.jsaga.generated.session.Exclude[] excludeArray)
757 {
758
759 _excludeList.clear();
760 for (int i = 0; i < excludeArray.length; i++) {
761 _excludeList.add(excludeArray[i]);
762 }
763 }
764
765
766
767
768
769
770 public void setId(java.lang.String id)
771 {
772 this._id = id;
773 }
774
775
776
777
778
779
780
781
782
783 public void setInclude(int index, fr.in2p3.jsaga.generated.session.Include vInclude)
784 throws java.lang.IndexOutOfBoundsException
785 {
786
787 if ((index < 0) || (index > _includeList.size())) {
788 throw new IndexOutOfBoundsException();
789 }
790 _includeList.set(index, vInclude);
791 }
792
793
794
795
796
797
798
799
800 public void setInclude(fr.in2p3.jsaga.generated.session.Include[] includeArray)
801 {
802
803 _includeList.clear();
804 for (int i = 0; i < includeArray.length; i++) {
805 _includeList.add(includeArray[i]);
806 }
807 }
808
809
810
811
812
813
814
815
816
817 public void setJob(int index, fr.in2p3.jsaga.generated.session.Job vJob)
818 throws java.lang.IndexOutOfBoundsException
819 {
820
821 if ((index < 0) || (index > _jobList.size())) {
822 throw new IndexOutOfBoundsException();
823 }
824 _jobList.set(index, vJob);
825 }
826
827
828
829
830
831
832
833
834 public void setJob(fr.in2p3.jsaga.generated.session.Job[] jobArray)
835 {
836
837 _jobList.clear();
838 for (int i = 0; i < jobArray.length; i++) {
839 _jobList.add(jobArray[i]);
840 }
841 }
842
843
844
845
846
847
848
849
850
851 public void setResource(int index, fr.in2p3.jsaga.generated.session.Resource vResource)
852 throws java.lang.IndexOutOfBoundsException
853 {
854
855 if ((index < 0) || (index > _resourceList.size())) {
856 throw new IndexOutOfBoundsException();
857 }
858 _resourceList.set(index, vResource);
859 }
860
861
862
863
864
865
866
867
868 public void setResource(fr.in2p3.jsaga.generated.session.Resource[] resourceArray)
869 {
870
871 _resourceList.clear();
872 for (int i = 0; i < resourceArray.length; i++) {
873 _resourceList.add(resourceArray[i]);
874 }
875 }
876
877
878
879
880
881
882
883
884
885 public static java.lang.Object unmarshal(java.io.Reader reader)
886 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
887 {
888 return (fr.in2p3.jsaga.generated.session.Context) Unmarshaller.unmarshal(fr.in2p3.jsaga.generated.session.Context.class, reader);
889 }
890
891
892
893
894
895 public void validate()
896 throws org.exolab.castor.xml.ValidationException
897 {
898 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
899 validator.validate(this);
900 }
901
902 }