View Javadoc

1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package fr.in2p3.jsaga.generated.session;
9   
10    //---------------------------------/
11   //- Imported classes and packages -/
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   * Class Context.
28   * 
29   * @version $Revision$ $Date$
30   */
31  public class Context extends fr.in2p3.jsaga.generated.session.ConfigurableType 
32  implements java.io.Serializable
33  {
34  
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * Field _id
42       */
43      private java.lang.String _id;
44  
45      /**
46       * Field _dataList
47       */
48      private java.util.ArrayList _dataList;
49  
50      /**
51       * Field _jobList
52       */
53      private java.util.ArrayList _jobList;
54  
55      /**
56       * Field _includeList
57       */
58      private java.util.ArrayList _includeList;
59  
60      /**
61       * Field _excludeList
62       */
63      private java.util.ArrayList _excludeList;
64  
65  
66        //----------------/
67       //- Constructors -/
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      } //-- fr.in2p3.jsaga.generated.session.Context()
78  
79  
80        //-----------/
81       //- Methods -/
82      //-----------/
83  
84      /**
85       * Method addData
86       * 
87       * 
88       * 
89       * @param vData
90       */
91      public void addData(fr.in2p3.jsaga.generated.session.Data vData)
92          throws java.lang.IndexOutOfBoundsException
93      {
94          _dataList.add(vData);
95      } //-- void addData(fr.in2p3.jsaga.generated.session.Data) 
96  
97      /**
98       * Method addData
99       * 
100      * 
101      * 
102      * @param index
103      * @param vData
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     } //-- void addData(int, fr.in2p3.jsaga.generated.session.Data) 
110 
111     /**
112      * Method addExclude
113      * 
114      * 
115      * 
116      * @param vExclude
117      */
118     public void addExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
119         throws java.lang.IndexOutOfBoundsException
120     {
121         _excludeList.add(vExclude);
122     } //-- void addExclude(fr.in2p3.jsaga.generated.session.Exclude) 
123 
124     /**
125      * Method addExclude
126      * 
127      * 
128      * 
129      * @param index
130      * @param vExclude
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     } //-- void addExclude(int, fr.in2p3.jsaga.generated.session.Exclude) 
137 
138     /**
139      * Method addInclude
140      * 
141      * 
142      * 
143      * @param vInclude
144      */
145     public void addInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
146         throws java.lang.IndexOutOfBoundsException
147     {
148         _includeList.add(vInclude);
149     } //-- void addInclude(fr.in2p3.jsaga.generated.session.Include) 
150 
151     /**
152      * Method addInclude
153      * 
154      * 
155      * 
156      * @param index
157      * @param vInclude
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     } //-- void addInclude(int, fr.in2p3.jsaga.generated.session.Include) 
164 
165     /**
166      * Method addJob
167      * 
168      * 
169      * 
170      * @param vJob
171      */
172     public void addJob(fr.in2p3.jsaga.generated.session.Job vJob)
173         throws java.lang.IndexOutOfBoundsException
174     {
175         _jobList.add(vJob);
176     } //-- void addJob(fr.in2p3.jsaga.generated.session.Job) 
177 
178     /**
179      * Method addJob
180      * 
181      * 
182      * 
183      * @param index
184      * @param vJob
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     } //-- void addJob(int, fr.in2p3.jsaga.generated.session.Job) 
191 
192     /**
193      * Method clearData
194      * 
195      */
196     public void clearData()
197     {
198         _dataList.clear();
199     } //-- void clearData() 
200 
201     /**
202      * Method clearExclude
203      * 
204      */
205     public void clearExclude()
206     {
207         _excludeList.clear();
208     } //-- void clearExclude() 
209 
210     /**
211      * Method clearInclude
212      * 
213      */
214     public void clearInclude()
215     {
216         _includeList.clear();
217     } //-- void clearInclude() 
218 
219     /**
220      * Method clearJob
221      * 
222      */
223     public void clearJob()
224     {
225         _jobList.clear();
226     } //-- void clearJob() 
227 
228     /**
229      * Method enumerateData
230      * 
231      * 
232      * 
233      * @return Enumeration
234      */
235     public java.util.Enumeration enumerateData()
236     {
237         return new org.exolab.castor.util.IteratorEnumeration(_dataList.iterator());
238     } //-- java.util.Enumeration enumerateData() 
239 
240     /**
241      * Method enumerateExclude
242      * 
243      * 
244      * 
245      * @return Enumeration
246      */
247     public java.util.Enumeration enumerateExclude()
248     {
249         return new org.exolab.castor.util.IteratorEnumeration(_excludeList.iterator());
250     } //-- java.util.Enumeration enumerateExclude() 
251 
252     /**
253      * Method enumerateInclude
254      * 
255      * 
256      * 
257      * @return Enumeration
258      */
259     public java.util.Enumeration enumerateInclude()
260     {
261         return new org.exolab.castor.util.IteratorEnumeration(_includeList.iterator());
262     } //-- java.util.Enumeration enumerateInclude() 
263 
264     /**
265      * Method enumerateJob
266      * 
267      * 
268      * 
269      * @return Enumeration
270      */
271     public java.util.Enumeration enumerateJob()
272     {
273         return new org.exolab.castor.util.IteratorEnumeration(_jobList.iterator());
274     } //-- java.util.Enumeration enumerateJob() 
275 
276     /**
277      * Method getData
278      * 
279      * 
280      * 
281      * @param index
282      * @return Data
283      */
284     public fr.in2p3.jsaga.generated.session.Data getData(int index)
285         throws java.lang.IndexOutOfBoundsException
286     {
287         //-- check bounds for index
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     } //-- fr.in2p3.jsaga.generated.session.Data getData(int) 
294 
295     /**
296      * Method getData
297      * 
298      * 
299      * 
300      * @return Data
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     } //-- fr.in2p3.jsaga.generated.session.Data[] getData() 
311 
312     /**
313      * Method getDataCount
314      * 
315      * 
316      * 
317      * @return int
318      */
319     public int getDataCount()
320     {
321         return _dataList.size();
322     } //-- int getDataCount() 
323 
324     /**
325      * Method getExclude
326      * 
327      * 
328      * 
329      * @param index
330      * @return Exclude
331      */
332     public fr.in2p3.jsaga.generated.session.Exclude getExclude(int index)
333         throws java.lang.IndexOutOfBoundsException
334     {
335         //-- check bounds for index
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     } //-- fr.in2p3.jsaga.generated.session.Exclude getExclude(int) 
342 
343     /**
344      * Method getExclude
345      * 
346      * 
347      * 
348      * @return Exclude
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     } //-- fr.in2p3.jsaga.generated.session.Exclude[] getExclude() 
359 
360     /**
361      * Method getExcludeCount
362      * 
363      * 
364      * 
365      * @return int
366      */
367     public int getExcludeCount()
368     {
369         return _excludeList.size();
370     } //-- int getExcludeCount() 
371 
372     /**
373      * Returns the value of field 'id'.
374      * 
375      * @return String
376      * @return the value of field 'id'.
377      */
378     public java.lang.String getId()
379     {
380         return this._id;
381     } //-- java.lang.String getId() 
382 
383     /**
384      * Method getInclude
385      * 
386      * 
387      * 
388      * @param index
389      * @return Include
390      */
391     public fr.in2p3.jsaga.generated.session.Include getInclude(int index)
392         throws java.lang.IndexOutOfBoundsException
393     {
394         //-- check bounds for index
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     } //-- fr.in2p3.jsaga.generated.session.Include getInclude(int) 
401 
402     /**
403      * Method getInclude
404      * 
405      * 
406      * 
407      * @return Include
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     } //-- fr.in2p3.jsaga.generated.session.Include[] getInclude() 
418 
419     /**
420      * Method getIncludeCount
421      * 
422      * 
423      * 
424      * @return int
425      */
426     public int getIncludeCount()
427     {
428         return _includeList.size();
429     } //-- int getIncludeCount() 
430 
431     /**
432      * Method getJob
433      * 
434      * 
435      * 
436      * @param index
437      * @return Job
438      */
439     public fr.in2p3.jsaga.generated.session.Job getJob(int index)
440         throws java.lang.IndexOutOfBoundsException
441     {
442         //-- check bounds for index
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     } //-- fr.in2p3.jsaga.generated.session.Job getJob(int) 
449 
450     /**
451      * Method getJob
452      * 
453      * 
454      * 
455      * @return Job
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     } //-- fr.in2p3.jsaga.generated.session.Job[] getJob() 
466 
467     /**
468      * Method getJobCount
469      * 
470      * 
471      * 
472      * @return int
473      */
474     public int getJobCount()
475     {
476         return _jobList.size();
477     } //-- int getJobCount() 
478 
479     /**
480      * Method isValid
481      * 
482      * 
483      * 
484      * @return boolean
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     } //-- boolean isValid() 
496 
497     /**
498      * Method marshal
499      * 
500      * 
501      * 
502      * @param out
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     } //-- void marshal(java.io.Writer) 
510 
511     /**
512      * Method marshal
513      * 
514      * 
515      * 
516      * @param handler
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     } //-- void marshal(org.xml.sax.ContentHandler) 
524 
525     /**
526      * Method removeData
527      * 
528      * 
529      * 
530      * @param vData
531      * @return boolean
532      */
533     public boolean removeData(fr.in2p3.jsaga.generated.session.Data vData)
534     {
535         boolean removed = _dataList.remove(vData);
536         return removed;
537     } //-- boolean removeData(fr.in2p3.jsaga.generated.session.Data) 
538 
539     /**
540      * Method removeExclude
541      * 
542      * 
543      * 
544      * @param vExclude
545      * @return boolean
546      */
547     public boolean removeExclude(fr.in2p3.jsaga.generated.session.Exclude vExclude)
548     {
549         boolean removed = _excludeList.remove(vExclude);
550         return removed;
551     } //-- boolean removeExclude(fr.in2p3.jsaga.generated.session.Exclude) 
552 
553     /**
554      * Method removeInclude
555      * 
556      * 
557      * 
558      * @param vInclude
559      * @return boolean
560      */
561     public boolean removeInclude(fr.in2p3.jsaga.generated.session.Include vInclude)
562     {
563         boolean removed = _includeList.remove(vInclude);
564         return removed;
565     } //-- boolean removeInclude(fr.in2p3.jsaga.generated.session.Include) 
566 
567     /**
568      * Method removeJob
569      * 
570      * 
571      * 
572      * @param vJob
573      * @return boolean
574      */
575     public boolean removeJob(fr.in2p3.jsaga.generated.session.Job vJob)
576     {
577         boolean removed = _jobList.remove(vJob);
578         return removed;
579     } //-- boolean removeJob(fr.in2p3.jsaga.generated.session.Job) 
580 
581     /**
582      * Method setData
583      * 
584      * 
585      * 
586      * @param index
587      * @param vData
588      */
589     public void setData(int index, fr.in2p3.jsaga.generated.session.Data vData)
590         throws java.lang.IndexOutOfBoundsException
591     {
592         //-- check bounds for index
593         if ((index < 0) || (index > _dataList.size())) {
594             throw new IndexOutOfBoundsException();
595         }
596         _dataList.set(index, vData);
597     } //-- void setData(int, fr.in2p3.jsaga.generated.session.Data) 
598 
599     /**
600      * Method setData
601      * 
602      * 
603      * 
604      * @param dataArray
605      */
606     public void setData(fr.in2p3.jsaga.generated.session.Data[] dataArray)
607     {
608         //-- copy array
609         _dataList.clear();
610         for (int i = 0; i < dataArray.length; i++) {
611             _dataList.add(dataArray[i]);
612         }
613     } //-- void setData(fr.in2p3.jsaga.generated.session.Data) 
614 
615     /**
616      * Method setExclude
617      * 
618      * 
619      * 
620      * @param index
621      * @param vExclude
622      */
623     public void setExclude(int index, fr.in2p3.jsaga.generated.session.Exclude vExclude)
624         throws java.lang.IndexOutOfBoundsException
625     {
626         //-- check bounds for index
627         if ((index < 0) || (index > _excludeList.size())) {
628             throw new IndexOutOfBoundsException();
629         }
630         _excludeList.set(index, vExclude);
631     } //-- void setExclude(int, fr.in2p3.jsaga.generated.session.Exclude) 
632 
633     /**
634      * Method setExclude
635      * 
636      * 
637      * 
638      * @param excludeArray
639      */
640     public void setExclude(fr.in2p3.jsaga.generated.session.Exclude[] excludeArray)
641     {
642         //-- copy array
643         _excludeList.clear();
644         for (int i = 0; i < excludeArray.length; i++) {
645             _excludeList.add(excludeArray[i]);
646         }
647     } //-- void setExclude(fr.in2p3.jsaga.generated.session.Exclude) 
648 
649     /**
650      * Sets the value of field 'id'.
651      * 
652      * @param id the value of field 'id'.
653      */
654     public void setId(java.lang.String id)
655     {
656         this._id = id;
657     } //-- void setId(java.lang.String) 
658 
659     /**
660      * Method setInclude
661      * 
662      * 
663      * 
664      * @param index
665      * @param vInclude
666      */
667     public void setInclude(int index, fr.in2p3.jsaga.generated.session.Include vInclude)
668         throws java.lang.IndexOutOfBoundsException
669     {
670         //-- check bounds for index
671         if ((index < 0) || (index > _includeList.size())) {
672             throw new IndexOutOfBoundsException();
673         }
674         _includeList.set(index, vInclude);
675     } //-- void setInclude(int, fr.in2p3.jsaga.generated.session.Include) 
676 
677     /**
678      * Method setInclude
679      * 
680      * 
681      * 
682      * @param includeArray
683      */
684     public void setInclude(fr.in2p3.jsaga.generated.session.Include[] includeArray)
685     {
686         //-- copy array
687         _includeList.clear();
688         for (int i = 0; i < includeArray.length; i++) {
689             _includeList.add(includeArray[i]);
690         }
691     } //-- void setInclude(fr.in2p3.jsaga.generated.session.Include) 
692 
693     /**
694      * Method setJob
695      * 
696      * 
697      * 
698      * @param index
699      * @param vJob
700      */
701     public void setJob(int index, fr.in2p3.jsaga.generated.session.Job vJob)
702         throws java.lang.IndexOutOfBoundsException
703     {
704         //-- check bounds for index
705         if ((index < 0) || (index > _jobList.size())) {
706             throw new IndexOutOfBoundsException();
707         }
708         _jobList.set(index, vJob);
709     } //-- void setJob(int, fr.in2p3.jsaga.generated.session.Job) 
710 
711     /**
712      * Method setJob
713      * 
714      * 
715      * 
716      * @param jobArray
717      */
718     public void setJob(fr.in2p3.jsaga.generated.session.Job[] jobArray)
719     {
720         //-- copy array
721         _jobList.clear();
722         for (int i = 0; i < jobArray.length; i++) {
723             _jobList.add(jobArray[i]);
724         }
725     } //-- void setJob(fr.in2p3.jsaga.generated.session.Job) 
726 
727     /**
728      * Method unmarshal
729      * 
730      * 
731      * 
732      * @param reader
733      * @return Object
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     } //-- java.lang.Object unmarshal(java.io.Reader) 
740 
741     /**
742      * Method validate
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     } //-- void validate() 
751 
752 }