first attempt at object build.
[vamsas.git] / src / org / vamsas / client / objects / Alignment.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.client.objects;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
25
26 /**
27  * Class Alignment.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class Alignment extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _alignmentAnnotations
42      */
43     private org.vamsas.client.objects.AlignmentAnnotations _alignmentAnnotations;
44
45     /**
46      * Field _treeList
47      */
48     private java.util.Vector _treeList;
49
50     /**
51      * Field _alignmentSequenceList
52      */
53     private java.util.Vector _alignmentSequenceList;
54
55     /**
56      * Field _provenance
57      */
58     private org.vamsas.client.objects.Provenance _provenance;
59
60
61       //----------------/
62      //- Constructors -/
63     //----------------/
64
65     public Alignment() 
66      {
67         super();
68         _treeList = new Vector();
69         _alignmentSequenceList = new Vector();
70     } //-- org.vamsas.client.objects.Alignment()
71
72
73       //-----------/
74      //- Methods -/
75     //-----------/
76
77     /**
78      * Method addAlignmentSequence
79      * 
80      * 
81      * 
82      * @param vAlignmentSequence
83      */
84     public void addAlignmentSequence(org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
85         throws java.lang.IndexOutOfBoundsException
86     {
87         _alignmentSequenceList.addElement(vAlignmentSequence);
88     } //-- void addAlignmentSequence(org.vamsas.client.objects.AlignmentSequence) 
89
90     /**
91      * Method addAlignmentSequence
92      * 
93      * 
94      * 
95      * @param index
96      * @param vAlignmentSequence
97      */
98     public void addAlignmentSequence(int index, org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
99         throws java.lang.IndexOutOfBoundsException
100     {
101         _alignmentSequenceList.insertElementAt(vAlignmentSequence, index);
102     } //-- void addAlignmentSequence(int, org.vamsas.client.objects.AlignmentSequence) 
103
104     /**
105      * Method addTree
106      * 
107      * 
108      * 
109      * @param vTree
110      */
111     public void addTree(org.vamsas.client.objects.Tree vTree)
112         throws java.lang.IndexOutOfBoundsException
113     {
114         _treeList.addElement(vTree);
115     } //-- void addTree(org.vamsas.client.objects.Tree) 
116
117     /**
118      * Method addTree
119      * 
120      * 
121      * 
122      * @param index
123      * @param vTree
124      */
125     public void addTree(int index, org.vamsas.client.objects.Tree vTree)
126         throws java.lang.IndexOutOfBoundsException
127     {
128         _treeList.insertElementAt(vTree, index);
129     } //-- void addTree(int, org.vamsas.client.objects.Tree) 
130
131     /**
132      * Method enumerateAlignmentSequence
133      * 
134      * 
135      * 
136      * @return Enumeration
137      */
138     public java.util.Enumeration enumerateAlignmentSequence()
139     {
140         return _alignmentSequenceList.elements();
141     } //-- java.util.Enumeration enumerateAlignmentSequence() 
142
143     /**
144      * Method enumerateTree
145      * 
146      * 
147      * 
148      * @return Enumeration
149      */
150     public java.util.Enumeration enumerateTree()
151     {
152         return _treeList.elements();
153     } //-- java.util.Enumeration enumerateTree() 
154
155     /**
156      * Note: hashCode() has not been overriden
157      * 
158      * @param obj
159      * @return boolean
160      */
161     public boolean equals(java.lang.Object obj)
162     {
163         if ( this == obj )
164             return true;
165         
166         if (super.equals(obj)==false)
167             return false;
168         
169         if (obj instanceof Alignment) {
170         
171             Alignment temp = (Alignment)obj;
172             if (this._alignmentAnnotations != null) {
173                 if (temp._alignmentAnnotations == null) return false;
174                 else if (!(this._alignmentAnnotations.equals(temp._alignmentAnnotations))) 
175                     return false;
176             }
177             else if (temp._alignmentAnnotations != null)
178                 return false;
179             if (this._treeList != null) {
180                 if (temp._treeList == null) return false;
181                 else if (!(this._treeList.equals(temp._treeList))) 
182                     return false;
183             }
184             else if (temp._treeList != null)
185                 return false;
186             if (this._alignmentSequenceList != null) {
187                 if (temp._alignmentSequenceList == null) return false;
188                 else if (!(this._alignmentSequenceList.equals(temp._alignmentSequenceList))) 
189                     return false;
190             }
191             else if (temp._alignmentSequenceList != null)
192                 return false;
193             if (this._provenance != null) {
194                 if (temp._provenance == null) return false;
195                 else if (!(this._provenance.equals(temp._provenance))) 
196                     return false;
197             }
198             else if (temp._provenance != null)
199                 return false;
200             return true;
201         }
202         return false;
203     } //-- boolean equals(java.lang.Object) 
204
205     /**
206      * Returns the value of field 'alignmentAnnotations'.
207      * 
208      * @return AlignmentAnnotations
209      * @return the value of field 'alignmentAnnotations'.
210      */
211     public org.vamsas.client.objects.AlignmentAnnotations getAlignmentAnnotations()
212     {
213         return this._alignmentAnnotations;
214     } //-- org.vamsas.client.objects.AlignmentAnnotations getAlignmentAnnotations() 
215
216     /**
217      * Method getAlignmentSequence
218      * 
219      * 
220      * 
221      * @param index
222      * @return AlignmentSequence
223      */
224     public org.vamsas.client.objects.AlignmentSequence getAlignmentSequence(int index)
225         throws java.lang.IndexOutOfBoundsException
226     {
227         //-- check bounds for index
228         if ((index < 0) || (index > _alignmentSequenceList.size())) {
229             throw new IndexOutOfBoundsException("getAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
230         }
231         
232         return (org.vamsas.client.objects.AlignmentSequence) _alignmentSequenceList.elementAt(index);
233     } //-- org.vamsas.client.objects.AlignmentSequence getAlignmentSequence(int) 
234
235     /**
236      * Method getAlignmentSequence
237      * 
238      * 
239      * 
240      * @return AlignmentSequence
241      */
242     public org.vamsas.client.objects.AlignmentSequence[] getAlignmentSequence()
243     {
244         int size = _alignmentSequenceList.size();
245         org.vamsas.client.objects.AlignmentSequence[] mArray = new org.vamsas.client.objects.AlignmentSequence[size];
246         for (int index = 0; index < size; index++) {
247             mArray[index] = (org.vamsas.client.objects.AlignmentSequence) _alignmentSequenceList.elementAt(index);
248         }
249         return mArray;
250     } //-- org.vamsas.client.objects.AlignmentSequence[] getAlignmentSequence() 
251
252     /**
253      * Method getAlignmentSequenceAsReference
254      * 
255      * Returns a reference to 'alignmentSequence'. No type checking
256      * is performed on any modications to the Vector.
257      * 
258      * @return Vector
259      * @return returns a reference to the Vector.
260      */
261     public java.util.Vector getAlignmentSequenceAsReference()
262     {
263         return _alignmentSequenceList;
264     } //-- java.util.Vector getAlignmentSequenceAsReference() 
265
266     /**
267      * Method getAlignmentSequenceCount
268      * 
269      * 
270      * 
271      * @return int
272      */
273     public int getAlignmentSequenceCount()
274     {
275         return _alignmentSequenceList.size();
276     } //-- int getAlignmentSequenceCount() 
277
278     /**
279      * Returns the value of field 'provenance'.
280      * 
281      * @return Provenance
282      * @return the value of field 'provenance'.
283      */
284     public org.vamsas.client.objects.Provenance getProvenance()
285     {
286         return this._provenance;
287     } //-- org.vamsas.client.objects.Provenance getProvenance() 
288
289     /**
290      * Method getTree
291      * 
292      * 
293      * 
294      * @param index
295      * @return Tree
296      */
297     public org.vamsas.client.objects.Tree getTree(int index)
298         throws java.lang.IndexOutOfBoundsException
299     {
300         //-- check bounds for index
301         if ((index < 0) || (index > _treeList.size())) {
302             throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
303         }
304         
305         return (org.vamsas.client.objects.Tree) _treeList.elementAt(index);
306     } //-- org.vamsas.client.objects.Tree getTree(int) 
307
308     /**
309      * Method getTree
310      * 
311      * 
312      * 
313      * @return Tree
314      */
315     public org.vamsas.client.objects.Tree[] getTree()
316     {
317         int size = _treeList.size();
318         org.vamsas.client.objects.Tree[] mArray = new org.vamsas.client.objects.Tree[size];
319         for (int index = 0; index < size; index++) {
320             mArray[index] = (org.vamsas.client.objects.Tree) _treeList.elementAt(index);
321         }
322         return mArray;
323     } //-- org.vamsas.client.objects.Tree[] getTree() 
324
325     /**
326      * Method getTreeAsReference
327      * 
328      * Returns a reference to 'tree'. No type checking is performed
329      * on any modications to the Vector.
330      * 
331      * @return Vector
332      * @return returns a reference to the Vector.
333      */
334     public java.util.Vector getTreeAsReference()
335     {
336         return _treeList;
337     } //-- java.util.Vector getTreeAsReference() 
338
339     /**
340      * Method getTreeCount
341      * 
342      * 
343      * 
344      * @return int
345      */
346     public int getTreeCount()
347     {
348         return _treeList.size();
349     } //-- int getTreeCount() 
350
351     /**
352      * Method isValid
353      * 
354      * 
355      * 
356      * @return boolean
357      */
358     public boolean isValid()
359     {
360         try {
361             validate();
362         }
363         catch (org.exolab.castor.xml.ValidationException vex) {
364             return false;
365         }
366         return true;
367     } //-- boolean isValid() 
368
369     /**
370      * Method marshal
371      * 
372      * 
373      * 
374      * @param out
375      */
376     public void marshal(java.io.Writer out)
377         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
378     {
379         
380         Marshaller.marshal(this, out);
381     } //-- void marshal(java.io.Writer) 
382
383     /**
384      * Method marshal
385      * 
386      * 
387      * 
388      * @param handler
389      */
390     public void marshal(org.xml.sax.ContentHandler handler)
391         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
392     {
393         
394         Marshaller.marshal(this, handler);
395     } //-- void marshal(org.xml.sax.ContentHandler) 
396
397     /**
398      * Method removeAlignmentSequence
399      * 
400      * 
401      * 
402      * @param index
403      * @return AlignmentSequence
404      */
405     public org.vamsas.client.objects.AlignmentSequence removeAlignmentSequence(int index)
406     {
407         java.lang.Object obj = _alignmentSequenceList.elementAt(index);
408         _alignmentSequenceList.removeElementAt(index);
409         return (org.vamsas.client.objects.AlignmentSequence) obj;
410     } //-- org.vamsas.client.objects.AlignmentSequence removeAlignmentSequence(int) 
411
412     /**
413      * Method removeAllAlignmentSequence
414      * 
415      */
416     public void removeAllAlignmentSequence()
417     {
418         _alignmentSequenceList.removeAllElements();
419     } //-- void removeAllAlignmentSequence() 
420
421     /**
422      * Method removeAllTree
423      * 
424      */
425     public void removeAllTree()
426     {
427         _treeList.removeAllElements();
428     } //-- void removeAllTree() 
429
430     /**
431      * Method removeTree
432      * 
433      * 
434      * 
435      * @param index
436      * @return Tree
437      */
438     public org.vamsas.client.objects.Tree removeTree(int index)
439     {
440         java.lang.Object obj = _treeList.elementAt(index);
441         _treeList.removeElementAt(index);
442         return (org.vamsas.client.objects.Tree) obj;
443     } //-- org.vamsas.client.objects.Tree removeTree(int) 
444
445     /**
446      * Sets the value of field 'alignmentAnnotations'.
447      * 
448      * @param alignmentAnnotations the value of field
449      * 'alignmentAnnotations'.
450      */
451     public void setAlignmentAnnotations(org.vamsas.client.objects.AlignmentAnnotations alignmentAnnotations)
452     {
453         this._alignmentAnnotations = alignmentAnnotations;
454     } //-- void setAlignmentAnnotations(org.vamsas.client.objects.AlignmentAnnotations) 
455
456     /**
457      * Method setAlignmentSequence
458      * 
459      * 
460      * 
461      * @param index
462      * @param vAlignmentSequence
463      */
464     public void setAlignmentSequence(int index, org.vamsas.client.objects.AlignmentSequence vAlignmentSequence)
465         throws java.lang.IndexOutOfBoundsException
466     {
467         //-- check bounds for index
468         if ((index < 0) || (index > _alignmentSequenceList.size())) {
469             throw new IndexOutOfBoundsException("setAlignmentSequence: Index value '"+index+"' not in range [0.."+_alignmentSequenceList.size()+ "]");
470         }
471         _alignmentSequenceList.setElementAt(vAlignmentSequence, index);
472     } //-- void setAlignmentSequence(int, org.vamsas.client.objects.AlignmentSequence) 
473
474     /**
475      * Method setAlignmentSequence
476      * 
477      * 
478      * 
479      * @param alignmentSequenceArray
480      */
481     public void setAlignmentSequence(org.vamsas.client.objects.AlignmentSequence[] alignmentSequenceArray)
482     {
483         //-- copy array
484         _alignmentSequenceList.removeAllElements();
485         for (int i = 0; i < alignmentSequenceArray.length; i++) {
486             _alignmentSequenceList.addElement(alignmentSequenceArray[i]);
487         }
488     } //-- void setAlignmentSequence(org.vamsas.client.objects.AlignmentSequence) 
489
490     /**
491      * Method setAlignmentSequence
492      * 
493      * Sets the value of 'alignmentSequence' by copying the given
494      * Vector.
495      * 
496      * @param alignmentSequenceVector the Vector to copy.
497      */
498     public void setAlignmentSequence(java.util.Vector alignmentSequenceVector)
499     {
500         //-- copy vector
501         _alignmentSequenceList.removeAllElements();
502         for (int i = 0; i < alignmentSequenceVector.size(); i++) {
503             _alignmentSequenceList.addElement((org.vamsas.client.objects.AlignmentSequence)alignmentSequenceVector.elementAt(i));
504         }
505     } //-- void setAlignmentSequence(java.util.Vector) 
506
507     /**
508      * Method setAlignmentSequenceAsReference
509      * 
510      * Sets the value of 'alignmentSequence' by setting it to the
511      * given Vector. No type checking is performed.
512      * 
513      * @param alignmentSequenceVector the Vector to copy.
514      */
515     public void setAlignmentSequenceAsReference(java.util.Vector alignmentSequenceVector)
516     {
517         _alignmentSequenceList = alignmentSequenceVector;
518     } //-- void setAlignmentSequenceAsReference(java.util.Vector) 
519
520     /**
521      * Sets the value of field 'provenance'.
522      * 
523      * @param provenance the value of field 'provenance'.
524      */
525     public void setProvenance(org.vamsas.client.objects.Provenance provenance)
526     {
527         this._provenance = provenance;
528     } //-- void setProvenance(org.vamsas.client.objects.Provenance) 
529
530     /**
531      * Method setTree
532      * 
533      * 
534      * 
535      * @param index
536      * @param vTree
537      */
538     public void setTree(int index, org.vamsas.client.objects.Tree vTree)
539         throws java.lang.IndexOutOfBoundsException
540     {
541         //-- check bounds for index
542         if ((index < 0) || (index > _treeList.size())) {
543             throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
544         }
545         _treeList.setElementAt(vTree, index);
546     } //-- void setTree(int, org.vamsas.client.objects.Tree) 
547
548     /**
549      * Method setTree
550      * 
551      * 
552      * 
553      * @param treeArray
554      */
555     public void setTree(org.vamsas.client.objects.Tree[] treeArray)
556     {
557         //-- copy array
558         _treeList.removeAllElements();
559         for (int i = 0; i < treeArray.length; i++) {
560             _treeList.addElement(treeArray[i]);
561         }
562     } //-- void setTree(org.vamsas.client.objects.Tree) 
563
564     /**
565      * Method setTree
566      * 
567      * Sets the value of 'tree' by copying the given Vector.
568      * 
569      * @param treeVector the Vector to copy.
570      */
571     public void setTree(java.util.Vector treeVector)
572     {
573         //-- copy vector
574         _treeList.removeAllElements();
575         for (int i = 0; i < treeVector.size(); i++) {
576             _treeList.addElement((org.vamsas.client.objects.Tree)treeVector.elementAt(i));
577         }
578     } //-- void setTree(java.util.Vector) 
579
580     /**
581      * Method setTreeAsReference
582      * 
583      * Sets the value of 'tree' by setting it to the given Vector.
584      * No type checking is performed.
585      * 
586      * @param treeVector the Vector to copy.
587      */
588     public void setTreeAsReference(java.util.Vector treeVector)
589     {
590         _treeList = treeVector;
591     } //-- void setTreeAsReference(java.util.Vector) 
592
593     /**
594      * Method unmarshal
595      * 
596      * 
597      * 
598      * @param reader
599      * @return Alignment
600      */
601     public static org.vamsas.client.objects.Alignment unmarshal(java.io.Reader reader)
602         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
603     {
604         return (org.vamsas.client.objects.Alignment) Unmarshaller.unmarshal(org.vamsas.client.objects.Alignment.class, reader);
605     } //-- org.vamsas.client.objects.Alignment unmarshal(java.io.Reader) 
606
607     /**
608      * Method validate
609      * 
610      */
611     public void validate()
612         throws org.exolab.castor.xml.ValidationException
613     {
614         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
615         validator.validate(this);
616     } //-- void validate() 
617
618 }