ffafc47f0f409d3d0964fbd3b99acb11badc131c
[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             boolean thcycle;
284             boolean tmcycle;
285             if (this._gapChar != null) {
286                 if (temp._gapChar == null) return false;
287                 if (this._gapChar != temp._gapChar) {
288                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._gapChar);
289                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._gapChar);
290                     if (thcycle!=tmcycle) {
291                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar); };
292                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar); };
293                         return false;
294                     }
295                     if (!thcycle) {
296                         if (!this._gapChar.equals(temp._gapChar)) {
297                             org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
298                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
299                             return false;
300                         }
301                         org.castor.util.CycleBreaker.releaseCycleHandle(this._gapChar);
302                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._gapChar);
303                     }
304                 }
305             } else if (temp._gapChar != null)
306                 return false;
307             if (this._aligned != temp._aligned)
308                 return false;
309             if (this._has_aligned != temp._has_aligned)
310                 return false;
311             if (this._id != null) {
312                 if (temp._id == null) return false;
313                 if (this._id != temp._id) {
314                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
315                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
316                     if (thcycle!=tmcycle) {
317                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
318                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
319                         return false;
320                     }
321                     if (!thcycle) {
322                         if (!this._id.equals(temp._id)) {
323                             org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
324                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
325                             return false;
326                         }
327                         org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
328                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
329                     }
330                 }
331             } else if (temp._id != null)
332                 return false;
333             if (this._modifiable != null) {
334                 if (temp._modifiable == null) return false;
335                 if (this._modifiable != temp._modifiable) {
336                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
337                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
338                     if (thcycle!=tmcycle) {
339                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
340                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
341                         return false;
342                     }
343                     if (!thcycle) {
344                         if (!this._modifiable.equals(temp._modifiable)) {
345                             org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
346                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
347                             return false;
348                         }
349                         org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
350                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
351                     }
352                 }
353             } else if (temp._modifiable != null)
354                 return false;
355             if (this._alignmentAnnotationList != null) {
356                 if (temp._alignmentAnnotationList == null) return false;
357                 if (this._alignmentAnnotationList != temp._alignmentAnnotationList) {
358                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentAnnotationList);
359                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentAnnotationList);
360                     if (thcycle!=tmcycle) {
361                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList); };
362                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList); };
363                         return false;
364                     }
365                     if (!thcycle) {
366                         if (!this._alignmentAnnotationList.equals(temp._alignmentAnnotationList)) {
367                             org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
368                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
369                             return false;
370                         }
371                         org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentAnnotationList);
372                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentAnnotationList);
373                     }
374                 }
375             } else if (temp._alignmentAnnotationList != null)
376                 return false;
377             if (this._treeList != null) {
378                 if (temp._treeList == null) return false;
379                 if (this._treeList != temp._treeList) {
380                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._treeList);
381                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._treeList);
382                     if (thcycle!=tmcycle) {
383                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList); };
384                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList); };
385                         return false;
386                     }
387                     if (!thcycle) {
388                         if (!this._treeList.equals(temp._treeList)) {
389                             org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
390                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
391                             return false;
392                         }
393                         org.castor.util.CycleBreaker.releaseCycleHandle(this._treeList);
394                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._treeList);
395                     }
396                 }
397             } else if (temp._treeList != null)
398                 return false;
399             if (this._alignmentSequenceList != null) {
400                 if (temp._alignmentSequenceList == null) return false;
401                 if (this._alignmentSequenceList != temp._alignmentSequenceList) {
402                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._alignmentSequenceList);
403                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._alignmentSequenceList);
404                     if (thcycle!=tmcycle) {
405                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList); };
406                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList); };
407                         return false;
408                     }
409                     if (!thcycle) {
410                         if (!this._alignmentSequenceList.equals(temp._alignmentSequenceList)) {
411                             org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
412                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
413                             return false;
414                         }
415                         org.castor.util.CycleBreaker.releaseCycleHandle(this._alignmentSequenceList);
416                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._alignmentSequenceList);
417                     }
418                 }
419             } else if (temp._alignmentSequenceList != null)
420                 return false;
421             if (this._propertyList != null) {
422                 if (temp._propertyList == null) return false;
423                 if (this._propertyList != temp._propertyList) {
424                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._propertyList);
425                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._propertyList);
426                     if (thcycle!=tmcycle) {
427                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList); };
428                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList); };
429                         return false;
430                     }
431                     if (!thcycle) {
432                         if (!this._propertyList.equals(temp._propertyList)) {
433                             org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
434                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
435                             return false;
436                         }
437                         org.castor.util.CycleBreaker.releaseCycleHandle(this._propertyList);
438                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._propertyList);
439                     }
440                 }
441             } else if (temp._propertyList != null)
442                 return false;
443             if (this._provenance != null) {
444                 if (temp._provenance == null) return false;
445                 if (this._provenance != temp._provenance) {
446                     thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
447                     tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
448                     if (thcycle!=tmcycle) {
449                         if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
450                         if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
451                         return false;
452                     }
453                     if (!thcycle) {
454                         if (!this._provenance.equals(temp._provenance)) {
455                             org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
456                             org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
457                             return false;
458                         }
459                         org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
460                         org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
461                     }
462                 }
463             } else if (temp._provenance != null)
464                 return false;
465             return true;
466         }
467         return false;
468     }
469
470     /**
471      * Returns the value of field 'aligned'.
472      * 
473      * @return the value of field 'Aligned'.
474      */
475     public boolean getAligned(
476     ) {
477         return this._aligned;
478     }
479
480     /**
481      * Method getAlignmentAnnotation.
482      * 
483      * @param index
484      * @throws java.lang.IndexOutOfBoundsException if the index
485      * given is outside the bounds of the collection
486      * @return the value of the
487      * uk.ac.vamsas.objects.core.AlignmentAnnotation at the given
488      * index
489      */
490     public uk.ac.vamsas.objects.core.AlignmentAnnotation getAlignmentAnnotation(
491             final int index)
492     throws java.lang.IndexOutOfBoundsException {
493         // check bounds for index
494         if (index < 0 || index >= this._alignmentAnnotationList.size()) {
495             throw new IndexOutOfBoundsException("getAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
496         }
497         
498         return (uk.ac.vamsas.objects.core.AlignmentAnnotation) _alignmentAnnotationList.get(index);
499     }
500
501     /**
502      * Method getAlignmentAnnotation.Returns the contents of the
503      * collection in an Array.  <p>Note:  Just in case the
504      * collection contents are changing in another thread, we pass
505      * a 0-length Array of the correct type into the API call. 
506      * This way we <i>know</i> that the Array returned is of
507      * exactly the correct length.
508      * 
509      * @return this collection as an Array
510      */
511     public uk.ac.vamsas.objects.core.AlignmentAnnotation[] getAlignmentAnnotation(
512     ) {
513         uk.ac.vamsas.objects.core.AlignmentAnnotation[] array = new uk.ac.vamsas.objects.core.AlignmentAnnotation[0];
514         return (uk.ac.vamsas.objects.core.AlignmentAnnotation[]) this._alignmentAnnotationList.toArray(array);
515     }
516
517     /**
518      * Method getAlignmentAnnotationAsReference.Returns a reference
519      * to '_alignmentAnnotationList'. No type checking is performed
520      * on any modifications to the Vector.
521      * 
522      * @return a reference to the Vector backing this class
523      */
524     public java.util.Vector getAlignmentAnnotationAsReference(
525     ) {
526         return this._alignmentAnnotationList;
527     }
528
529     /**
530      * Method getAlignmentAnnotationCount.
531      * 
532      * @return the size of this collection
533      */
534     public int getAlignmentAnnotationCount(
535     ) {
536         return this._alignmentAnnotationList.size();
537     }
538
539     /**
540      * Method getAlignmentSequence.
541      * 
542      * @param index
543      * @throws java.lang.IndexOutOfBoundsException if the index
544      * given is outside the bounds of the collection
545      * @return the value of the
546      * uk.ac.vamsas.objects.core.AlignmentSequence at the given inde
547      */
548     public uk.ac.vamsas.objects.core.AlignmentSequence getAlignmentSequence(
549             final int index)
550     throws java.lang.IndexOutOfBoundsException {
551         // check bounds for index
552         if (index < 0 || index >= this._alignmentSequenceList.size()) {
553             throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
554         }
555         
556         return (uk.ac.vamsas.objects.core.AlignmentSequence) _alignmentSequenceList.get(index);
557     }
558
559     /**
560      * Method getAlignmentSequence.Returns the contents of the
561      * collection in an Array.  <p>Note:  Just in case the
562      * collection contents are changing in another thread, we pass
563      * a 0-length Array of the correct type into the API call. 
564      * This way we <i>know</i> that the Array returned is of
565      * exactly the correct length.
566      * 
567      * @return this collection as an Array
568      */
569     public uk.ac.vamsas.objects.core.AlignmentSequence[] getAlignmentSequence(
570     ) {
571         uk.ac.vamsas.objects.core.AlignmentSequence[] array = new uk.ac.vamsas.objects.core.AlignmentSequence[0];
572         return (uk.ac.vamsas.objects.core.AlignmentSequence[]) this._alignmentSequenceList.toArray(array);
573     }
574
575     /**
576      * Method getAlignmentSequenceAsReference.Returns a reference
577      * to '_alignmentSequenceList'. No type checking is performed
578      * on any modifications to the Vector.
579      * 
580      * @return a reference to the Vector backing this class
581      */
582     public java.util.Vector getAlignmentSequenceAsReference(
583     ) {
584         return this._alignmentSequenceList;
585     }
586
587     /**
588      * Method getAlignmentSequenceCount.
589      * 
590      * @return the size of this collection
591      */
592     public int getAlignmentSequenceCount(
593     ) {
594         return this._alignmentSequenceList.size();
595     }
596
597     /**
598      * Returns the value of field 'gapChar'.
599      * 
600      * @return the value of field 'GapChar'.
601      */
602     public java.lang.String getGapChar(
603     ) {
604         return this._gapChar;
605     }
606
607     /**
608      * Returns the value of field 'id'. The field 'id' has the
609      * following description: Primary Key for vamsas object
610      * referencing
611      *  
612      * 
613      * @return the value of field 'Id'.
614      */
615     public java.lang.String getId(
616     ) {
617         return this._id;
618     }
619
620     /**
621      * Returns the value of field 'modifiable'.
622      * 
623      * @return the value of field 'Modifiable'.
624      */
625     public java.lang.String getModifiable(
626     ) {
627         return this._modifiable;
628     }
629
630     /**
631      * Method getProperty.
632      * 
633      * @param index
634      * @throws java.lang.IndexOutOfBoundsException if the index
635      * given is outside the bounds of the collection
636      * @return the value of the uk.ac.vamsas.objects.core.Property
637      * at the given index
638      */
639     public uk.ac.vamsas.objects.core.Property getProperty(
640             final int index)
641     throws java.lang.IndexOutOfBoundsException {
642         // check bounds for index
643         if (index < 0 || index >= this._propertyList.size()) {
644             throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
645         }
646         
647         return (uk.ac.vamsas.objects.core.Property) _propertyList.get(index);
648     }
649
650     /**
651      * Method getProperty.Returns the contents of the collection in
652      * an Array.  <p>Note:  Just in case the collection contents
653      * are changing in another thread, we pass a 0-length Array of
654      * the correct type into the API call.  This way we <i>know</i>
655      * that the Array returned is of exactly the correct length.
656      * 
657      * @return this collection as an Array
658      */
659     public uk.ac.vamsas.objects.core.Property[] getProperty(
660     ) {
661         uk.ac.vamsas.objects.core.Property[] array = new uk.ac.vamsas.objects.core.Property[0];
662         return (uk.ac.vamsas.objects.core.Property[]) this._propertyList.toArray(array);
663     }
664
665     /**
666      * Method getPropertyAsReference.Returns a reference to
667      * '_propertyList'. No type checking is performed on any
668      * modifications to the Vector.
669      * 
670      * @return a reference to the Vector backing this class
671      */
672     public java.util.Vector getPropertyAsReference(
673     ) {
674         return this._propertyList;
675     }
676
677     /**
678      * Method getPropertyCount.
679      * 
680      * @return the size of this collection
681      */
682     public int getPropertyCount(
683     ) {
684         return this._propertyList.size();
685     }
686
687     /**
688      * Returns the value of field 'provenance'.
689      * 
690      * @return the value of field 'Provenance'.
691      */
692     public uk.ac.vamsas.objects.core.Provenance getProvenance(
693     ) {
694         return this._provenance;
695     }
696
697     /**
698      * Method getTree.
699      * 
700      * @param index
701      * @throws java.lang.IndexOutOfBoundsException if the index
702      * given is outside the bounds of the collection
703      * @return the value of the uk.ac.vamsas.objects.core.Tree at
704      * the given index
705      */
706     public uk.ac.vamsas.objects.core.Tree getTree(
707             final int index)
708     throws java.lang.IndexOutOfBoundsException {
709         // check bounds for index
710         if (index < 0 || index >= this._treeList.size()) {
711             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
712         }
713         
714         return (uk.ac.vamsas.objects.core.Tree) _treeList.get(index);
715     }
716
717     /**
718      * Method getTree.Returns the contents of the collection in an
719      * Array.  <p>Note:  Just in case the collection contents are
720      * changing in another thread, we pass a 0-length Array of the
721      * correct type into the API call.  This way we <i>know</i>
722      * that the Array returned is of exactly the correct length.
723      * 
724      * @return this collection as an Array
725      */
726     public uk.ac.vamsas.objects.core.Tree[] getTree(
727     ) {
728         uk.ac.vamsas.objects.core.Tree[] array = new uk.ac.vamsas.objects.core.Tree[0];
729         return (uk.ac.vamsas.objects.core.Tree[]) this._treeList.toArray(array);
730     }
731
732     /**
733      * Method getTreeAsReference.Returns a reference to
734      * '_treeList'. No type checking is performed on any
735      * modifications to the Vector.
736      * 
737      * @return a reference to the Vector backing this class
738      */
739     public java.util.Vector getTreeAsReference(
740     ) {
741         return this._treeList;
742     }
743
744     /**
745      * Method getTreeCount.
746      * 
747      * @return the size of this collection
748      */
749     public int getTreeCount(
750     ) {
751         return this._treeList.size();
752     }
753
754     /**
755      * Method hasAligned.
756      * 
757      * @return true if at least one Aligned has been added
758      */
759     public boolean hasAligned(
760     ) {
761         return this._has_aligned;
762     }
763
764     /**
765      * Overrides the java.lang.Object.hashCode method.
766      * <p>
767      * The following steps came from <b>Effective Java Programming
768      * Language Guide</b> by Joshua Bloch, Chapter 3
769      * 
770      * @return a hash code value for the object.
771      */
772     public int hashCode(
773     ) {
774         int result = super.hashCode();
775         
776         long tmp;
777         if (_gapChar != null
778             && !org.castor.util.CycleBreaker.startingToCycle(_gapChar)) {
779            result = 37 * result + _gapChar.hashCode();
780            org.castor.util.CycleBreaker.releaseCycleHandle(_gapChar);
781         }
782         result = 37 * result + (_aligned?0:1);
783         if (_id != null
784             && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
785            result = 37 * result + _id.hashCode();
786            org.castor.util.CycleBreaker.releaseCycleHandle(_id);
787         }
788         if (_modifiable != null
789             && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
790            result = 37 * result + _modifiable.hashCode();
791            org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
792         }
793         if (_alignmentAnnotationList != null
794             && !org.castor.util.CycleBreaker.startingToCycle(_alignmentAnnotationList)) {
795            result = 37 * result + _alignmentAnnotationList.hashCode();
796            org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentAnnotationList);
797         }
798         if (_treeList != null
799             && !org.castor.util.CycleBreaker.startingToCycle(_treeList)) {
800            result = 37 * result + _treeList.hashCode();
801            org.castor.util.CycleBreaker.releaseCycleHandle(_treeList);
802         }
803         if (_alignmentSequenceList != null
804             && !org.castor.util.CycleBreaker.startingToCycle(_alignmentSequenceList)) {
805            result = 37 * result + _alignmentSequenceList.hashCode();
806            org.castor.util.CycleBreaker.releaseCycleHandle(_alignmentSequenceList);
807         }
808         if (_propertyList != null
809             && !org.castor.util.CycleBreaker.startingToCycle(_propertyList)) {
810            result = 37 * result + _propertyList.hashCode();
811            org.castor.util.CycleBreaker.releaseCycleHandle(_propertyList);
812         }
813         if (_provenance != null
814             && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
815            result = 37 * result + _provenance.hashCode();
816            org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
817         }
818         
819         return result;
820     }
821
822     /**
823      * Returns the value of field 'aligned'.
824      * 
825      * @return the value of field 'Aligned'.
826      */
827     public boolean isAligned(
828     ) {
829         return this._aligned;
830     }
831
832     /**
833      * Method isValid.
834      * 
835      * @return true if this object is valid according to the schema
836      */
837     public boolean isValid(
838     ) {
839         try {
840             validate();
841         } catch (org.exolab.castor.xml.ValidationException vex) {
842             return false;
843         }
844         return true;
845     }
846
847     /**
848      * 
849      * 
850      * @param out
851      * @throws org.exolab.castor.xml.MarshalException if object is
852      * null or if any SAXException is thrown during marshaling
853      * @throws org.exolab.castor.xml.ValidationException if this
854      * object is an invalid instance according to the schema
855      */
856     public void marshal(
857             final java.io.Writer out)
858     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
859         Marshaller.marshal(this, out);
860     }
861
862     /**
863      * 
864      * 
865      * @param handler
866      * @throws java.io.IOException if an IOException occurs during
867      * marshaling
868      * @throws org.exolab.castor.xml.ValidationException if this
869      * object is an invalid instance according to the schema
870      * @throws org.exolab.castor.xml.MarshalException if object is
871      * null or if any SAXException is thrown during marshaling
872      */
873     public void marshal(
874             final org.xml.sax.ContentHandler handler)
875     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
876         Marshaller.marshal(this, handler);
877     }
878
879     /**
880      * Method removeAlignmentAnnotation.
881      * 
882      * @param vAlignmentAnnotation
883      * @return true if the object was removed from the collection.
884      */
885     public boolean removeAlignmentAnnotation(
886             final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation) {
887         boolean removed = _alignmentAnnotationList.remove(vAlignmentAnnotation);
888         return removed;
889     }
890
891     /**
892      * Method removeAlignmentAnnotationAt.
893      * 
894      * @param index
895      * @return the element removed from the collection
896      */
897     public uk.ac.vamsas.objects.core.AlignmentAnnotation removeAlignmentAnnotationAt(
898             final int index) {
899         java.lang.Object obj = this._alignmentAnnotationList.remove(index);
900         return (uk.ac.vamsas.objects.core.AlignmentAnnotation) obj;
901     }
902
903     /**
904      * Method removeAlignmentSequence.
905      * 
906      * @param vAlignmentSequence
907      * @return true if the object was removed from the collection.
908      */
909     public boolean removeAlignmentSequence(
910             final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence) {
911         boolean removed = _alignmentSequenceList.remove(vAlignmentSequence);
912         return removed;
913     }
914
915     /**
916      * Method removeAlignmentSequenceAt.
917      * 
918      * @param index
919      * @return the element removed from the collection
920      */
921     public uk.ac.vamsas.objects.core.AlignmentSequence removeAlignmentSequenceAt(
922             final int index) {
923         java.lang.Object obj = this._alignmentSequenceList.remove(index);
924         return (uk.ac.vamsas.objects.core.AlignmentSequence) obj;
925     }
926
927     /**
928      */
929     public void removeAllAlignmentAnnotation(
930     ) {
931         this._alignmentAnnotationList.clear();
932     }
933
934     /**
935      */
936     public void removeAllAlignmentSequence(
937     ) {
938         this._alignmentSequenceList.clear();
939     }
940
941     /**
942      */
943     public void removeAllProperty(
944     ) {
945         this._propertyList.clear();
946     }
947
948     /**
949      */
950     public void removeAllTree(
951     ) {
952         this._treeList.clear();
953     }
954
955     /**
956      * Method removeProperty.
957      * 
958      * @param vProperty
959      * @return true if the object was removed from the collection.
960      */
961     public boolean removeProperty(
962             final uk.ac.vamsas.objects.core.Property vProperty) {
963         boolean removed = _propertyList.remove(vProperty);
964         return removed;
965     }
966
967     /**
968      * Method removePropertyAt.
969      * 
970      * @param index
971      * @return the element removed from the collection
972      */
973     public uk.ac.vamsas.objects.core.Property removePropertyAt(
974             final int index) {
975         java.lang.Object obj = this._propertyList.remove(index);
976         return (uk.ac.vamsas.objects.core.Property) obj;
977     }
978
979     /**
980      * Method removeTree.
981      * 
982      * @param vTree
983      * @return true if the object was removed from the collection.
984      */
985     public boolean removeTree(
986             final uk.ac.vamsas.objects.core.Tree vTree) {
987         boolean removed = _treeList.remove(vTree);
988         return removed;
989     }
990
991     /**
992      * Method removeTreeAt.
993      * 
994      * @param index
995      * @return the element removed from the collection
996      */
997     public uk.ac.vamsas.objects.core.Tree removeTreeAt(
998             final int index) {
999         java.lang.Object obj = this._treeList.remove(index);
1000         return (uk.ac.vamsas.objects.core.Tree) obj;
1001     }
1002
1003     /**
1004      * Sets the value of field 'aligned'.
1005      * 
1006      * @param aligned the value of field 'aligned'.
1007      */
1008     public void setAligned(
1009             final boolean aligned) {
1010         this._aligned = aligned;
1011         this._has_aligned = true;
1012     }
1013
1014     /**
1015      * 
1016      * 
1017      * @param index
1018      * @param vAlignmentAnnotation
1019      * @throws java.lang.IndexOutOfBoundsException if the index
1020      * given is outside the bounds of the collection
1021      */
1022     public void setAlignmentAnnotation(
1023             final int index,
1024             final uk.ac.vamsas.objects.core.AlignmentAnnotation vAlignmentAnnotation)
1025     throws java.lang.IndexOutOfBoundsException {
1026         // check bounds for index
1027         if (index < 0 || index >= this._alignmentAnnotationList.size()) {
1028             throw new IndexOutOfBoundsException("setAlignmentAnnotation: Index value '" + index + "' not in range [0.." + (this._alignmentAnnotationList.size() - 1) + "]");
1029         }
1030         
1031         this._alignmentAnnotationList.set(index, vAlignmentAnnotation);
1032     }
1033
1034     /**
1035      * 
1036      * 
1037      * @param vAlignmentAnnotationArray
1038      */
1039     public void setAlignmentAnnotation(
1040             final uk.ac.vamsas.objects.core.AlignmentAnnotation[] vAlignmentAnnotationArray) {
1041         //-- copy array
1042         _alignmentAnnotationList.clear();
1043         
1044         for (int i = 0; i < vAlignmentAnnotationArray.length; i++) {
1045                 this._alignmentAnnotationList.add(vAlignmentAnnotationArray[i]);
1046         }
1047     }
1048
1049     /**
1050      * Sets the value of '_alignmentAnnotationList' by copying the
1051      * given Vector. All elements will be checked for type safety.
1052      * 
1053      * @param vAlignmentAnnotationList the Vector to copy.
1054      */
1055     public void setAlignmentAnnotation(
1056             final java.util.Vector vAlignmentAnnotationList) {
1057         // copy vector
1058         this._alignmentAnnotationList.clear();
1059         
1060         this._alignmentAnnotationList.addAll(vAlignmentAnnotationList);
1061     }
1062
1063     /**
1064      * Sets the value of '_alignmentAnnotationList' by setting it
1065      * to the given Vector. No type checking is performed.
1066      * @deprecated
1067      * 
1068      * @param alignmentAnnotationVector the Vector to set.
1069      */
1070     public void setAlignmentAnnotationAsReference(
1071             final java.util.Vector alignmentAnnotationVector) {
1072         this._alignmentAnnotationList = alignmentAnnotationVector;
1073     }
1074
1075     /**
1076      * 
1077      * 
1078      * @param index
1079      * @param vAlignmentSequence
1080      * @throws java.lang.IndexOutOfBoundsException if the index
1081      * given is outside the bounds of the collection
1082      */
1083     public void setAlignmentSequence(
1084             final int index,
1085             final uk.ac.vamsas.objects.core.AlignmentSequence vAlignmentSequence)
1086     throws java.lang.IndexOutOfBoundsException {
1087         // check bounds for index
1088         if (index < 0 || index >= this._alignmentSequenceList.size()) {
1089             throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '" + index + "' not in range [0.." + (this._alignmentSequenceList.size() - 1) + "]");
1090         }
1091         
1092         this._alignmentSequenceList.set(index, vAlignmentSequence);
1093     }
1094
1095     /**
1096      * 
1097      * 
1098      * @param vAlignmentSequenceArray
1099      */
1100     public void setAlignmentSequence(
1101             final uk.ac.vamsas.objects.core.AlignmentSequence[] vAlignmentSequenceArray) {
1102         //-- copy array
1103         _alignmentSequenceList.clear();
1104         
1105         for (int i = 0; i < vAlignmentSequenceArray.length; i++) {
1106                 this._alignmentSequenceList.add(vAlignmentSequenceArray[i]);
1107         }
1108     }
1109
1110     /**
1111      * Sets the value of '_alignmentSequenceList' by copying the
1112      * given Vector. All elements will be checked for type safety.
1113      * 
1114      * @param vAlignmentSequenceList the Vector to copy.
1115      */
1116     public void setAlignmentSequence(
1117             final java.util.Vector vAlignmentSequenceList) {
1118         // copy vector
1119         this._alignmentSequenceList.clear();
1120         
1121         this._alignmentSequenceList.addAll(vAlignmentSequenceList);
1122     }
1123
1124     /**
1125      * Sets the value of '_alignmentSequenceList' by setting it to
1126      * the given Vector. No type checking is performed.
1127      * @deprecated
1128      * 
1129      * @param alignmentSequenceVector the Vector to set.
1130      */
1131     public void setAlignmentSequenceAsReference(
1132             final java.util.Vector alignmentSequenceVector) {
1133         this._alignmentSequenceList = alignmentSequenceVector;
1134     }
1135
1136     /**
1137      * Sets the value of field 'gapChar'.
1138      * 
1139      * @param gapChar the value of field 'gapChar'.
1140      */
1141     public void setGapChar(
1142             final java.lang.String gapChar) {
1143         this._gapChar = gapChar;
1144     }
1145
1146     /**
1147      * Sets the value of field 'id'. The field 'id' has the
1148      * following description: Primary Key for vamsas object
1149      * referencing
1150      *  
1151      * 
1152      * @param id the value of field 'id'.
1153      */
1154     public void setId(
1155             final java.lang.String id) {
1156         this._id = id;
1157     }
1158
1159     /**
1160      * Sets the value of field 'modifiable'.
1161      * 
1162      * @param modifiable the value of field 'modifiable'.
1163      */
1164     public void setModifiable(
1165             final java.lang.String modifiable) {
1166         this._modifiable = modifiable;
1167     }
1168
1169     /**
1170      * 
1171      * 
1172      * @param index
1173      * @param vProperty
1174      * @throws java.lang.IndexOutOfBoundsException if the index
1175      * given is outside the bounds of the collection
1176      */
1177     public void setProperty(
1178             final int index,
1179             final uk.ac.vamsas.objects.core.Property vProperty)
1180     throws java.lang.IndexOutOfBoundsException {
1181         // check bounds for index
1182         if (index < 0 || index >= this._propertyList.size()) {
1183             throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
1184         }
1185         
1186         this._propertyList.set(index, vProperty);
1187     }
1188
1189     /**
1190      * 
1191      * 
1192      * @param vPropertyArray
1193      */
1194     public void setProperty(
1195             final uk.ac.vamsas.objects.core.Property[] vPropertyArray) {
1196         //-- copy array
1197         _propertyList.clear();
1198         
1199         for (int i = 0; i < vPropertyArray.length; i++) {
1200                 this._propertyList.add(vPropertyArray[i]);
1201         }
1202     }
1203
1204     /**
1205      * Sets the value of '_propertyList' by copying the given
1206      * Vector. All elements will be checked for type safety.
1207      * 
1208      * @param vPropertyList the Vector to copy.
1209      */
1210     public void setProperty(
1211             final java.util.Vector vPropertyList) {
1212         // copy vector
1213         this._propertyList.clear();
1214         
1215         this._propertyList.addAll(vPropertyList);
1216     }
1217
1218     /**
1219      * Sets the value of '_propertyList' by setting it to the given
1220      * Vector. No type checking is performed.
1221      * @deprecated
1222      * 
1223      * @param propertyVector the Vector to set.
1224      */
1225     public void setPropertyAsReference(
1226             final java.util.Vector propertyVector) {
1227         this._propertyList = propertyVector;
1228     }
1229
1230     /**
1231      * Sets the value of field 'provenance'.
1232      * 
1233      * @param provenance the value of field 'provenance'.
1234      */
1235     public void setProvenance(
1236             final uk.ac.vamsas.objects.core.Provenance provenance) {
1237         this._provenance = provenance;
1238     }
1239
1240     /**
1241      * 
1242      * 
1243      * @param index
1244      * @param vTree
1245      * @throws java.lang.IndexOutOfBoundsException if the index
1246      * given is outside the bounds of the collection
1247      */
1248     public void setTree(
1249             final int index,
1250             final uk.ac.vamsas.objects.core.Tree vTree)
1251     throws java.lang.IndexOutOfBoundsException {
1252         // check bounds for index
1253         if (index < 0 || index >= this._treeList.size()) {
1254             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
1255         }
1256         
1257         this._treeList.set(index, vTree);
1258     }
1259
1260     /**
1261      * 
1262      * 
1263      * @param vTreeArray
1264      */
1265     public void setTree(
1266             final uk.ac.vamsas.objects.core.Tree[] vTreeArray) {
1267         //-- copy array
1268         _treeList.clear();
1269         
1270         for (int i = 0; i < vTreeArray.length; i++) {
1271                 this._treeList.add(vTreeArray[i]);
1272         }
1273     }
1274
1275     /**
1276      * Sets the value of '_treeList' by copying the given Vector.
1277      * All elements will be checked for type safety.
1278      * 
1279      * @param vTreeList the Vector to copy.
1280      */
1281     public void setTree(
1282             final java.util.Vector vTreeList) {
1283         // copy vector
1284         this._treeList.clear();
1285         
1286         this._treeList.addAll(vTreeList);
1287     }
1288
1289     /**
1290      * Sets the value of '_treeList' by setting it to the given
1291      * Vector. No type checking is performed.
1292      * @deprecated
1293      * 
1294      * @param treeVector the Vector to set.
1295      */
1296     public void setTreeAsReference(
1297             final java.util.Vector treeVector) {
1298         this._treeList = treeVector;
1299     }
1300
1301     /**
1302      * Method unmarshal.
1303      * 
1304      * @param reader
1305      * @throws org.exolab.castor.xml.MarshalException if object is
1306      * null or if any SAXException is thrown during marshaling
1307      * @throws org.exolab.castor.xml.ValidationException if this
1308      * object is an invalid instance according to the schema
1309      * @return the unmarshaled uk.ac.vamsas.objects.core.Alignment
1310      */
1311     public static uk.ac.vamsas.objects.core.Alignment unmarshal(
1312             final java.io.Reader reader)
1313     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
1314         return (uk.ac.vamsas.objects.core.Alignment) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Alignment.class, reader);
1315     }
1316
1317     /**
1318      * 
1319      * 
1320      * @throws org.exolab.castor.xml.ValidationException if this
1321      * object is an invalid instance according to the schema
1322      */
1323     public void validate(
1324     )
1325     throws org.exolab.castor.xml.ValidationException {
1326         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1327         validator.validate(this);
1328     }
1329
1330 }