update author list in license for (JAL-826)
[jalview.git] / src / jalview / binding / VAMSAS.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
4  *
5  * This file is part of Jalview.
6  *
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.binding;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
33
34 /**
35  * Class VAMSAS.
36  * 
37  * @version $Revision$ $Date$
38  */
39 public class VAMSAS implements java.io.Serializable {
40
41
42       //--------------------------/
43      //- Class/Member Variables -/
44     //--------------------------/
45
46     /**
47      * Field _alignmentList.
48      */
49     private java.util.Vector _alignmentList;
50
51     /**
52      * Field _treeList.
53      */
54     private java.util.Vector _treeList;
55
56     /**
57      * Field _sequenceSetList.
58      */
59     private java.util.Vector _sequenceSetList;
60
61
62       //----------------/
63      //- Constructors -/
64     //----------------/
65
66     public VAMSAS() {
67         super();
68         this._alignmentList = new java.util.Vector();
69         this._treeList = new java.util.Vector();
70         this._sequenceSetList = new java.util.Vector();
71     }
72
73
74       //-----------/
75      //- Methods -/
76     //-----------/
77
78     /**
79      * 
80      * 
81      * @param vAlignment
82      * @throws java.lang.IndexOutOfBoundsException if the index
83      * given is outside the bounds of the collection
84      */
85     public void addAlignment(
86             final Alignment vAlignment)
87     throws java.lang.IndexOutOfBoundsException {
88         this._alignmentList.addElement(vAlignment);
89     }
90
91     /**
92      * 
93      * 
94      * @param index
95      * @param vAlignment
96      * @throws java.lang.IndexOutOfBoundsException if the index
97      * given is outside the bounds of the collection
98      */
99     public void addAlignment(
100             final int index,
101             final Alignment vAlignment)
102     throws java.lang.IndexOutOfBoundsException {
103         this._alignmentList.add(index, vAlignment);
104     }
105
106     /**
107      * 
108      * 
109      * @param vSequenceSet
110      * @throws java.lang.IndexOutOfBoundsException if the index
111      * given is outside the bounds of the collection
112      */
113     public void addSequenceSet(
114             final SequenceSet vSequenceSet)
115     throws java.lang.IndexOutOfBoundsException {
116         this._sequenceSetList.addElement(vSequenceSet);
117     }
118
119     /**
120      * 
121      * 
122      * @param index
123      * @param vSequenceSet
124      * @throws java.lang.IndexOutOfBoundsException if the index
125      * given is outside the bounds of the collection
126      */
127     public void addSequenceSet(
128             final int index,
129             final SequenceSet vSequenceSet)
130     throws java.lang.IndexOutOfBoundsException {
131         this._sequenceSetList.add(index, vSequenceSet);
132     }
133
134     /**
135      * 
136      * 
137      * @param vTree
138      * @throws java.lang.IndexOutOfBoundsException if the index
139      * given is outside the bounds of the collection
140      */
141     public void addTree(
142             final java.lang.String vTree)
143     throws java.lang.IndexOutOfBoundsException {
144         this._treeList.addElement(vTree);
145     }
146
147     /**
148      * 
149      * 
150      * @param index
151      * @param vTree
152      * @throws java.lang.IndexOutOfBoundsException if the index
153      * given is outside the bounds of the collection
154      */
155     public void addTree(
156             final int index,
157             final java.lang.String vTree)
158     throws java.lang.IndexOutOfBoundsException {
159         this._treeList.add(index, vTree);
160     }
161
162     /**
163      * Method enumerateAlignment.
164      * 
165      * @return an Enumeration over all Alignment elements
166      */
167     public java.util.Enumeration enumerateAlignment(
168     ) {
169         return this._alignmentList.elements();
170     }
171
172     /**
173      * Method enumerateSequenceSet.
174      * 
175      * @return an Enumeration over all SequenceSet elements
176      */
177     public java.util.Enumeration enumerateSequenceSet(
178     ) {
179         return this._sequenceSetList.elements();
180     }
181
182     /**
183      * Method enumerateTree.
184      * 
185      * @return an Enumeration over all java.lang.String elements
186      */
187     public java.util.Enumeration enumerateTree(
188     ) {
189         return this._treeList.elements();
190     }
191
192     /**
193      * Method getAlignment.
194      * 
195      * @param index
196      * @throws java.lang.IndexOutOfBoundsException if the index
197      * given is outside the bounds of the collection
198      * @return the value of the Alignment at the given index
199      */
200     public Alignment getAlignment(
201             final int index)
202     throws java.lang.IndexOutOfBoundsException {
203         // check bounds for index
204         if (index < 0 || index >= this._alignmentList.size()) {
205             throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
206         }
207         
208         return (Alignment) _alignmentList.get(index);
209     }
210
211     /**
212      * Method getAlignment.Returns the contents of the collection
213      * in an Array.  <p>Note:  Just in case the collection contents
214      * are changing in another thread, we pass a 0-length Array of
215      * the correct type into the API call.  This way we <i>know</i>
216      * that the Array returned is of exactly the correct length.
217      * 
218      * @return this collection as an Array
219      */
220     public Alignment[] getAlignment(
221     ) {
222         Alignment[] array = new Alignment[0];
223         return (Alignment[]) this._alignmentList.toArray(array);
224     }
225
226     /**
227      * Method getAlignmentCount.
228      * 
229      * @return the size of this collection
230      */
231     public int getAlignmentCount(
232     ) {
233         return this._alignmentList.size();
234     }
235
236     /**
237      * Method getSequenceSet.
238      * 
239      * @param index
240      * @throws java.lang.IndexOutOfBoundsException if the index
241      * given is outside the bounds of the collection
242      * @return the value of the SequenceSet at the given index
243      */
244     public SequenceSet getSequenceSet(
245             final int index)
246     throws java.lang.IndexOutOfBoundsException {
247         // check bounds for index
248         if (index < 0 || index >= this._sequenceSetList.size()) {
249             throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
250         }
251         
252         return (SequenceSet) _sequenceSetList.get(index);
253     }
254
255     /**
256      * Method getSequenceSet.Returns the contents of the collection
257      * in an Array.  <p>Note:  Just in case the collection contents
258      * are changing in another thread, we pass a 0-length Array of
259      * the correct type into the API call.  This way we <i>know</i>
260      * that the Array returned is of exactly the correct length.
261      * 
262      * @return this collection as an Array
263      */
264     public SequenceSet[] getSequenceSet(
265     ) {
266         SequenceSet[] array = new SequenceSet[0];
267         return (SequenceSet[]) this._sequenceSetList.toArray(array);
268     }
269
270     /**
271      * Method getSequenceSetCount.
272      * 
273      * @return the size of this collection
274      */
275     public int getSequenceSetCount(
276     ) {
277         return this._sequenceSetList.size();
278     }
279
280     /**
281      * Method getTree.
282      * 
283      * @param index
284      * @throws java.lang.IndexOutOfBoundsException if the index
285      * given is outside the bounds of the collection
286      * @return the value of the java.lang.String at the given index
287      */
288     public java.lang.String getTree(
289             final int index)
290     throws java.lang.IndexOutOfBoundsException {
291         // check bounds for index
292         if (index < 0 || index >= this._treeList.size()) {
293             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
294         }
295         
296         return (java.lang.String) _treeList.get(index);
297     }
298
299     /**
300      * Method getTree.Returns the contents of the collection in an
301      * Array.  <p>Note:  Just in case the collection contents are
302      * changing in another thread, we pass a 0-length Array of the
303      * correct type into the API call.  This way we <i>know</i>
304      * that the Array returned is of exactly the correct length.
305      * 
306      * @return this collection as an Array
307      */
308     public java.lang.String[] getTree(
309     ) {
310         java.lang.String[] array = new java.lang.String[0];
311         return (java.lang.String[]) this._treeList.toArray(array);
312     }
313
314     /**
315      * Method getTreeCount.
316      * 
317      * @return the size of this collection
318      */
319     public int getTreeCount(
320     ) {
321         return this._treeList.size();
322     }
323
324     /**
325      * Method isValid.
326      * 
327      * @return true if this object is valid according to the schema
328      */
329     public boolean isValid(
330     ) {
331         try {
332             validate();
333         } catch (org.exolab.castor.xml.ValidationException vex) {
334             return false;
335         }
336         return true;
337     }
338
339     /**
340      * 
341      * 
342      * @param out
343      * @throws org.exolab.castor.xml.MarshalException if object is
344      * null or if any SAXException is thrown during marshaling
345      * @throws org.exolab.castor.xml.ValidationException if this
346      * object is an invalid instance according to the schema
347      */
348     public void marshal(
349             final java.io.Writer out)
350     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
351         Marshaller.marshal(this, out);
352     }
353
354     /**
355      * 
356      * 
357      * @param handler
358      * @throws java.io.IOException if an IOException occurs during
359      * marshaling
360      * @throws org.exolab.castor.xml.ValidationException if this
361      * object is an invalid instance according to the schema
362      * @throws org.exolab.castor.xml.MarshalException if object is
363      * null or if any SAXException is thrown during marshaling
364      */
365     public void marshal(
366             final org.xml.sax.ContentHandler handler)
367     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
368         Marshaller.marshal(this, handler);
369     }
370
371     /**
372      * Method removeAlignment.
373      * 
374      * @param vAlignment
375      * @return true if the object was removed from the collection.
376      */
377     public boolean removeAlignment(
378             final Alignment vAlignment) {
379         boolean removed = _alignmentList.remove(vAlignment);
380         return removed;
381     }
382
383     /**
384      * Method removeAlignmentAt.
385      * 
386      * @param index
387      * @return the element removed from the collection
388      */
389     public Alignment removeAlignmentAt(
390             final int index) {
391         java.lang.Object obj = this._alignmentList.remove(index);
392         return (Alignment) obj;
393     }
394
395     /**
396      */
397     public void removeAllAlignment(
398     ) {
399         this._alignmentList.clear();
400     }
401
402     /**
403      */
404     public void removeAllSequenceSet(
405     ) {
406         this._sequenceSetList.clear();
407     }
408
409     /**
410      */
411     public void removeAllTree(
412     ) {
413         this._treeList.clear();
414     }
415
416     /**
417      * Method removeSequenceSet.
418      * 
419      * @param vSequenceSet
420      * @return true if the object was removed from the collection.
421      */
422     public boolean removeSequenceSet(
423             final SequenceSet vSequenceSet) {
424         boolean removed = _sequenceSetList.remove(vSequenceSet);
425         return removed;
426     }
427
428     /**
429      * Method removeSequenceSetAt.
430      * 
431      * @param index
432      * @return the element removed from the collection
433      */
434     public SequenceSet removeSequenceSetAt(
435             final int index) {
436         java.lang.Object obj = this._sequenceSetList.remove(index);
437         return (SequenceSet) obj;
438     }
439
440     /**
441      * Method removeTree.
442      * 
443      * @param vTree
444      * @return true if the object was removed from the collection.
445      */
446     public boolean removeTree(
447             final java.lang.String vTree) {
448         boolean removed = _treeList.remove(vTree);
449         return removed;
450     }
451
452     /**
453      * Method removeTreeAt.
454      * 
455      * @param index
456      * @return the element removed from the collection
457      */
458     public java.lang.String removeTreeAt(
459             final int index) {
460         java.lang.Object obj = this._treeList.remove(index);
461         return (java.lang.String) obj;
462     }
463
464     /**
465      * 
466      * 
467      * @param index
468      * @param vAlignment
469      * @throws java.lang.IndexOutOfBoundsException if the index
470      * given is outside the bounds of the collection
471      */
472     public void setAlignment(
473             final int index,
474             final Alignment vAlignment)
475     throws java.lang.IndexOutOfBoundsException {
476         // check bounds for index
477         if (index < 0 || index >= this._alignmentList.size()) {
478             throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
479         }
480         
481         this._alignmentList.set(index, vAlignment);
482     }
483
484     /**
485      * 
486      * 
487      * @param vAlignmentArray
488      */
489     public void setAlignment(
490             final Alignment[] vAlignmentArray) {
491         //-- copy array
492         _alignmentList.clear();
493         
494         for (int i = 0; i < vAlignmentArray.length; i++) {
495                 this._alignmentList.add(vAlignmentArray[i]);
496         }
497     }
498
499     /**
500      * 
501      * 
502      * @param index
503      * @param vSequenceSet
504      * @throws java.lang.IndexOutOfBoundsException if the index
505      * given is outside the bounds of the collection
506      */
507     public void setSequenceSet(
508             final int index,
509             final SequenceSet vSequenceSet)
510     throws java.lang.IndexOutOfBoundsException {
511         // check bounds for index
512         if (index < 0 || index >= this._sequenceSetList.size()) {
513             throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
514         }
515         
516         this._sequenceSetList.set(index, vSequenceSet);
517     }
518
519     /**
520      * 
521      * 
522      * @param vSequenceSetArray
523      */
524     public void setSequenceSet(
525             final SequenceSet[] vSequenceSetArray) {
526         //-- copy array
527         _sequenceSetList.clear();
528         
529         for (int i = 0; i < vSequenceSetArray.length; i++) {
530                 this._sequenceSetList.add(vSequenceSetArray[i]);
531         }
532     }
533
534     /**
535      * 
536      * 
537      * @param index
538      * @param vTree
539      * @throws java.lang.IndexOutOfBoundsException if the index
540      * given is outside the bounds of the collection
541      */
542     public void setTree(
543             final int index,
544             final java.lang.String vTree)
545     throws java.lang.IndexOutOfBoundsException {
546         // check bounds for index
547         if (index < 0 || index >= this._treeList.size()) {
548             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
549         }
550         
551         this._treeList.set(index, vTree);
552     }
553
554     /**
555      * 
556      * 
557      * @param vTreeArray
558      */
559     public void setTree(
560             final java.lang.String[] vTreeArray) {
561         //-- copy array
562         _treeList.clear();
563         
564         for (int i = 0; i < vTreeArray.length; i++) {
565                 this._treeList.add(vTreeArray[i]);
566         }
567     }
568
569     /**
570      * Method unmarshal.
571      * 
572      * @param reader
573      * @throws org.exolab.castor.xml.MarshalException if object is
574      * null or if any SAXException is thrown during marshaling
575      * @throws org.exolab.castor.xml.ValidationException if this
576      * object is an invalid instance according to the schema
577      * @return the unmarshaled jalview.binding.VAMSAS
578      */
579     public static jalview.binding.VAMSAS unmarshal(
580             final java.io.Reader reader)
581     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
582         return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VAMSAS.class, reader);
583     }
584
585     /**
586      * 
587      * 
588      * @throws org.exolab.castor.xml.ValidationException if this
589      * object is an invalid instance according to the schema
590      */
591     public void validate(
592     )
593     throws org.exolab.castor.xml.ValidationException {
594         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
595         validator.validate(this);
596     }
597
598 }