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