ae4506b4e3775971bf47f2af490ee7d8737442bf
[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 _sequenceMappingList.
43      */
44     private java.util.Vector _sequenceMappingList;
45
46     /**
47      * Field _dataSetAnnotationsList.
48      */
49     private java.util.Vector _dataSetAnnotationsList;
50
51     /**
52      * Field _alignmentList.
53      */
54     private java.util.Vector _alignmentList;
55
56     /**
57      * Field _treeList.
58      */
59     private java.util.Vector _treeList;
60
61     /**
62      * Field _provenance.
63      */
64     private uk.ac.vamsas.objects.core.Provenance _provenance;
65
66
67       //----------------/
68      //- Constructors -/
69     //----------------/
70
71     public DataSet() {
72         super();
73         this._sequenceList = new java.util.Vector();
74         this._sequenceMappingList = new java.util.Vector();
75         this._dataSetAnnotationsList = new java.util.Vector();
76         this._alignmentList = new java.util.Vector();
77         this._treeList = new java.util.Vector();
78     }
79
80
81       //-----------/
82      //- Methods -/
83     //-----------/
84
85     /**
86      * 
87      * 
88      * @param vAlignment
89      * @throws java.lang.IndexOutOfBoundsException if the index
90      * given is outside the bounds of the collection
91      */
92     public void addAlignment(
93             final uk.ac.vamsas.objects.core.Alignment vAlignment)
94     throws java.lang.IndexOutOfBoundsException {
95         this._alignmentList.addElement(vAlignment);
96     }
97
98     /**
99      * 
100      * 
101      * @param index
102      * @param vAlignment
103      * @throws java.lang.IndexOutOfBoundsException if the index
104      * given is outside the bounds of the collection
105      */
106     public void addAlignment(
107             final int index,
108             final uk.ac.vamsas.objects.core.Alignment vAlignment)
109     throws java.lang.IndexOutOfBoundsException {
110         this._alignmentList.add(index, vAlignment);
111     }
112
113     /**
114      * 
115      * 
116      * @param vDataSetAnnotations
117      * @throws java.lang.IndexOutOfBoundsException if the index
118      * given is outside the bounds of the collection
119      */
120     public void addDataSetAnnotations(
121             final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
122     throws java.lang.IndexOutOfBoundsException {
123         this._dataSetAnnotationsList.addElement(vDataSetAnnotations);
124     }
125
126     /**
127      * 
128      * 
129      * @param index
130      * @param vDataSetAnnotations
131      * @throws java.lang.IndexOutOfBoundsException if the index
132      * given is outside the bounds of the collection
133      */
134     public void addDataSetAnnotations(
135             final int index,
136             final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
137     throws java.lang.IndexOutOfBoundsException {
138         this._dataSetAnnotationsList.add(index, vDataSetAnnotations);
139     }
140
141     /**
142      * 
143      * 
144      * @param vSequence
145      * @throws java.lang.IndexOutOfBoundsException if the index
146      * given is outside the bounds of the collection
147      */
148     public void addSequence(
149             final uk.ac.vamsas.objects.core.Sequence vSequence)
150     throws java.lang.IndexOutOfBoundsException {
151         this._sequenceList.addElement(vSequence);
152     }
153
154     /**
155      * 
156      * 
157      * @param index
158      * @param vSequence
159      * @throws java.lang.IndexOutOfBoundsException if the index
160      * given is outside the bounds of the collection
161      */
162     public void addSequence(
163             final int index,
164             final uk.ac.vamsas.objects.core.Sequence vSequence)
165     throws java.lang.IndexOutOfBoundsException {
166         this._sequenceList.add(index, vSequence);
167     }
168
169     /**
170      * 
171      * 
172      * @param vSequenceMapping
173      * @throws java.lang.IndexOutOfBoundsException if the index
174      * given is outside the bounds of the collection
175      */
176     public void addSequenceMapping(
177             final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
178     throws java.lang.IndexOutOfBoundsException {
179         this._sequenceMappingList.addElement(vSequenceMapping);
180     }
181
182     /**
183      * 
184      * 
185      * @param index
186      * @param vSequenceMapping
187      * @throws java.lang.IndexOutOfBoundsException if the index
188      * given is outside the bounds of the collection
189      */
190     public void addSequenceMapping(
191             final int index,
192             final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
193     throws java.lang.IndexOutOfBoundsException {
194         this._sequenceMappingList.add(index, vSequenceMapping);
195     }
196
197     /**
198      * 
199      * 
200      * @param vTree
201      * @throws java.lang.IndexOutOfBoundsException if the index
202      * given is outside the bounds of the collection
203      */
204     public void addTree(
205             final uk.ac.vamsas.objects.core.Tree vTree)
206     throws java.lang.IndexOutOfBoundsException {
207         this._treeList.addElement(vTree);
208     }
209
210     /**
211      * 
212      * 
213      * @param index
214      * @param vTree
215      * @throws java.lang.IndexOutOfBoundsException if the index
216      * given is outside the bounds of the collection
217      */
218     public void addTree(
219             final int index,
220             final uk.ac.vamsas.objects.core.Tree vTree)
221     throws java.lang.IndexOutOfBoundsException {
222         this._treeList.add(index, vTree);
223     }
224
225     /**
226      * Method enumerateAlignment.
227      * 
228      * @return an Enumeration over all
229      * uk.ac.vamsas.objects.core.Alignment elements
230      */
231     public java.util.Enumeration enumerateAlignment(
232     ) {
233         return this._alignmentList.elements();
234     }
235
236     /**
237      * Method enumerateDataSetAnnotations.
238      * 
239      * @return an Enumeration over all
240      * uk.ac.vamsas.objects.core.DataSetAnnotations elements
241      */
242     public java.util.Enumeration enumerateDataSetAnnotations(
243     ) {
244         return this._dataSetAnnotationsList.elements();
245     }
246
247     /**
248      * Method enumerateSequence.
249      * 
250      * @return an Enumeration over all
251      * uk.ac.vamsas.objects.core.Sequence elements
252      */
253     public java.util.Enumeration enumerateSequence(
254     ) {
255         return this._sequenceList.elements();
256     }
257
258     /**
259      * Method enumerateSequenceMapping.
260      * 
261      * @return an Enumeration over all
262      * uk.ac.vamsas.objects.core.SequenceMapping elements
263      */
264     public java.util.Enumeration enumerateSequenceMapping(
265     ) {
266         return this._sequenceMappingList.elements();
267     }
268
269     /**
270      * Method enumerateTree.
271      * 
272      * @return an Enumeration over all
273      * uk.ac.vamsas.objects.core.Tree elements
274      */
275     public java.util.Enumeration enumerateTree(
276     ) {
277         return this._treeList.elements();
278     }
279
280     /**
281      * Overrides the java.lang.Object.equals method.
282      * 
283      * @param obj
284      * @return true if the objects are equal.
285      */
286     public boolean equals(
287             final java.lang.Object obj) {
288         if ( this == obj )
289             return true;
290         
291         if (super.equals(obj)==false)
292             return false;
293         
294         if (obj instanceof DataSet) {
295         
296             DataSet temp = (DataSet)obj;
297             boolean thcycle;
298             boolean tmcycle;
299             if (this._id != null) {
300                 if (temp._id == null) return false;
301                 if (this._id != temp._id) {
302                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
303                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
304                     if (thcycle!=tmcycle) {
305                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
306                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
307                         return false;
308                     }
309                     if (!thcycle) {
310                         if (!this._id.equals(temp._id)) {
311                             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
312                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
313                             return false;
314                         }
315                         org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
316                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
317                     }
318                 }
319             } else if (temp._id != null)
320                 return false;
321             if (this._sequenceList != null) {
322                 if (temp._sequenceList == null) return false;
323                 if (this._sequenceList != temp._sequenceList) {
324                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceList);
325                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceList);
326                     if (thcycle!=tmcycle) {
327                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList); };
328                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList); };
329                         return false;
330                     }
331                     if (!thcycle) {
332                         if (!this._sequenceList.equals(temp._sequenceList)) {
333                             org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
334                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
335                             return false;
336                         }
337                         org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceList);
338                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceList);
339                     }
340                 }
341             } else if (temp._sequenceList != null)
342                 return false;
343             if (this._sequenceMappingList != null) {
344                 if (temp._sequenceMappingList == null) return false;
345                 if (this._sequenceMappingList != temp._sequenceMappingList) {
346                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._sequenceMappingList);
347                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._sequenceMappingList);
348                     if (thcycle!=tmcycle) {
349                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList); };
350                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList); };
351                         return false;
352                     }
353                     if (!thcycle) {
354                         if (!this._sequenceMappingList.equals(temp._sequenceMappingList)) {
355                             org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
356                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
357                             return false;
358                         }
359                         org.castor.util.CycleBreaker.releaseCycleHandle(this._sequenceMappingList);
360                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._sequenceMappingList);
361                     }
362                 }
363             } else if (temp._sequenceMappingList != null)
364                 return false;
365             if (this._dataSetAnnotationsList != null) {
366                 if (temp._dataSetAnnotationsList == null) return false;
367                 if (this._dataSetAnnotationsList != temp._dataSetAnnotationsList) {
368                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dataSetAnnotationsList);
369                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dataSetAnnotationsList);
370                     if (thcycle!=tmcycle) {
371                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList); };
372                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList); };
373                         return false;
374                     }
375                     if (!thcycle) {
376                         if (!this._dataSetAnnotationsList.equals(temp._dataSetAnnotationsList)) {
377                             org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
378                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
379                             return false;
380                         }
381                         org.castor.util.CycleBreaker.releaseCycleHandle(this._dataSetAnnotationsList);
382                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._dataSetAnnotationsList);
383                     }
384                 }
385             } else if (temp._dataSetAnnotationsList != null)
386                 return false;
387             if (this._alignmentList != null) {
388                 if (temp._alignmentList == null) return false;
389                 if (this._alignmentList != temp._alignmentList) {
390                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentList);
391                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentList);
392                     if (thcycle!=tmcycle) {
393                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList); };
394                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList); };
395                         return false;
396                     }
397                     if (!thcycle) {
398                         if (!this._alignmentList.equals(temp._alignmentList)) {
399                             org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
400                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
401                             return false;
402                         }
403                         org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentList);
404                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentList);
405                     }
406                 }
407             } else if (temp._alignmentList != null)
408                 return false;
409             if (this._treeList != null) {
410                 if (temp._treeList == null) return false;
411                 if (this._treeList != temp._treeList) {
412                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
413                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
414                     if (thcycle!=tmcycle) {
415                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
416                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
417                         return false;
418                     }
419                     if (!thcycle) {
420                         if (!this._treeList.equals(temp._treeList)) {
421                             org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
422                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
423                             return false;
424                         }
425                         org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
426                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
427                     }
428                 }
429             } else if (temp._treeList != null)
430                 return false;
431             if (this._provenance != null) {
432                 if (temp._provenance == null) return false;
433                 if (this._provenance != temp._provenance) {
434                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
435                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
436                     if (thcycle!=tmcycle) {
437                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
438                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
439                         return false;
440                     }
441                     if (!thcycle) {
442                         if (!this._provenance.equals(temp._provenance)) {
443                             org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
444                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
445                             return false;
446                         }
447                         org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
448                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
449                     }
450                 }
451             } else if (temp._provenance != null)
452                 return false;
453             return true;
454         }
455         return false;
456     }
457
458     /**
459      * Method getAlignment.
460      * 
461      * @param index
462      * @throws java.lang.IndexOutOfBoundsException if the index
463      * given is outside the bounds of the collection
464      * @return the value of the uk.ac.vamsas.objects.core.Alignment
465      * at the given index
466      */
467     public uk.ac.vamsas.objects.core.Alignment getAlignment(
468             final int index)
469     throws java.lang.IndexOutOfBoundsException {
470         // check bounds for index
471         if (index < 0 || index >= this._alignmentList.size()) {
472             throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
473         }
474         
475         return (uk.ac.vamsas.objects.core.Alignment) _alignmentList.get(index);
476     }
477
478     /**
479      * Method getAlignment.Returns the contents of the collection
480      * in an Array.  <p>Note:  Just in case the collection contents
481      * are changing in another thread, we pass a 0-length Array of
482      * the correct type into the API call.  This way we <i>know</i>
483      * that the Array returned is of exactly the correct length.
484      * 
485      * @return this collection as an Array
486      */
487     public uk.ac.vamsas.objects.core.Alignment[] getAlignment(
488     ) {
489         uk.ac.vamsas.objects.core.Alignment[] array = new uk.ac.vamsas.objects.core.Alignment[0];
490         return (uk.ac.vamsas.objects.core.Alignment[]) this._alignmentList.toArray(array);
491     }
492
493     /**
494      * Method getAlignmentAsReference.Returns a reference to
495      * '_alignmentList'. No type checking is performed on any
496      * modifications to the Vector.
497      * 
498      * @return a reference to the Vector backing this class
499      */
500     public java.util.Vector getAlignmentAsReference(
501     ) {
502         return this._alignmentList;
503     }
504
505     /**
506      * Method getAlignmentCount.
507      * 
508      * @return the size of this collection
509      */
510     public int getAlignmentCount(
511     ) {
512         return this._alignmentList.size();
513     }
514
515     /**
516      * Method getDataSetAnnotations.
517      * 
518      * @param index
519      * @throws java.lang.IndexOutOfBoundsException if the index
520      * given is outside the bounds of the collection
521      * @return the value of the
522      * uk.ac.vamsas.objects.core.DataSetAnnotations at the given
523      * index
524      */
525     public uk.ac.vamsas.objects.core.DataSetAnnotations getDataSetAnnotations(
526             final int index)
527     throws java.lang.IndexOutOfBoundsException {
528         // check bounds for index
529         if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
530             throw new IndexOutOfBoundsException("getDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
531         }
532         
533         return (uk.ac.vamsas.objects.core.DataSetAnnotations) _dataSetAnnotationsList.get(index);
534     }
535
536     /**
537      * Method getDataSetAnnotations.Returns the contents of the
538      * collection in an Array.  <p>Note:  Just in case the
539      * collection contents are changing in another thread, we pass
540      * a 0-length Array of the correct type into the API call. 
541      * This way we <i>know</i> that the Array returned is of
542      * exactly the correct length.
543      * 
544      * @return this collection as an Array
545      */
546     public uk.ac.vamsas.objects.core.DataSetAnnotations[] getDataSetAnnotations(
547     ) {
548         uk.ac.vamsas.objects.core.DataSetAnnotations[] array = new uk.ac.vamsas.objects.core.DataSetAnnotations[0];
549         return (uk.ac.vamsas.objects.core.DataSetAnnotations[]) this._dataSetAnnotationsList.toArray(array);
550     }
551
552     /**
553      * Method getDataSetAnnotationsAsReference.Returns a reference
554      * to '_dataSetAnnotationsList'. No type checking is performed
555      * on any modifications to the Vector.
556      * 
557      * @return a reference to the Vector backing this class
558      */
559     public java.util.Vector getDataSetAnnotationsAsReference(
560     ) {
561         return this._dataSetAnnotationsList;
562     }
563
564     /**
565      * Method getDataSetAnnotationsCount.
566      * 
567      * @return the size of this collection
568      */
569     public int getDataSetAnnotationsCount(
570     ) {
571         return this._dataSetAnnotationsList.size();
572     }
573
574     /**
575      * Returns the value of field 'id'. The field 'id' has the
576      * following description: Primary Key for vamsas object
577      * referencing 
578      * 
579      * @return the value of field 'Id'.
580      */
581     public java.lang.String getId(
582     ) {
583         return this._id;
584     }
585
586     /**
587      * Returns the value of field 'provenance'.
588      * 
589      * @return the value of field 'Provenance'.
590      */
591     public uk.ac.vamsas.objects.core.Provenance getProvenance(
592     ) {
593         return this._provenance;
594     }
595
596     /**
597      * Method getSequence.
598      * 
599      * @param index
600      * @throws java.lang.IndexOutOfBoundsException if the index
601      * given is outside the bounds of the collection
602      * @return the value of the uk.ac.vamsas.objects.core.Sequence
603      * at the given index
604      */
605     public uk.ac.vamsas.objects.core.Sequence getSequence(
606             final int index)
607     throws java.lang.IndexOutOfBoundsException {
608         // check bounds for index
609         if (index < 0 || index >= this._sequenceList.size()) {
610             throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
611         }
612         
613         return (uk.ac.vamsas.objects.core.Sequence) _sequenceList.get(index);
614     }
615
616     /**
617      * Method getSequence.Returns the contents of the collection in
618      * an Array.  <p>Note:  Just in case the collection contents
619      * are changing in another thread, we pass a 0-length Array of
620      * the correct type into the API call.  This way we <i>know</i>
621      * that the Array returned is of exactly the correct length.
622      * 
623      * @return this collection as an Array
624      */
625     public uk.ac.vamsas.objects.core.Sequence[] getSequence(
626     ) {
627         uk.ac.vamsas.objects.core.Sequence[] array = new uk.ac.vamsas.objects.core.Sequence[0];
628         return (uk.ac.vamsas.objects.core.Sequence[]) this._sequenceList.toArray(array);
629     }
630
631     /**
632      * Method getSequenceAsReference.Returns a reference to
633      * '_sequenceList'. No type checking is performed on any
634      * modifications to the Vector.
635      * 
636      * @return a reference to the Vector backing this class
637      */
638     public java.util.Vector getSequenceAsReference(
639     ) {
640         return this._sequenceList;
641     }
642
643     /**
644      * Method getSequenceCount.
645      * 
646      * @return the size of this collection
647      */
648     public int getSequenceCount(
649     ) {
650         return this._sequenceList.size();
651     }
652
653     /**
654      * Method getSequenceMapping.
655      * 
656      * @param index
657      * @throws java.lang.IndexOutOfBoundsException if the index
658      * given is outside the bounds of the collection
659      * @return the value of the
660      * uk.ac.vamsas.objects.core.SequenceMapping at the given index
661      */
662     public uk.ac.vamsas.objects.core.SequenceMapping getSequenceMapping(
663             final int index)
664     throws java.lang.IndexOutOfBoundsException {
665         // check bounds for index
666         if (index < 0 || index >= this._sequenceMappingList.size()) {
667             throw new IndexOutOfBoundsException("getSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
668         }
669         
670         return (uk.ac.vamsas.objects.core.SequenceMapping) _sequenceMappingList.get(index);
671     }
672
673     /**
674      * Method getSequenceMapping.Returns the contents of the
675      * collection in an Array.  <p>Note:  Just in case the
676      * collection contents are changing in another thread, we pass
677      * a 0-length Array of the correct type into the API call. 
678      * This way we <i>know</i> that the Array returned is of
679      * exactly the correct length.
680      * 
681      * @return this collection as an Array
682      */
683     public uk.ac.vamsas.objects.core.SequenceMapping[] getSequenceMapping(
684     ) {
685         uk.ac.vamsas.objects.core.SequenceMapping[] array = new uk.ac.vamsas.objects.core.SequenceMapping[0];
686         return (uk.ac.vamsas.objects.core.SequenceMapping[]) this._sequenceMappingList.toArray(array);
687     }
688
689     /**
690      * Method getSequenceMappingAsReference.Returns a reference to
691      * '_sequenceMappingList'. No type checking is performed on any
692      * modifications to the Vector.
693      * 
694      * @return a reference to the Vector backing this class
695      */
696     public java.util.Vector getSequenceMappingAsReference(
697     ) {
698         return this._sequenceMappingList;
699     }
700
701     /**
702      * Method getSequenceMappingCount.
703      * 
704      * @return the size of this collection
705      */
706     public int getSequenceMappingCount(
707     ) {
708         return this._sequenceMappingList.size();
709     }
710
711     /**
712      * Method getTree.
713      * 
714      * @param index
715      * @throws java.lang.IndexOutOfBoundsException if the index
716      * given is outside the bounds of the collection
717      * @return the value of the uk.ac.vamsas.objects.core.Tree at
718      * the given index
719      */
720     public uk.ac.vamsas.objects.core.Tree getTree(
721             final int index)
722     throws java.lang.IndexOutOfBoundsException {
723         // check bounds for index
724         if (index < 0 || index >= this._treeList.size()) {
725             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
726         }
727         
728         return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
729     }
730
731     /**
732      * Method getTree.Returns the contents of the collection in an
733      * Array.  <p>Note:  Just in case the collection contents are
734      * changing in another thread, we pass a 0-length Array of the
735      * correct type into the API call.  This way we <i>know</i>
736      * that the Array returned is of exactly the correct length.
737      * 
738      * @return this collection as an Array
739      */
740     public uk.ac.vamsas.objects.core.Tree[] getTree(
741     ) {
742         uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
743         return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
744     }
745
746     /**
747      * Method getTreeAsReference.Returns a reference to
748      * '_treeList'. No type checking is performed on any
749      * modifications to the Vector.
750      * 
751      * @return a reference to the Vector backing this class
752      */
753     public java.util.Vector getTreeAsReference(
754     ) {
755         return this._treeList;
756     }
757
758     /**
759      * Method getTreeCount.
760      * 
761      * @return the size of this collection
762      */
763     public int getTreeCount(
764     ) {
765         return this._treeList.size();
766     }
767
768     /**
769      * Overrides the java.lang.Object.hashCode method.
770      * <p>
771      * The following steps came from <b>Effective Java Programming
772      * Language Guide</b> by Joshua Bloch, Chapter 3
773      * 
774      * @return a hash code value for the object.
775      */
776     public int hashCode(
777     ) {
778         int result = super.hashCode();
779         
780         long tmp;
781         if (_id != null
782             && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
783            result = 37 * result + _id.hashCode();
784            org.castor.util.CycleBreaker.releaseCycleHandle(_id);
785         }
786         if (_sequenceList != null
787             && !org.castor.util.CycleBreaker.startingToCycle(_sequenceList)) {
788            result = 37 * result + _sequenceList.hashCode();
789            org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceList);
790         }
791         if (_sequenceMappingList != null
792             && !org.castor.util.CycleBreaker.startingToCycle(_sequenceMappingList)) {
793            result = 37 * result + _sequenceMappingList.hashCode();
794            org.castor.util.CycleBreaker.releaseCycleHandle(_sequenceMappingList);
795         }
796         if (_dataSetAnnotationsList != null
797             && !org.castor.util.CycleBreaker.startingToCycle(_dataSetAnnotationsList)) {
798            result = 37 * result + _dataSetAnnotationsList.hashCode();
799            org.castor.util.CycleBreaker.releaseCycleHandle(_dataSetAnnotationsList);
800         }
801         if (_alignmentList != null
802             && !org.castor.util.CycleBreaker.startingToCycle(_alignmentList)) {
803            result = 37 * result + _alignmentList.hashCode();
804            org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentList);
805         }
806         if (_treeList != null
807             && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
808            result = 37 * result + _treeList.hashCode();
809            org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
810         }
811         if (_provenance != null
812             && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
813            result = 37 * result + _provenance.hashCode();
814            org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
815         }
816         
817         return result;
818     }
819
820     /**
821      * Method isValid.
822      * 
823      * @return true if this object is valid according to the schema
824      */
825     public boolean isValid(
826     ) {
827         try {
828             validate();
829         } catch (org.exolab.castor.xml.ValidationException vex) {
830             return false;
831         }
832         return true;
833     }
834
835     /**
836      * 
837      * 
838      * @param out
839      * @throws org.exolab.castor.xml.MarshalException if object is
840      * null or if any SAXException is thrown during marshaling
841      * @throws org.exolab.castor.xml.ValidationException if this
842      * object is an invalid instance according to the schema
843      */
844     public void marshal(
845             final java.io.Writer out)
846     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
847         Marshaller.marshal(this, out);
848     }
849
850     /**
851      * 
852      * 
853      * @param handler
854      * @throws java.io.IOException if an IOException occurs during
855      * marshaling
856      * @throws org.exolab.castor.xml.ValidationException if this
857      * object is an invalid instance according to the schema
858      * @throws org.exolab.castor.xml.MarshalException if object is
859      * null or if any SAXException is thrown during marshaling
860      */
861     public void marshal(
862             final org.xml.sax.ContentHandler handler)
863     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
864         Marshaller.marshal(this, handler);
865     }
866
867     /**
868      * Method removeAlignment.
869      * 
870      * @param vAlignment
871      * @return true if the object was removed from the collection.
872      */
873     public boolean removeAlignment(
874             final uk.ac.vamsas.objects.core.Alignment vAlignment) {
875         boolean removed = _alignmentList.remove(vAlignment);
876         return removed;
877     }
878
879     /**
880      * Method removeAlignmentAt.
881      * 
882      * @param index
883      * @return the element removed from the collection
884      */
885     public uk.ac.vamsas.objects.core.Alignment removeAlignmentAt(
886             final int index) {
887         java.lang.Object obj = this._alignmentList.remove(index);
888         return (uk.ac.vamsas.objects.core.Alignment) obj;
889     }
890
891     /**
892      */
893     public void removeAllAlignment(
894     ) {
895         this._alignmentList.clear();
896     }
897
898     /**
899      */
900     public void removeAllDataSetAnnotations(
901     ) {
902         this._dataSetAnnotationsList.clear();
903     }
904
905     /**
906      */
907     public void removeAllSequence(
908     ) {
909         this._sequenceList.clear();
910     }
911
912     /**
913      */
914     public void removeAllSequenceMapping(
915     ) {
916         this._sequenceMappingList.clear();
917     }
918
919     /**
920      */
921     public void removeAllTree(
922     ) {
923         this._treeList.clear();
924     }
925
926     /**
927      * Method removeDataSetAnnotations.
928      * 
929      * @param vDataSetAnnotations
930      * @return true if the object was removed from the collection.
931      */
932     public boolean removeDataSetAnnotations(
933             final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations) {
934         boolean removed = _dataSetAnnotationsList.remove(vDataSetAnnotations);
935         return removed;
936     }
937
938     /**
939      * Method removeDataSetAnnotationsAt.
940      * 
941      * @param index
942      * @return the element removed from the collection
943      */
944     public uk.ac.vamsas.objects.core.DataSetAnnotations removeDataSetAnnotationsAt(
945             final int index) {
946         java.lang.Object obj = this._dataSetAnnotationsList.remove(index);
947         return (uk.ac.vamsas.objects.core.DataSetAnnotations) obj;
948     }
949
950     /**
951      * Method removeSequence.
952      * 
953      * @param vSequence
954      * @return true if the object was removed from the collection.
955      */
956     public boolean removeSequence(
957             final uk.ac.vamsas.objects.core.Sequence vSequence) {
958         boolean removed = _sequenceList.remove(vSequence);
959         return removed;
960     }
961
962     /**
963      * Method removeSequenceAt.
964      * 
965      * @param index
966      * @return the element removed from the collection
967      */
968     public uk.ac.vamsas.objects.core.Sequence removeSequenceAt(
969             final int index) {
970         java.lang.Object obj = this._sequenceList.remove(index);
971         return (uk.ac.vamsas.objects.core.Sequence) obj;
972     }
973
974     /**
975      * Method removeSequenceMapping.
976      * 
977      * @param vSequenceMapping
978      * @return true if the object was removed from the collection.
979      */
980     public boolean removeSequenceMapping(
981             final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping) {
982         boolean removed = _sequenceMappingList.remove(vSequenceMapping);
983         return removed;
984     }
985
986     /**
987      * Method removeSequenceMappingAt.
988      * 
989      * @param index
990      * @return the element removed from the collection
991      */
992     public uk.ac.vamsas.objects.core.SequenceMapping removeSequenceMappingAt(
993             final int index) {
994         java.lang.Object obj = this._sequenceMappingList.remove(index);
995         return (uk.ac.vamsas.objects.core.SequenceMapping) obj;
996     }
997
998     /**
999      * Method removeTree.
1000      * 
1001      * @param vTree
1002      * @return true if the object was removed from the collection.
1003      */
1004     public boolean removeTree(
1005             final uk.ac.vamsas.objects.core.Tree vTree) {
1006         boolean removed = _treeList.remove(vTree);
1007         return removed;
1008     }
1009
1010     /**
1011      * Method removeTreeAt.
1012      * 
1013      * @param index
1014      * @return the element removed from the collection
1015      */
1016     public uk.ac.vamsas.objects.core.Tree removeTreeAt(
1017             final int index) {
1018         java.lang.Object obj = this._treeList.remove(index);
1019         return (uk.ac.vamsas.objects.core.Tree) obj;
1020     }
1021
1022     /**
1023      * 
1024      * 
1025      * @param index
1026      * @param vAlignment
1027      * @throws java.lang.IndexOutOfBoundsException if the index
1028      * given is outside the bounds of the collection
1029      */
1030     public void setAlignment(
1031             final int index,
1032             final uk.ac.vamsas.objects.core.Alignment vAlignment)
1033     throws java.lang.IndexOutOfBoundsException {
1034         // check bounds for index
1035         if (index < 0 || index >= this._alignmentList.size()) {
1036             throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
1037         }
1038         
1039         this._alignmentList.set(index, vAlignment);
1040     }
1041
1042     /**
1043      * 
1044      * 
1045      * @param vAlignmentArray
1046      */
1047     public void setAlignment(
1048             final uk.ac.vamsas.objects.core.Alignment[] vAlignmentArray) {
1049         //-- copy array
1050         _alignmentList.clear();
1051         
1052         for (int i = 0; i < vAlignmentArray.length; i++) {
1053                 this._alignmentList.add(vAlignmentArray[i]);
1054         }
1055     }
1056
1057     /**
1058      * Sets the value of '_alignmentList' by copying the given
1059      * Vector. All elements will be checked for type safety.
1060      * 
1061      * @param vAlignmentList the Vector to copy.
1062      */
1063     public void setAlignment(
1064             final java.util.Vector vAlignmentList) {
1065         // copy vector
1066         this._alignmentList.clear();
1067         
1068         this._alignmentList.addAll(vAlignmentList);
1069     }
1070
1071     /**
1072      * Sets the value of '_alignmentList' by setting it to the
1073      * given Vector. No type checking is performed.
1074      * @deprecated
1075      * 
1076      * @param alignmentVector the Vector to set.
1077      */
1078     public void setAlignmentAsReference(
1079             final java.util.Vector alignmentVector) {
1080         this._alignmentList = alignmentVector;
1081     }
1082
1083     /**
1084      * 
1085      * 
1086      * @param index
1087      * @param vDataSetAnnotations
1088      * @throws java.lang.IndexOutOfBoundsException if the index
1089      * given is outside the bounds of the collection
1090      */
1091     public void setDataSetAnnotations(
1092             final int index,
1093             final uk.ac.vamsas.objects.core.DataSetAnnotations vDataSetAnnotations)
1094     throws java.lang.IndexOutOfBoundsException {
1095         // check bounds for index
1096         if (index < 0 || index >= this._dataSetAnnotationsList.size()) {
1097             throw new IndexOutOfBoundsException("setDataSetAnnotations: Index value '" + index + "' not in range [0.." + (this._dataSetAnnotationsList.size() - 1) + "]");
1098         }
1099         
1100         this._dataSetAnnotationsList.set(index, vDataSetAnnotations);
1101     }
1102
1103     /**
1104      * 
1105      * 
1106      * @param vDataSetAnnotationsArray
1107      */
1108     public void setDataSetAnnotations(
1109             final uk.ac.vamsas.objects.core.DataSetAnnotations[] vDataSetAnnotationsArray) {
1110         //-- copy array
1111         _dataSetAnnotationsList.clear();
1112         
1113         for (int i = 0; i < vDataSetAnnotationsArray.length; i++) {
1114                 this._dataSetAnnotationsList.add(vDataSetAnnotationsArray[i]);
1115         }
1116     }
1117
1118     /**
1119      * Sets the value of '_dataSetAnnotationsList' by copying the
1120      * given Vector. All elements will be checked for type safety.
1121      * 
1122      * @param vDataSetAnnotationsList the Vector to copy.
1123      */
1124     public void setDataSetAnnotations(
1125             final java.util.Vector vDataSetAnnotationsList) {
1126         // copy vector
1127         this._dataSetAnnotationsList.clear();
1128         
1129         this._dataSetAnnotationsList.addAll(vDataSetAnnotationsList);
1130     }
1131
1132     /**
1133      * Sets the value of '_dataSetAnnotationsList' by setting it to
1134      * the given Vector. No type checking is performed.
1135      * @deprecated
1136      * 
1137      * @param dataSetAnnotationsVector the Vector to set.
1138      */
1139     public void setDataSetAnnotationsAsReference(
1140             final java.util.Vector dataSetAnnotationsVector) {
1141         this._dataSetAnnotationsList = dataSetAnnotationsVector;
1142     }
1143
1144     /**
1145      * Sets the value of field 'id'. The field 'id' has the
1146      * following description: Primary Key for vamsas object
1147      * referencing 
1148      * 
1149      * @param id the value of field 'id'.
1150      */
1151     public void setId(
1152             final java.lang.String id) {
1153         this._id = id;
1154     }
1155
1156     /**
1157      * Sets the value of field 'provenance'.
1158      * 
1159      * @param provenance the value of field 'provenance'.
1160      */
1161     public void setProvenance(
1162             final uk.ac.vamsas.objects.core.Provenance provenance) {
1163         this._provenance = provenance;
1164     }
1165
1166     /**
1167      * 
1168      * 
1169      * @param index
1170      * @param vSequence
1171      * @throws java.lang.IndexOutOfBoundsException if the index
1172      * given is outside the bounds of the collection
1173      */
1174     public void setSequence(
1175             final int index,
1176             final uk.ac.vamsas.objects.core.Sequence vSequence)
1177     throws java.lang.IndexOutOfBoundsException {
1178         // check bounds for index
1179         if (index < 0 || index >= this._sequenceList.size()) {
1180             throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]");
1181         }
1182         
1183         this._sequenceList.set(index, vSequence);
1184     }
1185
1186     /**
1187      * 
1188      * 
1189      * @param vSequenceArray
1190      */
1191     public void setSequence(
1192             final uk.ac.vamsas.objects.core.Sequence[] vSequenceArray) {
1193         //-- copy array
1194         _sequenceList.clear();
1195         
1196         for (int i = 0; i < vSequenceArray.length; i++) {
1197                 this._sequenceList.add(vSequenceArray[i]);
1198         }
1199     }
1200
1201     /**
1202      * Sets the value of '_sequenceList' by copying the given
1203      * Vector. All elements will be checked for type safety.
1204      * 
1205      * @param vSequenceList the Vector to copy.
1206      */
1207     public void setSequence(
1208             final java.util.Vector vSequenceList) {
1209         // copy vector
1210         this._sequenceList.clear();
1211         
1212         this._sequenceList.addAll(vSequenceList);
1213     }
1214
1215     /**
1216      * Sets the value of '_sequenceList' by setting it to the given
1217      * Vector. No type checking is performed.
1218      * @deprecated
1219      * 
1220      * @param sequenceVector the Vector to set.
1221      */
1222     public void setSequenceAsReference(
1223             final java.util.Vector sequenceVector) {
1224         this._sequenceList = sequenceVector;
1225     }
1226
1227     /**
1228      * 
1229      * 
1230      * @param index
1231      * @param vSequenceMapping
1232      * @throws java.lang.IndexOutOfBoundsException if the index
1233      * given is outside the bounds of the collection
1234      */
1235     public void setSequenceMapping(
1236             final int index,
1237             final uk.ac.vamsas.objects.core.SequenceMapping vSequenceMapping)
1238     throws java.lang.IndexOutOfBoundsException {
1239         // check bounds for index
1240         if (index < 0 || index >= this._sequenceMappingList.size()) {
1241             throw new IndexOutOfBoundsException("setSequenceMapping: Index value '" + index + "' not in range [0.." + (this._sequenceMappingList.size() - 1) + "]");
1242         }
1243         
1244         this._sequenceMappingList.set(index, vSequenceMapping);
1245     }
1246
1247     /**
1248      * 
1249      * 
1250      * @param vSequenceMappingArray
1251      */
1252     public void setSequenceMapping(
1253             final uk.ac.vamsas.objects.core.SequenceMapping[] vSequenceMappingArray) {
1254         //-- copy array
1255         _sequenceMappingList.clear();
1256         
1257         for (int i = 0; i < vSequenceMappingArray.length; i++) {
1258                 this._sequenceMappingList.add(vSequenceMappingArray[i]);
1259         }
1260     }
1261
1262     /**
1263      * Sets the value of '_sequenceMappingList' by copying the
1264      * given Vector. All elements will be checked for type safety.
1265      * 
1266      * @param vSequenceMappingList the Vector to copy.
1267      */
1268     public void setSequenceMapping(
1269             final java.util.Vector vSequenceMappingList) {
1270         // copy vector
1271         this._sequenceMappingList.clear();
1272         
1273         this._sequenceMappingList.addAll(vSequenceMappingList);
1274     }
1275
1276     /**
1277      * Sets the value of '_sequenceMappingList' by setting it to
1278      * the given Vector. No type checking is performed.
1279      * @deprecated
1280      * 
1281      * @param sequenceMappingVector the Vector to set.
1282      */
1283     public void setSequenceMappingAsReference(
1284             final java.util.Vector sequenceMappingVector) {
1285         this._sequenceMappingList = sequenceMappingVector;
1286     }
1287
1288     /**
1289      * 
1290      * 
1291      * @param index
1292      * @param vTree
1293      * @throws java.lang.IndexOutOfBoundsException if the index
1294      * given is outside the bounds of the collection
1295      */
1296     public void setTree(
1297             final int index,
1298             final uk.ac.vamsas.objects.core.Tree vTree)
1299     throws java.lang.IndexOutOfBoundsException {
1300         // check bounds for index
1301         if (index < 0 || index >= this._treeList.size()) {
1302             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
1303         }
1304         
1305         this._treeList.set(index, vTree);
1306     }
1307
1308     /**
1309      * 
1310      * 
1311      * @param vTreeArray
1312      */
1313     public void setTree(
1314             final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
1315         //-- copy array
1316         _treeList.clear();
1317         
1318         for (int i = 0; i < vTreeArray.length; i++) {
1319                 this._treeList.add(vTreeArray[i]);
1320         }
1321     }
1322
1323     /**
1324      * Sets the value of '_treeList' by copying the given Vector.
1325      * All elements will be checked for type safety.
1326      * 
1327      * @param vTreeList the Vector to copy.
1328      */
1329     public void setTree(
1330             final java.util.Vector vTreeList) {
1331         // copy vector
1332         this._treeList.clear();
1333         
1334         this._treeList.addAll(vTreeList);
1335     }
1336
1337     /**
1338      * Sets the value of '_treeList' by setting it to the given
1339      * Vector. No type checking is performed.
1340      * @deprecated
1341      * 
1342      * @param treeVector the Vector to set.
1343      */
1344     public void setTreeAsReference(
1345             final java.util.Vector treeVector) {
1346         this._treeList = treeVector;
1347     }
1348
1349     /**
1350      * Method unmarshal.
1351      * 
1352      * @param reader
1353      * @throws org.exolab.castor.xml.MarshalException if object is
1354      * null or if any SAXException is thrown during marshaling
1355      * @throws org.exolab.castor.xml.ValidationException if this
1356      * object is an invalid instance according to the schema
1357      * @return the unmarshaled uk.ac.vamsas.objects.core.DataSet
1358      */
1359     public static uk.ac.vamsas.objects.core.DataSet unmarshal(
1360             final java.io.Reader reader)
1361     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1362         return (uk.ac.vamsas.objects.core.DataSet) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.DataSet.class, reader);
1363     }
1364
1365     /**
1366      * 
1367      * 
1368      * @throws org.exolab.castor.xml.ValidationException if this
1369      * object is an invalid instance according to the schema
1370      */
1371     public void validate(
1372     )
1373     throws org.exolab.castor.xml.ValidationException {
1374         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1375         validator.validate(this);
1376     }
1377
1378 }