10ee854a01bd698c24a138cc57770cd9a18906a0
[vamsas.git] / src / uk / ac / vamsas / objects / core / VamsasDocument.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class VamsasDocument.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class VamsasDocument extends uk.ac.vamsas.client.Vobject 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * Vamsas Document Version Number
33      */
34     private java.lang.String _version;
35
36     /**
37      * Field _lockFile.
38      */
39     private uk.ac.vamsas.objects.core.LockFile _lockFile;
40
41     /**
42      * Field _provenance.
43      */
44     private uk.ac.vamsas.objects.core.Provenance _provenance;
45
46     /**
47      * contains unassociated trees and a number of analysis sets
48      *  
49      */
50     private java.util.Vector _VAMSASList;
51
52     /**
53      * Field _applicationDataList.
54      */
55     private java.util.Vector _applicationDataList;
56
57     /**
58      * Field _attachmentList.
59      */
60     private java.util.Vector _attachmentList;
61
62
63       //----------------/
64      //- Constructors -/
65     //----------------/
66
67     public VamsasDocument() {
68         super();
69         this._VAMSASList = new java.util.Vector();
70         this._applicationDataList = new java.util.Vector();
71         this._attachmentList = new java.util.Vector();
72     }
73
74
75       //-----------/
76      //- Methods -/
77     //-----------/
78
79     /**
80      * 
81      * 
82      * @param vApplicationData
83      * @throws java.lang.IndexOutOfBoundsException if the index
84      * given is outside the bounds of the collection
85      */
86     public void addApplicationData(
87             final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
88     throws java.lang.IndexOutOfBoundsException {
89         this._applicationDataList.addElement(vApplicationData);
90     }
91
92     /**
93      * 
94      * 
95      * @param index
96      * @param vApplicationData
97      * @throws java.lang.IndexOutOfBoundsException if the index
98      * given is outside the bounds of the collection
99      */
100     public void addApplicationData(
101             final int index,
102             final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
103     throws java.lang.IndexOutOfBoundsException {
104         this._applicationDataList.add(index, vApplicationData);
105     }
106
107     /**
108      * 
109      * 
110      * @param vAttachment
111      * @throws java.lang.IndexOutOfBoundsException if the index
112      * given is outside the bounds of the collection
113      */
114     public void addAttachment(
115             final uk.ac.vamsas.objects.core.Attachment vAttachment)
116     throws java.lang.IndexOutOfBoundsException {
117         this._attachmentList.addElement(vAttachment);
118     }
119
120     /**
121      * 
122      * 
123      * @param index
124      * @param vAttachment
125      * @throws java.lang.IndexOutOfBoundsException if the index
126      * given is outside the bounds of the collection
127      */
128     public void addAttachment(
129             final int index,
130             final uk.ac.vamsas.objects.core.Attachment vAttachment)
131     throws java.lang.IndexOutOfBoundsException {
132         this._attachmentList.add(index, vAttachment);
133     }
134
135     /**
136      * 
137      * 
138      * @param vVAMSAS
139      * @throws java.lang.IndexOutOfBoundsException if the index
140      * given is outside the bounds of the collection
141      */
142     public void addVAMSAS(
143             final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
144     throws java.lang.IndexOutOfBoundsException {
145         this._VAMSASList.addElement(vVAMSAS);
146     }
147
148     /**
149      * 
150      * 
151      * @param index
152      * @param vVAMSAS
153      * @throws java.lang.IndexOutOfBoundsException if the index
154      * given is outside the bounds of the collection
155      */
156     public void addVAMSAS(
157             final int index,
158             final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
159     throws java.lang.IndexOutOfBoundsException {
160         this._VAMSASList.add(index, vVAMSAS);
161     }
162
163     /**
164      * Method enumerateApplicationData.
165      * 
166      * @return an Enumeration over all
167      * uk.ac.vamsas.objects.core.ApplicationData elements
168      */
169     public java.util.Enumeration enumerateApplicationData(
170     ) {
171         return this._applicationDataList.elements();
172     }
173
174     /**
175      * Method enumerateAttachment.
176      * 
177      * @return an Enumeration over all
178      * uk.ac.vamsas.objects.core.Attachment elements
179      */
180     public java.util.Enumeration enumerateAttachment(
181     ) {
182         return this._attachmentList.elements();
183     }
184
185     /**
186      * Method enumerateVAMSAS.
187      * 
188      * @return an Enumeration over all
189      * uk.ac.vamsas.objects.core.VAMSAS elements
190      */
191     public java.util.Enumeration enumerateVAMSAS(
192     ) {
193         return this._VAMSASList.elements();
194     }
195
196     /**
197      * Overrides the java.lang.Object.equals method.
198      * 
199      * @param obj
200      * @return true if the objects are equal.
201      */
202     public boolean equals(
203             final java.lang.Object obj) {
204         if ( this == obj )
205             return true;
206         
207         if (super.equals(obj)==false)
208             return false;
209         
210         if (obj instanceof VamsasDocument) {
211         
212             VamsasDocument temp = (VamsasDocument)obj;
213             boolean thcycle;
214             boolean tmcycle;
215             if (this._version != null) {
216                 if (temp._version == null) return false;
217                 if (this._version != temp._version) {
218                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._version);
219                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._version);
220                     if (thcycle!=tmcycle) {
221                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._version); };
222                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._version); };
223                         return false;
224                     }
225                     if (!thcycle) {
226                         if (!this._version.equals(temp._version)) {
227                             org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
228                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
229                             return false;
230                         }
231                         org.castor.util.CycleBreaker.releaseCycleHandle(this._version);
232                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._version);
233                     }
234                 }
235             } else if (temp._version != null)
236                 return false;
237             if (this._lockFile != null) {
238                 if (temp._lockFile == null) return false;
239                 if (this._lockFile != temp._lockFile) {
240                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._lockFile);
241                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._lockFile);
242                     if (thcycle!=tmcycle) {
243                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile); };
244                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile); };
245                         return false;
246                     }
247                     if (!thcycle) {
248                         if (!this._lockFile.equals(temp._lockFile)) {
249                             org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
250                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
251                             return false;
252                         }
253                         org.castor.util.CycleBreaker.releaseCycleHandle(this._lockFile);
254                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._lockFile);
255                     }
256                 }
257             } else if (temp._lockFile != null)
258                 return false;
259             if (this._provenance != null) {
260                 if (temp._provenance == null) return false;
261                 if (this._provenance != temp._provenance) {
262                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
263                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
264                     if (thcycle!=tmcycle) {
265                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
266                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
267                         return false;
268                     }
269                     if (!thcycle) {
270                         if (!this._provenance.equals(temp._provenance)) {
271                             org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
272                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
273                             return false;
274                         }
275                         org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
276                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
277                     }
278                 }
279             } else if (temp._provenance != null)
280                 return false;
281             if (this._VAMSASList != null) {
282                 if (temp._VAMSASList == null) return false;
283                 if (this._VAMSASList != temp._VAMSASList) {
284                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._VAMSASList);
285                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._VAMSASList);
286                     if (thcycle!=tmcycle) {
287                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList); };
288                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList); };
289                         return false;
290                     }
291                     if (!thcycle) {
292                         if (!this._VAMSASList.equals(temp._VAMSASList)) {
293                             org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
294                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
295                             return false;
296                         }
297                         org.castor.util.CycleBreaker.releaseCycleHandle(this._VAMSASList);
298                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._VAMSASList);
299                     }
300                 }
301             } else if (temp._VAMSASList != null)
302                 return false;
303             if (this._applicationDataList != null) {
304                 if (temp._applicationDataList == null) return false;
305                 if (this._applicationDataList != temp._applicationDataList) {
306                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._applicationDataList);
307                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._applicationDataList);
308                     if (thcycle!=tmcycle) {
309                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList); };
310                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList); };
311                         return false;
312                     }
313                     if (!thcycle) {
314                         if (!this._applicationDataList.equals(temp._applicationDataList)) {
315                             org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList);
316                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList);
317                             return false;
318                         }
319                         org.castor.util.CycleBreaker.releaseCycleHandle(this._applicationDataList);
320                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._applicationDataList);
321                     }
322                 }
323             } else if (temp._applicationDataList != null)
324                 return false;
325             if (this._attachmentList != null) {
326                 if (temp._attachmentList == null) return false;
327                 if (this._attachmentList != temp._attachmentList) {
328                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._attachmentList);
329                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._attachmentList);
330                     if (thcycle!=tmcycle) {
331                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList); };
332                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList); };
333                         return false;
334                     }
335                     if (!thcycle) {
336                         if (!this._attachmentList.equals(temp._attachmentList)) {
337                             org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList);
338                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList);
339                             return false;
340                         }
341                         org.castor.util.CycleBreaker.releaseCycleHandle(this._attachmentList);
342                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._attachmentList);
343                     }
344                 }
345             } else if (temp._attachmentList != null)
346                 return false;
347             return true;
348         }
349         return false;
350     }
351
352     /**
353      * Method getApplicationData.
354      * 
355      * @param index
356      * @throws java.lang.IndexOutOfBoundsException if the index
357      * given is outside the bounds of the collection
358      * @return the value of the
359      * uk.ac.vamsas.objects.core.ApplicationData at the given index
360      */
361     public uk.ac.vamsas.objects.core.ApplicationData getApplicationData(
362             final int index)
363     throws java.lang.IndexOutOfBoundsException {
364         // check bounds for index
365         if (index < 0 || index >= this._applicationDataList.size()) {
366             throw new IndexOutOfBoundsException("getApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
367         }
368         
369         return (uk.ac.vamsas.objects.core.ApplicationData) _applicationDataList.get(index);
370     }
371
372     /**
373      * Method getApplicationData.Returns the contents of the
374      * collection in an Array.  <p>Note:  Just in case the
375      * collection contents are changing in another thread, we pass
376      * a 0-length Array of the correct type into the API call. 
377      * This way we <i>know</i> that the Array returned is of
378      * exactly the correct length.
379      * 
380      * @return this collection as an Array
381      */
382     public uk.ac.vamsas.objects.core.ApplicationData[] getApplicationData(
383     ) {
384         uk.ac.vamsas.objects.core.ApplicationData[] array = new uk.ac.vamsas.objects.core.ApplicationData[0];
385         return (uk.ac.vamsas.objects.core.ApplicationData[]) this._applicationDataList.toArray(array);
386     }
387
388     /**
389      * Method getApplicationDataAsReference.Returns a reference to
390      * '_applicationDataList'. No type checking is performed on any
391      * modifications to the Vector.
392      * 
393      * @return a reference to the Vector backing this class
394      */
395     public java.util.Vector getApplicationDataAsReference(
396     ) {
397         return this._applicationDataList;
398     }
399
400     /**
401      * Method getApplicationDataCount.
402      * 
403      * @return the size of this collection
404      */
405     public int getApplicationDataCount(
406     ) {
407         return this._applicationDataList.size();
408     }
409
410     /**
411      * Method getAttachment.
412      * 
413      * @param index
414      * @throws java.lang.IndexOutOfBoundsException if the index
415      * given is outside the bounds of the collection
416      * @return the value of the
417      * uk.ac.vamsas.objects.core.Attachment at the given index
418      */
419     public uk.ac.vamsas.objects.core.Attachment getAttachment(
420             final int index)
421     throws java.lang.IndexOutOfBoundsException {
422         // check bounds for index
423         if (index < 0 || index >= this._attachmentList.size()) {
424             throw new IndexOutOfBoundsException("getAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
425         }
426         
427         return (uk.ac.vamsas.objects.core.Attachment) _attachmentList.get(index);
428     }
429
430     /**
431      * Method getAttachment.Returns the contents of the collection
432      * in an Array.  <p>Note:  Just in case the collection contents
433      * are changing in another thread, we pass a 0-length Array of
434      * the correct type into the API call.  This way we <i>know</i>
435      * that the Array returned is of exactly the correct length.
436      * 
437      * @return this collection as an Array
438      */
439     public uk.ac.vamsas.objects.core.Attachment[] getAttachment(
440     ) {
441         uk.ac.vamsas.objects.core.Attachment[] array = new uk.ac.vamsas.objects.core.Attachment[0];
442         return (uk.ac.vamsas.objects.core.Attachment[]) this._attachmentList.toArray(array);
443     }
444
445     /**
446      * Method getAttachmentAsReference.Returns a reference to
447      * '_attachmentList'. No type checking is performed on any
448      * modifications to the Vector.
449      * 
450      * @return a reference to the Vector backing this class
451      */
452     public java.util.Vector getAttachmentAsReference(
453     ) {
454         return this._attachmentList;
455     }
456
457     /**
458      * Method getAttachmentCount.
459      * 
460      * @return the size of this collection
461      */
462     public int getAttachmentCount(
463     ) {
464         return this._attachmentList.size();
465     }
466
467     /**
468      * Returns the value of field 'lockFile'.
469      * 
470      * @return the value of field 'LockFile'.
471      */
472     public uk.ac.vamsas.objects.core.LockFile getLockFile(
473     ) {
474         return this._lockFile;
475     }
476
477     /**
478      * Returns the value of field 'provenance'.
479      * 
480      * @return the value of field 'Provenance'.
481      */
482     public uk.ac.vamsas.objects.core.Provenance getProvenance(
483     ) {
484         return this._provenance;
485     }
486
487     /**
488      * Method getVAMSAS.
489      * 
490      * @param index
491      * @throws java.lang.IndexOutOfBoundsException if the index
492      * given is outside the bounds of the collection
493      * @return the value of the uk.ac.vamsas.objects.core.VAMSAS at
494      * the given index
495      */
496     public uk.ac.vamsas.objects.core.VAMSAS getVAMSAS(
497             final int index)
498     throws java.lang.IndexOutOfBoundsException {
499         // check bounds for index
500         if (index < 0 || index >= this._VAMSASList.size()) {
501             throw new IndexOutOfBoundsException("getVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
502         }
503         
504         return (uk.ac.vamsas.objects.core.VAMSAS) _VAMSASList.get(index);
505     }
506
507     /**
508      * Method getVAMSAS.Returns the contents of the collection in
509      * an Array.  <p>Note:  Just in case the collection contents
510      * are changing in another thread, we pass a 0-length Array of
511      * the correct type into the API call.  This way we <i>know</i>
512      * that the Array returned is of exactly the correct length.
513      * 
514      * @return this collection as an Array
515      */
516     public uk.ac.vamsas.objects.core.VAMSAS[] getVAMSAS(
517     ) {
518         uk.ac.vamsas.objects.core.VAMSAS[] array = new uk.ac.vamsas.objects.core.VAMSAS[0];
519         return (uk.ac.vamsas.objects.core.VAMSAS[]) this._VAMSASList.toArray(array);
520     }
521
522     /**
523      * Method getVAMSASAsReference.Returns a reference to
524      * '_VAMSASList'. No type checking is performed on any
525      * modifications to the Vector.
526      * 
527      * @return a reference to the Vector backing this class
528      */
529     public java.util.Vector getVAMSASAsReference(
530     ) {
531         return this._VAMSASList;
532     }
533
534     /**
535      * Method getVAMSASCount.
536      * 
537      * @return the size of this collection
538      */
539     public int getVAMSASCount(
540     ) {
541         return this._VAMSASList.size();
542     }
543
544     /**
545      * Returns the value of field 'version'. The field 'version'
546      * has the following description: Vamsas Document Version
547      * Number
548      * 
549      * @return the value of field 'Version'.
550      */
551     public java.lang.String getVersion(
552     ) {
553         return this._version;
554     }
555
556     /**
557      * Overrides the java.lang.Object.hashCode method.
558      * <p>
559      * The following steps came from <b>Effective Java Programming
560      * Language Guide</b> by Joshua Bloch, Chapter 3
561      * 
562      * @return a hash code value for the object.
563      */
564     public int hashCode(
565     ) {
566         int result = super.hashCode();
567         
568         long tmp;
569         if (_version != null
570             && !org.castor.util.CycleBreaker.startingToCycle(_version)) {
571            result = 37 * result + _version.hashCode();
572            org.castor.util.CycleBreaker.releaseCycleHandle(_version);
573         }
574         if (_lockFile != null
575             && !org.castor.util.CycleBreaker.startingToCycle(_lockFile)) {
576            result = 37 * result + _lockFile.hashCode();
577            org.castor.util.CycleBreaker.releaseCycleHandle(_lockFile);
578         }
579         if (_provenance != null
580             && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
581            result = 37 * result + _provenance.hashCode();
582            org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
583         }
584         if (_VAMSASList != null
585             && !org.castor.util.CycleBreaker.startingToCycle(_VAMSASList)) {
586            result = 37 * result + _VAMSASList.hashCode();
587            org.castor.util.CycleBreaker.releaseCycleHandle(_VAMSASList);
588         }
589         if (_applicationDataList != null
590             && !org.castor.util.CycleBreaker.startingToCycle(_applicationDataList)) {
591            result = 37 * result + _applicationDataList.hashCode();
592            org.castor.util.CycleBreaker.releaseCycleHandle(_applicationDataList);
593         }
594         if (_attachmentList != null
595             && !org.castor.util.CycleBreaker.startingToCycle(_attachmentList)) {
596            result = 37 * result + _attachmentList.hashCode();
597            org.castor.util.CycleBreaker.releaseCycleHandle(_attachmentList);
598         }
599         
600         return result;
601     }
602
603     /**
604      * Method isValid.
605      * 
606      * @return true if this object is valid according to the schema
607      */
608     public boolean isValid(
609     ) {
610         try {
611             validate();
612         } catch (org.exolab.castor.xml.ValidationException vex) {
613             return false;
614         }
615         return true;
616     }
617
618     /**
619      * 
620      * 
621      * @param out
622      * @throws org.exolab.castor.xml.MarshalException if object is
623      * null or if any SAXException is thrown during marshaling
624      * @throws org.exolab.castor.xml.ValidationException if this
625      * object is an invalid instance according to the schema
626      */
627     public void marshal(
628             final java.io.Writer out)
629     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
630         Marshaller.marshal(this, out);
631     }
632
633     /**
634      * 
635      * 
636      * @param handler
637      * @throws java.io.IOException if an IOException occurs during
638      * marshaling
639      * @throws org.exolab.castor.xml.ValidationException if this
640      * object is an invalid instance according to the schema
641      * @throws org.exolab.castor.xml.MarshalException if object is
642      * null or if any SAXException is thrown during marshaling
643      */
644     public void marshal(
645             final org.xml.sax.ContentHandler handler)
646     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
647         Marshaller.marshal(this, handler);
648     }
649
650     /**
651      */
652     public void removeAllApplicationData(
653     ) {
654         this._applicationDataList.clear();
655     }
656
657     /**
658      */
659     public void removeAllAttachment(
660     ) {
661         this._attachmentList.clear();
662     }
663
664     /**
665      */
666     public void removeAllVAMSAS(
667     ) {
668         this._VAMSASList.clear();
669     }
670
671     /**
672      * Method removeApplicationData.
673      * 
674      * @param vApplicationData
675      * @return true if the object was removed from the collection.
676      */
677     public boolean removeApplicationData(
678             final uk.ac.vamsas.objects.core.ApplicationData vApplicationData) {
679         boolean removed = _applicationDataList.remove(vApplicationData);
680         return removed;
681     }
682
683     /**
684      * Method removeApplicationDataAt.
685      * 
686      * @param index
687      * @return the element removed from the collection
688      */
689     public uk.ac.vamsas.objects.core.ApplicationData removeApplicationDataAt(
690             final int index) {
691         java.lang.Object obj = this._applicationDataList.remove(index);
692         return (uk.ac.vamsas.objects.core.ApplicationData) obj;
693     }
694
695     /**
696      * Method removeAttachment.
697      * 
698      * @param vAttachment
699      * @return true if the object was removed from the collection.
700      */
701     public boolean removeAttachment(
702             final uk.ac.vamsas.objects.core.Attachment vAttachment) {
703         boolean removed = _attachmentList.remove(vAttachment);
704         return removed;
705     }
706
707     /**
708      * Method removeAttachmentAt.
709      * 
710      * @param index
711      * @return the element removed from the collection
712      */
713     public uk.ac.vamsas.objects.core.Attachment removeAttachmentAt(
714             final int index) {
715         java.lang.Object obj = this._attachmentList.remove(index);
716         return (uk.ac.vamsas.objects.core.Attachment) obj;
717     }
718
719     /**
720      * Method removeVAMSAS.
721      * 
722      * @param vVAMSAS
723      * @return true if the object was removed from the collection.
724      */
725     public boolean removeVAMSAS(
726             final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS) {
727         boolean removed = _VAMSASList.remove(vVAMSAS);
728         return removed;
729     }
730
731     /**
732      * Method removeVAMSASAt.
733      * 
734      * @param index
735      * @return the element removed from the collection
736      */
737     public uk.ac.vamsas.objects.core.VAMSAS removeVAMSASAt(
738             final int index) {
739         java.lang.Object obj = this._VAMSASList.remove(index);
740         return (uk.ac.vamsas.objects.core.VAMSAS) obj;
741     }
742
743     /**
744      * 
745      * 
746      * @param index
747      * @param vApplicationData
748      * @throws java.lang.IndexOutOfBoundsException if the index
749      * given is outside the bounds of the collection
750      */
751     public void setApplicationData(
752             final int index,
753             final uk.ac.vamsas.objects.core.ApplicationData vApplicationData)
754     throws java.lang.IndexOutOfBoundsException {
755         // check bounds for index
756         if (index < 0 || index >= this._applicationDataList.size()) {
757             throw new IndexOutOfBoundsException("setApplicationData: Index value '" + index + "' not in range [0.." + (this._applicationDataList.size() - 1) + "]");
758         }
759         
760         this._applicationDataList.set(index, vApplicationData);
761     }
762
763     /**
764      * 
765      * 
766      * @param vApplicationDataArray
767      */
768     public void setApplicationData(
769             final uk.ac.vamsas.objects.core.ApplicationData[] vApplicationDataArray) {
770         //-- copy array
771         _applicationDataList.clear();
772         
773         for (int i = 0; i < vApplicationDataArray.length; i++) {
774                 this._applicationDataList.add(vApplicationDataArray[i]);
775         }
776     }
777
778     /**
779      * Sets the value of '_applicationDataList' by copying the
780      * given Vector. All elements will be checked for type safety.
781      * 
782      * @param vApplicationDataList the Vector to copy.
783      */
784     public void setApplicationData(
785             final java.util.Vector vApplicationDataList) {
786         // copy vector
787         this._applicationDataList.clear();
788         
789         this._applicationDataList.addAll(vApplicationDataList);
790     }
791
792     /**
793      * Sets the value of '_applicationDataList' by setting it to
794      * the given Vector. No type checking is performed.
795      * @deprecated
796      * 
797      * @param applicationDataVector the Vector to set.
798      */
799     public void setApplicationDataAsReference(
800             final java.util.Vector applicationDataVector) {
801         this._applicationDataList = applicationDataVector;
802     }
803
804     /**
805      * 
806      * 
807      * @param index
808      * @param vAttachment
809      * @throws java.lang.IndexOutOfBoundsException if the index
810      * given is outside the bounds of the collection
811      */
812     public void setAttachment(
813             final int index,
814             final uk.ac.vamsas.objects.core.Attachment vAttachment)
815     throws java.lang.IndexOutOfBoundsException {
816         // check bounds for index
817         if (index < 0 || index >= this._attachmentList.size()) {
818             throw new IndexOutOfBoundsException("setAttachment: Index value '" + index + "' not in range [0.." + (this._attachmentList.size() - 1) + "]");
819         }
820         
821         this._attachmentList.set(index, vAttachment);
822     }
823
824     /**
825      * 
826      * 
827      * @param vAttachmentArray
828      */
829     public void setAttachment(
830             final uk.ac.vamsas.objects.core.Attachment[] vAttachmentArray) {
831         //-- copy array
832         _attachmentList.clear();
833         
834         for (int i = 0; i < vAttachmentArray.length; i++) {
835                 this._attachmentList.add(vAttachmentArray[i]);
836         }
837     }
838
839     /**
840      * Sets the value of '_attachmentList' by copying the given
841      * Vector. All elements will be checked for type safety.
842      * 
843      * @param vAttachmentList the Vector to copy.
844      */
845     public void setAttachment(
846             final java.util.Vector vAttachmentList) {
847         // copy vector
848         this._attachmentList.clear();
849         
850         this._attachmentList.addAll(vAttachmentList);
851     }
852
853     /**
854      * Sets the value of '_attachmentList' by setting it to the
855      * given Vector. No type checking is performed.
856      * @deprecated
857      * 
858      * @param attachmentVector the Vector to set.
859      */
860     public void setAttachmentAsReference(
861             final java.util.Vector attachmentVector) {
862         this._attachmentList = attachmentVector;
863     }
864
865     /**
866      * Sets the value of field 'lockFile'.
867      * 
868      * @param lockFile the value of field 'lockFile'.
869      */
870     public void setLockFile(
871             final uk.ac.vamsas.objects.core.LockFile lockFile) {
872         this._lockFile = lockFile;
873     }
874
875     /**
876      * Sets the value of field 'provenance'.
877      * 
878      * @param provenance the value of field 'provenance'.
879      */
880     public void setProvenance(
881             final uk.ac.vamsas.objects.core.Provenance provenance) {
882         this._provenance = provenance;
883     }
884
885     /**
886      * 
887      * 
888      * @param index
889      * @param vVAMSAS
890      * @throws java.lang.IndexOutOfBoundsException if the index
891      * given is outside the bounds of the collection
892      */
893     public void setVAMSAS(
894             final int index,
895             final uk.ac.vamsas.objects.core.VAMSAS vVAMSAS)
896     throws java.lang.IndexOutOfBoundsException {
897         // check bounds for index
898         if (index < 0 || index >= this._VAMSASList.size()) {
899             throw new IndexOutOfBoundsException("setVAMSAS: Index value '" + index + "' not in range [0.." + (this._VAMSASList.size() - 1) + "]");
900         }
901         
902         this._VAMSASList.set(index, vVAMSAS);
903     }
904
905     /**
906      * 
907      * 
908      * @param vVAMSASArray
909      */
910     public void setVAMSAS(
911             final uk.ac.vamsas.objects.core.VAMSAS[] vVAMSASArray) {
912         //-- copy array
913         _VAMSASList.clear();
914         
915         for (int i = 0; i < vVAMSASArray.length; i++) {
916                 this._VAMSASList.add(vVAMSASArray[i]);
917         }
918     }
919
920     /**
921      * Sets the value of '_VAMSASList' by copying the given Vector.
922      * All elements will be checked for type safety.
923      * 
924      * @param vVAMSASList the Vector to copy.
925      */
926     public void setVAMSAS(
927             final java.util.Vector vVAMSASList) {
928         // copy vector
929         this._VAMSASList.clear();
930         
931         this._VAMSASList.addAll(vVAMSASList);
932     }
933
934     /**
935      * Sets the value of '_VAMSASList' by setting it to the given
936      * Vector. No type checking is performed.
937      * @deprecated
938      * 
939      * @param VAMSASVector the Vector to set.
940      */
941     public void setVAMSASAsReference(
942             final java.util.Vector VAMSASVector) {
943         this._VAMSASList = VAMSASVector;
944     }
945
946     /**
947      * Sets the value of field 'version'. The field 'version' has
948      * the following description: Vamsas Document Version Number
949      * 
950      * @param version the value of field 'version'.
951      */
952     public void setVersion(
953             final java.lang.String version) {
954         this._version = version;
955     }
956
957     /**
958      * Method unmarshal.
959      * 
960      * @param reader
961      * @throws org.exolab.castor.xml.MarshalException if object is
962      * null or if any SAXException is thrown during marshaling
963      * @throws org.exolab.castor.xml.ValidationException if this
964      * object is an invalid instance according to the schema
965      * @return the unmarshaled
966      * uk.ac.vamsas.objects.core.VamsasDocument
967      */
968     public static uk.ac.vamsas.objects.core.VamsasDocument unmarshal(
969             final java.io.Reader reader)
970     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
971         return (uk.ac.vamsas.objects.core.VamsasDocument) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.VamsasDocument.class, reader);
972     }
973
974     /**
975      * 
976      * 
977      * @throws org.exolab.castor.xml.ValidationException if this
978      * object is an invalid instance according to the schema
979      */
980     public void validate(
981     )
982     throws org.exolab.castor.xml.ValidationException {
983         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
984         validator.validate(this);
985     }
986
987 }