autogenerated java classes for current schema
[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.Vobject 
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      * contains unassociated trees and a number of analysis
57      *  sets
58      *  
59      */
60     private java.util.Vector _VAMSASList;
61
62     /**
63      * Field _applicationDataList
64      */
65     private java.util.Vector _applicationDataList;
66
67     /**
68      * Field _attachmentList
69      */
70     private java.util.Vector _attachmentList;
71
72
73       //----------------/
74      //- Constructors -/
75     //----------------/
76
77     public VamsasDocument() 
78      {
79         super();
80         _VAMSASList = new Vector();
81         _applicationDataList = new Vector();
82         _attachmentList = new Vector();
83     } //-- org.vamsas.objects.core.VamsasDocument()
84
85
86       //-----------/
87      //- Methods -/
88     //-----------/
89
90     /**
91      * Method addApplicationData
92      * 
93      * 
94      * 
95      * @param vApplicationData
96      */
97     public void addApplicationData(ApplicationData vApplicationData)
98         throws java.lang.IndexOutOfBoundsException
99     {
100         _applicationDataList.addElement(vApplicationData);
101     } //-- void addApplicationData(ApplicationData) 
102
103     /**
104      * Method addApplicationData
105      * 
106      * 
107      * 
108      * @param index
109      * @param vApplicationData
110      */
111     public void addApplicationData(int index, ApplicationData vApplicationData)
112         throws java.lang.IndexOutOfBoundsException
113     {
114         _applicationDataList.insertElementAt(vApplicationData, index);
115     } //-- void addApplicationData(int, ApplicationData) 
116
117     /**
118      * Method addAttachment
119      * 
120      * 
121      * 
122      * @param vAttachment
123      */
124     public void addAttachment(Attachment vAttachment)
125         throws java.lang.IndexOutOfBoundsException
126     {
127         _attachmentList.addElement(vAttachment);
128     } //-- void addAttachment(Attachment) 
129
130     /**
131      * Method addAttachment
132      * 
133      * 
134      * 
135      * @param index
136      * @param vAttachment
137      */
138     public void addAttachment(int index, Attachment vAttachment)
139         throws java.lang.IndexOutOfBoundsException
140     {
141         _attachmentList.insertElementAt(vAttachment, index);
142     } //-- void addAttachment(int, Attachment) 
143
144     /**
145      * Method addVAMSAS
146      * 
147      * 
148      * 
149      * @param vVAMSAS
150      */
151     public void addVAMSAS(VAMSAS vVAMSAS)
152         throws java.lang.IndexOutOfBoundsException
153     {
154         _VAMSASList.addElement(vVAMSAS);
155     } //-- void addVAMSAS(VAMSAS) 
156
157     /**
158      * Method addVAMSAS
159      * 
160      * 
161      * 
162      * @param index
163      * @param vVAMSAS
164      */
165     public void addVAMSAS(int index, VAMSAS vVAMSAS)
166         throws java.lang.IndexOutOfBoundsException
167     {
168         _VAMSASList.insertElementAt(vVAMSAS, index);
169     } //-- void addVAMSAS(int, VAMSAS) 
170
171     /**
172      * Method enumerateApplicationData
173      * 
174      * 
175      * 
176      * @return Enumeration
177      */
178     public java.util.Enumeration enumerateApplicationData()
179     {
180         return _applicationDataList.elements();
181     } //-- java.util.Enumeration enumerateApplicationData() 
182
183     /**
184      * Method enumerateAttachment
185      * 
186      * 
187      * 
188      * @return Enumeration
189      */
190     public java.util.Enumeration enumerateAttachment()
191     {
192         return _attachmentList.elements();
193     } //-- java.util.Enumeration enumerateAttachment() 
194
195     /**
196      * Method enumerateVAMSAS
197      * 
198      * 
199      * 
200      * @return Enumeration
201      */
202     public java.util.Enumeration enumerateVAMSAS()
203     {
204         return _VAMSASList.elements();
205     } //-- java.util.Enumeration enumerateVAMSAS() 
206
207     /**
208      * Note: hashCode() has not been overriden
209      * 
210      * @param obj
211      * @return boolean
212      */
213     public boolean equals(java.lang.Object obj)
214     {
215         if ( this == obj )
216             return true;
217         
218         if (super.equals(obj)==false)
219             return false;
220         
221         if (obj instanceof VamsasDocument) {
222         
223             VamsasDocument temp = (VamsasDocument)obj;
224             if (this._version != null) {
225                 if (temp._version == null) return false;
226                 else if (!(this._version.equals(temp._version))) 
227                     return false;
228             }
229             else if (temp._version != null)
230                 return false;
231             if (this._lockFile != null) {
232                 if (temp._lockFile == null) return false;
233                 else if (!(this._lockFile.equals(temp._lockFile))) 
234                     return false;
235             }
236             else if (temp._lockFile != null)
237                 return false;
238             if (this._provenance != null) {
239                 if (temp._provenance == null) return false;
240                 else if (!(this._provenance.equals(temp._provenance))) 
241                     return false;
242             }
243             else if (temp._provenance != null)
244                 return false;
245             if (this._VAMSASList != null) {
246                 if (temp._VAMSASList == null) return false;
247                 else if (!(this._VAMSASList.equals(temp._VAMSASList))) 
248                     return false;
249             }
250             else if (temp._VAMSASList != null)
251                 return false;
252             if (this._applicationDataList != null) {
253                 if (temp._applicationDataList == null) return false;
254                 else if (!(this._applicationDataList.equals(temp._applicationDataList))) 
255                     return false;
256             }
257             else if (temp._applicationDataList != null)
258                 return false;
259             if (this._attachmentList != null) {
260                 if (temp._attachmentList == null) return false;
261                 else if (!(this._attachmentList.equals(temp._attachmentList))) 
262                     return false;
263             }
264             else if (temp._attachmentList != null)
265                 return false;
266             return true;
267         }
268         return false;
269     } //-- boolean equals(java.lang.Object) 
270
271     /**
272      * Method getApplicationData
273      * 
274      * 
275      * 
276      * @param index
277      * @return ApplicationData
278      */
279     public ApplicationData getApplicationData(int index)
280         throws java.lang.IndexOutOfBoundsException
281     {
282         //-- check bounds for index
283         if ((index < 0) || (index > _applicationDataList.size())) {
284             throw new IndexOutOfBoundsException("getApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
285         }
286         
287         return (ApplicationData) _applicationDataList.elementAt(index);
288     } //-- ApplicationData getApplicationData(int) 
289
290     /**
291      * Method getApplicationData
292      * 
293      * 
294      * 
295      * @return ApplicationData
296      */
297     public ApplicationData[] getApplicationData()
298     {
299         int size = _applicationDataList.size();
300         ApplicationData[] mArray = new ApplicationData[size];
301         for (int index = 0; index < size; index++) {
302             mArray[index] = (ApplicationData) _applicationDataList.elementAt(index);
303         }
304         return mArray;
305     } //-- ApplicationData[] getApplicationData() 
306
307     /**
308      * Method getApplicationDataCount
309      * 
310      * 
311      * 
312      * @return int
313      */
314     public int getApplicationDataCount()
315     {
316         return _applicationDataList.size();
317     } //-- int getApplicationDataCount() 
318
319     /**
320      * Method getAttachment
321      * 
322      * 
323      * 
324      * @param index
325      * @return Attachment
326      */
327     public Attachment getAttachment(int index)
328         throws java.lang.IndexOutOfBoundsException
329     {
330         //-- check bounds for index
331         if ((index < 0) || (index > _attachmentList.size())) {
332             throw new IndexOutOfBoundsException("getAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
333         }
334         
335         return (Attachment) _attachmentList.elementAt(index);
336     } //-- Attachment getAttachment(int) 
337
338     /**
339      * Method getAttachment
340      * 
341      * 
342      * 
343      * @return Attachment
344      */
345     public Attachment[] getAttachment()
346     {
347         int size = _attachmentList.size();
348         Attachment[] mArray = new Attachment[size];
349         for (int index = 0; index < size; index++) {
350             mArray[index] = (Attachment) _attachmentList.elementAt(index);
351         }
352         return mArray;
353     } //-- Attachment[] getAttachment() 
354
355     /**
356      * Method getAttachmentCount
357      * 
358      * 
359      * 
360      * @return int
361      */
362     public int getAttachmentCount()
363     {
364         return _attachmentList.size();
365     } //-- int getAttachmentCount() 
366
367     /**
368      * Returns the value of field 'lockFile'.
369      * 
370      * @return LockFile
371      * @return the value of field 'lockFile'.
372      */
373     public org.vamsas.objects.core.LockFile getLockFile()
374     {
375         return this._lockFile;
376     } //-- org.vamsas.objects.core.LockFile getLockFile() 
377
378     /**
379      * Returns the value of field 'provenance'.
380      * 
381      * @return Provenance
382      * @return the value of field 'provenance'.
383      */
384     public Provenance getProvenance()
385     {
386         return this._provenance;
387     } //-- Provenance getProvenance() 
388
389     /**
390      * Method getVAMSAS
391      * 
392      * 
393      * 
394      * @param index
395      * @return VAMSAS
396      */
397     public VAMSAS getVAMSAS(int index)
398         throws java.lang.IndexOutOfBoundsException
399     {
400         //-- check bounds for index
401         if ((index < 0) || (index > _VAMSASList.size())) {
402             throw new IndexOutOfBoundsException("getVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
403         }
404         
405         return (VAMSAS) _VAMSASList.elementAt(index);
406     } //-- VAMSAS getVAMSAS(int) 
407
408     /**
409      * Method getVAMSAS
410      * 
411      * 
412      * 
413      * @return VAMSAS
414      */
415     public VAMSAS[] getVAMSAS()
416     {
417         int size = _VAMSASList.size();
418         VAMSAS[] mArray = new VAMSAS[size];
419         for (int index = 0; index < size; index++) {
420             mArray[index] = (VAMSAS) _VAMSASList.elementAt(index);
421         }
422         return mArray;
423     } //-- VAMSAS[] getVAMSAS() 
424
425     /**
426      * Method getVAMSASCount
427      * 
428      * 
429      * 
430      * @return int
431      */
432     public int getVAMSASCount()
433     {
434         return _VAMSASList.size();
435     } //-- int getVAMSASCount() 
436
437     /**
438      * Returns the value of field 'version'. The field 'version'
439      * has the following description: Vamsas Document Version
440      * Number
441      * 
442      * @return String
443      * @return the value of field 'version'.
444      */
445     public java.lang.String getVersion()
446     {
447         return this._version;
448     } //-- java.lang.String getVersion() 
449
450     /**
451      * Method isValid
452      * 
453      * 
454      * 
455      * @return boolean
456      */
457     public boolean isValid()
458     {
459         try {
460             validate();
461         }
462         catch (org.exolab.castor.xml.ValidationException vex) {
463             return false;
464         }
465         return true;
466     } //-- boolean isValid() 
467
468     /**
469      * Method marshal
470      * 
471      * 
472      * 
473      * @param out
474      */
475     public void marshal(java.io.Writer out)
476         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
477     {
478         
479         Marshaller.marshal(this, out);
480     } //-- void marshal(java.io.Writer) 
481
482     /**
483      * Method marshal
484      * 
485      * 
486      * 
487      * @param handler
488      */
489     public void marshal(org.xml.sax.ContentHandler handler)
490         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
491     {
492         
493         Marshaller.marshal(this, handler);
494     } //-- void marshal(org.xml.sax.ContentHandler) 
495
496     /**
497      * Method removeAllApplicationData
498      * 
499      */
500     public void removeAllApplicationData()
501     {
502         _applicationDataList.removeAllElements();
503     } //-- void removeAllApplicationData() 
504
505     /**
506      * Method removeAllAttachment
507      * 
508      */
509     public void removeAllAttachment()
510     {
511         _attachmentList.removeAllElements();
512     } //-- void removeAllAttachment() 
513
514     /**
515      * Method removeAllVAMSAS
516      * 
517      */
518     public void removeAllVAMSAS()
519     {
520         _VAMSASList.removeAllElements();
521     } //-- void removeAllVAMSAS() 
522
523     /**
524      * Method removeApplicationData
525      * 
526      * 
527      * 
528      * @param index
529      * @return ApplicationData
530      */
531     public ApplicationData removeApplicationData(int index)
532     {
533         java.lang.Object obj = _applicationDataList.elementAt(index);
534         _applicationDataList.removeElementAt(index);
535         return (ApplicationData) obj;
536     } //-- ApplicationData removeApplicationData(int) 
537
538     /**
539      * Method removeAttachment
540      * 
541      * 
542      * 
543      * @param index
544      * @return Attachment
545      */
546     public Attachment removeAttachment(int index)
547     {
548         java.lang.Object obj = _attachmentList.elementAt(index);
549         _attachmentList.removeElementAt(index);
550         return (Attachment) obj;
551     } //-- Attachment removeAttachment(int) 
552
553     /**
554      * Method removeVAMSAS
555      * 
556      * 
557      * 
558      * @param index
559      * @return VAMSAS
560      */
561     public VAMSAS removeVAMSAS(int index)
562     {
563         java.lang.Object obj = _VAMSASList.elementAt(index);
564         _VAMSASList.removeElementAt(index);
565         return (VAMSAS) obj;
566     } //-- VAMSAS removeVAMSAS(int) 
567
568     /**
569      * Method setApplicationData
570      * 
571      * 
572      * 
573      * @param index
574      * @param vApplicationData
575      */
576     public void setApplicationData(int index, ApplicationData vApplicationData)
577         throws java.lang.IndexOutOfBoundsException
578     {
579         //-- check bounds for index
580         if ((index < 0) || (index > _applicationDataList.size())) {
581             throw new IndexOutOfBoundsException("setApplicationData: Index value '"+index+"' not in range [0.."+_applicationDataList.size()+ "]");
582         }
583         _applicationDataList.setElementAt(vApplicationData, index);
584     } //-- void setApplicationData(int, ApplicationData) 
585
586     /**
587      * Method setApplicationData
588      * 
589      * 
590      * 
591      * @param applicationDataArray
592      */
593     public void setApplicationData(ApplicationData[] applicationDataArray)
594     {
595         //-- copy array
596         _applicationDataList.removeAllElements();
597         for (int i = 0; i < applicationDataArray.length; i++) {
598             _applicationDataList.addElement(applicationDataArray[i]);
599         }
600     } //-- void setApplicationData(ApplicationData) 
601
602     /**
603      * Method setAttachment
604      * 
605      * 
606      * 
607      * @param index
608      * @param vAttachment
609      */
610     public void setAttachment(int index, Attachment vAttachment)
611         throws java.lang.IndexOutOfBoundsException
612     {
613         //-- check bounds for index
614         if ((index < 0) || (index > _attachmentList.size())) {
615             throw new IndexOutOfBoundsException("setAttachment: Index value '"+index+"' not in range [0.."+_attachmentList.size()+ "]");
616         }
617         _attachmentList.setElementAt(vAttachment, index);
618     } //-- void setAttachment(int, Attachment) 
619
620     /**
621      * Method setAttachment
622      * 
623      * 
624      * 
625      * @param attachmentArray
626      */
627     public void setAttachment(Attachment[] attachmentArray)
628     {
629         //-- copy array
630         _attachmentList.removeAllElements();
631         for (int i = 0; i < attachmentArray.length; i++) {
632             _attachmentList.addElement(attachmentArray[i]);
633         }
634     } //-- void setAttachment(Attachment) 
635
636     /**
637      * Sets the value of field 'lockFile'.
638      * 
639      * @param lockFile the value of field 'lockFile'.
640      */
641     public void setLockFile(org.vamsas.objects.core.LockFile lockFile)
642     {
643         this._lockFile = lockFile;
644     } //-- void setLockFile(org.vamsas.objects.core.LockFile) 
645
646     /**
647      * Sets the value of field 'provenance'.
648      * 
649      * @param provenance the value of field 'provenance'.
650      */
651     public void setProvenance(Provenance provenance)
652     {
653         this._provenance = provenance;
654     } //-- void setProvenance(Provenance) 
655
656     /**
657      * Method setVAMSAS
658      * 
659      * 
660      * 
661      * @param index
662      * @param vVAMSAS
663      */
664     public void setVAMSAS(int index, VAMSAS vVAMSAS)
665         throws java.lang.IndexOutOfBoundsException
666     {
667         //-- check bounds for index
668         if ((index < 0) || (index > _VAMSASList.size())) {
669             throw new IndexOutOfBoundsException("setVAMSAS: Index value '"+index+"' not in range [0.."+_VAMSASList.size()+ "]");
670         }
671         _VAMSASList.setElementAt(vVAMSAS, index);
672     } //-- void setVAMSAS(int, VAMSAS) 
673
674     /**
675      * Method setVAMSAS
676      * 
677      * 
678      * 
679      * @param VAMSASArray
680      */
681     public void setVAMSAS(VAMSAS[] VAMSASArray)
682     {
683         //-- copy array
684         _VAMSASList.removeAllElements();
685         for (int i = 0; i < VAMSASArray.length; i++) {
686             _VAMSASList.addElement(VAMSASArray[i]);
687         }
688     } //-- void setVAMSAS(VAMSAS) 
689
690     /**
691      * Sets the value of field 'version'. The field 'version' has
692      * the following description: Vamsas Document Version Number
693      * 
694      * @param version the value of field 'version'.
695      */
696     public void setVersion(java.lang.String version)
697     {
698         this._version = version;
699     } //-- void setVersion(java.lang.String) 
700
701     /**
702      * Method unmarshal
703      * 
704      * 
705      * 
706      * @param reader
707      * @return VamsasDocument
708      */
709     public static org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader reader)
710         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
711     {
712         return (org.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(org.vamsas.objects.core.VamsasDocument.class, reader);
713     } //-- org.vamsas.objects.core.VamsasDocument unmarshal(java.io.Reader) 
714
715     /**
716      * Method validate
717      * 
718      */
719     public void validate()
720         throws org.exolab.castor.xml.ValidationException
721     {
722         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
723         validator.validate(this);
724     } //-- void validate() 
725
726 }