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