synchronized with last schema revision.
[vamsas.git] / src / org / vamsas / objects / core / VamsasDocument.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
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.Enumeration;
19 import java.util.Vector;
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 VamsasDocument.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class VamsasDocument extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Vamsas Document Version Number
42      */
43     private java.lang.String _version;
44
45     /**
46      * Field _lockFile
47      */
48     private org.vamsas.objects.core.LockFile _lockFile;
49
50     /**
51      * Field _provenance
52      */
53     private Provenance _provenance;
54
55     /**
56      * Field _VAMSASList
57      */
58     private java.util.Vector _VAMSASList;
59
60     /**
61      * Field _applicationDataList
62      */
63     private java.util.Vector _applicationDataList;
64
65
66       //----------------/
67      //- Constructors -/
68     //----------------/
69
70     public VamsasDocument() 
71      {
72         super();
73         _VAMSASList = new Vector();
74         _applicationDataList = new Vector();
75     } //-- org.vamsas.objects.core.VamsasDocument()
76
77
78       //-----------/
79      //- Methods -/
80     //-----------/
81
82     /**
83      * Method addApplicationData
84      * 
85      * 
86      * 
87      * @param vApplicationData
88      */
89     public void addApplicationData(ApplicationData vApplicationData)
90         throws java.lang.IndexOutOfBoundsException
91     {
92         _applicationDataList.addElement(vApplicationData);
93     } //-- void addApplicationData(ApplicationData) 
94
95     /**
96      * Method addApplicationData
97      * 
98      * 
99      * 
100      * @param index
101      * @param vApplicationData
102      */
103     public void addApplicationData(int index, ApplicationData vApplicationData)
104         throws java.lang.IndexOutOfBoundsException
105     {
106         _applicationDataList.insertElementAt(vApplicationData, index);
107     } //-- void addApplicationData(int, ApplicationData) 
108
109     /**
110      * Method addVAMSAS
111      * 
112      * 
113      * 
114      * @param vVAMSAS
115      */
116     public void addVAMSAS(VAMSAS vVAMSAS)
117         throws java.lang.IndexOutOfBoundsException
118     {
119         _VAMSASList.addElement(vVAMSAS);
120     } //-- void addVAMSAS(VAMSAS) 
121
122     /**
123      * Method addVAMSAS
124      * 
125      * 
126      * 
127      * @param index
128      * @param vVAMSAS
129      */
130     public void addVAMSAS(int index, VAMSAS vVAMSAS)
131         throws java.lang.IndexOutOfBoundsException
132     {
133         _VAMSASList.insertElementAt(vVAMSAS, index);
134     } //-- void addVAMSAS(int, VAMSAS) 
135
136     /**
137      * Method enumerateApplicationData
138      * 
139      * 
140      * 
141      * @return Enumeration
142      */
143     public java.util.Enumeration enumerateApplicationData()
144     {
145         return _applicationDataList.elements();
146     } //-- java.util.Enumeration enumerateApplicationData() 
147
148     /**
149      * Method enumerateVAMSAS
150      * 
151      * 
152      * 
153      * @return Enumeration
154      */
155     public java.util.Enumeration enumerateVAMSAS()
156     {
157         return _VAMSASList.elements();
158     } //-- java.util.Enumeration enumerateVAMSAS() 
159
160     /**
161      * Note: hashCode() has not been overriden
162      * 
163      * @param obj
164      * @return boolean
165      */
166     public boolean equals(java.lang.Object obj)
167     {
168         if ( this == obj )
169             return true;
170         
171         if (super.equals(obj)==false)
172             return false;
173         
174         if (obj instanceof VamsasDocument) {
175         
176             VamsasDocument temp = (VamsasDocument)obj;
177             if (this._version != null) {
178                 if (temp._version == null) return false;
179                 else if (!(this._version.equals(temp._version))) 
180                     return false;
181             }
182             else if (temp._version != null)
183                 return false;
184             if (this._lockFile != null) {
185                 if (temp._lockFile == null) return false;
186                 else if (!(this._lockFile.equals(temp._lockFile))) 
187                     return false;
188             }
189             else if (temp._lockFile != null)
190                 return false;
191             if (this._provenance != null) {
192                 if (temp._provenance == null) return false;
193                 else if (!(this._provenance.equals(temp._provenance))) 
194                     return false;
195             }
196             else if (temp._provenance != null)
197                 return false;
198             if (this._VAMSASList != null) {
199                 if (temp._VAMSASList == null) return false;
200                 else if (!(this._VAMSASList.equals(temp._VAMSASList))) 
201                     return false;
202             }
203             else if (temp._VAMSASList != null)
204                 return false;
205             if (this._applicationDataList != null) {
206                 if (temp._applicationDataList == null) return false;
207                 else if (!(this._applicationDataList.equals(temp._applicationDataList))) 
208                     return false;
209             }
210             else if (temp._applicationDataList != null)
211                 return false;
212             return true;
213         }
214         return false;
215     } //-- boolean equals(java.lang.Object) 
216
217     /**
218      * Method getApplicationData
219      * 
220      * 
221      * 
222      * @param index
223      * @return ApplicationData
224      */
225     public ApplicationData getApplicationData(int index)
226         throws java.lang.IndexOutOfBoundsException
227     {
228         //-- check bounds for index
229         if ((index < 0) || (index > _applicationDataList.size())) {
230             throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
231         }
232         
233         return (ApplicationData) _applicationDataList.elementAt(index);
234     } //-- ApplicationData getApplicationData(int) 
235
236     /**
237      * Method getApplicationData
238      * 
239      * 
240      * 
241      * @return ApplicationData
242      */
243     public ApplicationData[] getApplicationData()
244     {
245         int size = _applicationDataList.size();
246         ApplicationData[] mArray = new ApplicationData[size];
247         for (int index = 0; index < size; index++) {
248             mArray[index] = (ApplicationData) _applicationDataList.elementAt(index);
249         }
250         return mArray;
251     } //-- ApplicationData[] getApplicationData() 
252
253     /**
254      * Method getApplicationDataCount
255      * 
256      * 
257      * 
258      * @return int
259      */
260     public int getApplicationDataCount()
261     {
262         return _applicationDataList.size();
263     } //-- int getApplicationDataCount() 
264
265     /**
266      * Returns the value of field 'lockFile'.
267      * 
268      * @return LockFile
269      * @return the value of field 'lockFile'.
270      */
271     public org.vamsas.objects.core.LockFile getLockFile()
272     {
273         return this._lockFile;
274     } //-- org.vamsas.objects.core.LockFile getLockFile() 
275
276     /**
277      * Returns the value of field 'provenance'.
278      * 
279      * @return Provenance
280      * @return the value of field 'provenance'.
281      */
282     public Provenance getProvenance()
283     {
284         return this._provenance;
285     } //-- Provenance getProvenance() 
286
287     /**
288      * Method getVAMSAS
289      * 
290      * 
291      * 
292      * @param index
293      * @return VAMSAS
294      */
295     public VAMSAS getVAMSAS(int index)
296         throws java.lang.IndexOutOfBoundsException
297     {
298         //-- check bounds for index
299         if ((index < 0) || (index > _VAMSASList.size())) {
300             throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
301         }
302         
303         return (VAMSAS) _VAMSASList.elementAt(index);
304     } //-- VAMSAS getVAMSAS(int) 
305
306     /**
307      * Method getVAMSAS
308      * 
309      * 
310      * 
311      * @return VAMSAS
312      */
313     public VAMSAS[] getVAMSAS()
314     {
315         int size = _VAMSASList.size();
316         VAMSAS[] mArray = new VAMSAS[size];
317         for (int index = 0; index < size; index++) {
318             mArray[index] = (VAMSAS) _VAMSASList.elementAt(index);
319         }
320         return mArray;
321     } //-- VAMSAS[] getVAMSAS() 
322
323     /**
324      * Method getVAMSASCount
325      * 
326      * 
327      * 
328      * @return int
329      */
330     public int getVAMSASCount()
331     {
332         return _VAMSASList.size();
333     } //-- int getVAMSASCount() 
334
335     /**
336      * Returns the value of field 'version'. The field 'version'
337      * has the following description: Vamsas Document Version
338      * Number
339      * 
340      * @return String
341      * @return the value of field 'version'.
342      */
343     public java.lang.String getVersion()
344     {
345         return this._version;
346     } //-- java.lang.String getVersion() 
347
348     /**
349      * Method isValid
350      * 
351      * 
352      * 
353      * @return boolean
354      */
355     public boolean isValid()
356     {
357         try {
358             validate();
359         }
360         catch (org.exolab.castor.xml.ValidationException vex) {
361             return false;
362         }
363         return true;
364     } //-- boolean isValid() 
365
366     /**
367      * Method marshal
368      * 
369      * 
370      * 
371      * @param out
372      */
373     public void marshal(java.io.Writer out)
374         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
375     {
376         
377         Marshaller.marshal(this, out);
378     } //-- void marshal(java.io.Writer) 
379
380     /**
381      * Method marshal
382      * 
383      * 
384      * 
385      * @param handler
386      */
387     public void marshal(org.xml.sax.ContentHandler handler)
388         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
389     {
390         
391         Marshaller.marshal(this, handler);
392     } //-- void marshal(org.xml.sax.ContentHandler) 
393
394     /**
395      * Method removeAllApplicationData
396      * 
397      */
398     public void removeAllApplicationData()
399     {
400         _applicationDataList.removeAllElements();
401     } //-- void removeAllApplicationData() 
402
403     /**
404      * Method removeAllVAMSAS
405      * 
406      */
407     public void removeAllVAMSAS()
408     {
409         _VAMSASList.removeAllElements();
410     } //-- void removeAllVAMSAS() 
411
412     /**
413      * Method removeApplicationData
414      * 
415      * 
416      * 
417      * @param index
418      * @return ApplicationData
419      */
420     public ApplicationData removeApplicationData(int index)
421     {
422         java.lang.Object obj = _applicationDataList.elementAt(index);
423         _applicationDataList.removeElementAt(index);
424         return (ApplicationData) obj;
425     } //-- ApplicationData removeApplicationData(int) 
426
427     /**
428      * Method removeVAMSAS
429      * 
430      * 
431      * 
432      * @param index
433      * @return VAMSAS
434      */
435     public VAMSAS removeVAMSAS(int index)
436     {
437         java.lang.Object obj = _VAMSASList.elementAt(index);
438         _VAMSASList.removeElementAt(index);
439         return (VAMSAS) obj;
440     } //-- VAMSAS removeVAMSAS(int) 
441
442     /**
443      * Method setApplicationData
444      * 
445      * 
446      * 
447      * @param index
448      * @param vApplicationData
449      */
450     public void setApplicationData(int index, ApplicationData vApplicationData)
451         throws java.lang.IndexOutOfBoundsException
452     {
453         //-- check bounds for index
454         if ((index < 0) || (index > _applicationDataList.size())) {
455             throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
456         }
457         _applicationDataList.setElementAt(vApplicationData, index);
458     } //-- void setApplicationData(int, ApplicationData) 
459
460     /**
461      * Method setApplicationData
462      * 
463      * 
464      * 
465      * @param applicationDataArray
466      */
467     public void setApplicationData(ApplicationData[] applicationDataArray)
468     {
469         //-- copy array
470         _applicationDataList.removeAllElements();
471         for (int i = 0; i < applicationDataArray.length; i++) {
472             _applicationDataList.addElement(applicationDataArray[i]);
473         }
474     } //-- void setApplicationData(ApplicationData) 
475
476     /**
477      * Sets the value of field 'lockFile'.
478      * 
479      * @param lockFile the value of field 'lockFile'.
480      */
481     public void setLockFile(org.vamsas.objects.core.LockFile lockFile)
482     {
483         this._lockFile = lockFile;
484     } //-- void setLockFile(org.vamsas.objects.core.LockFile) 
485
486     /**
487      * Sets the value of field 'provenance'.
488      * 
489      * @param provenance the value of field 'provenance'.
490      */
491     public void setProvenance(Provenance provenance)
492     {
493         this._provenance = provenance;
494     } //-- void setProvenance(Provenance) 
495
496     /**
497      * Method setVAMSAS
498      * 
499      * 
500      * 
501      * @param index
502      * @param vVAMSAS
503      */
504     public void setVAMSAS(int index, VAMSAS vVAMSAS)
505         throws java.lang.IndexOutOfBoundsException
506     {
507         //-- check bounds for index
508         if ((index < 0) || (index > _VAMSASList.size())) {
509             throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
510         }
511         _VAMSASList.setElementAt(vVAMSAS, index);
512     } //-- void setVAMSAS(int, VAMSAS) 
513
514     /**
515      * Method setVAMSAS
516      * 
517      * 
518      * 
519      * @param VAMSASArray
520      */
521     public void setVAMSAS(VAMSAS[] VAMSASArray)
522     {
523         //-- copy array
524         _VAMSASList.removeAllElements();
525         for (int i = 0; i < VAMSASArray.length; i++) {
526             _VAMSASList.addElement(VAMSASArray[i]);
527         }
528     } //-- void setVAMSAS(VAMSAS) 
529
530     /**
531      * Sets the value of field 'version'. The field 'version' has
532      * the following description: Vamsas Document Version Number
533      * 
534      * @param version the value of field 'version'.
535      */
536     public void setVersion(java.lang.String version)
537     {
538         this._version = version;
539     } //-- void setVersion(java.lang.String) 
540
541     /**
542      * Method unmarshal
543      * 
544      * 
545      * 
546      * @param reader
547      * @return VamsasDocument
548      */
549     public static org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader)
550         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
551     {
552         return (org.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(org.vamsas.objects.core.VamsasDocument.class, reader);
553     } //-- org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader) 
554
555     /**
556      * Method validate
557      * 
558      */
559     public void validate()
560         throws org.exolab.castor.xml.ValidationException
561     {
562         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
563         validator.validate(this);
564     } //-- void validate() 
565
566 }