update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / 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.schemabinding.version2;
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 _treeList.
48      */
49     private java.util.Vector _treeList;
50
51     /**
52      * Field _sequenceSetList.
53      */
54     private java.util.Vector _sequenceSetList;
55
56
57       //----------------/
58      //- Constructors -/
59     //----------------/
60
61     public VAMSAS() {
62         super();
63         this._treeList = new java.util.Vector();
64         this._sequenceSetList = new java.util.Vector();
65     }
66
67
68       //-----------/
69      //- Methods -/
70     //-----------/
71
72     /**
73      * 
74      * 
75      * @param vSequenceSet
76      * @throws java.lang.IndexOutOfBoundsException if the index
77      * given is outside the bounds of the collection
78      */
79     public void addSequenceSet(
80             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
81     throws java.lang.IndexOutOfBoundsException {
82         this._sequenceSetList.addElement(vSequenceSet);
83     }
84
85     /**
86      * 
87      * 
88      * @param index
89      * @param vSequenceSet
90      * @throws java.lang.IndexOutOfBoundsException if the index
91      * given is outside the bounds of the collection
92      */
93     public void addSequenceSet(
94             final int index,
95             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
96     throws java.lang.IndexOutOfBoundsException {
97         this._sequenceSetList.add(index, vSequenceSet);
98     }
99
100     /**
101      * 
102      * 
103      * @param vTree
104      * @throws java.lang.IndexOutOfBoundsException if the index
105      * given is outside the bounds of the collection
106      */
107     public void addTree(
108             final java.lang.String vTree)
109     throws java.lang.IndexOutOfBoundsException {
110         this._treeList.addElement(vTree);
111     }
112
113     /**
114      * 
115      * 
116      * @param index
117      * @param vTree
118      * @throws java.lang.IndexOutOfBoundsException if the index
119      * given is outside the bounds of the collection
120      */
121     public void addTree(
122             final int index,
123             final java.lang.String vTree)
124     throws java.lang.IndexOutOfBoundsException {
125         this._treeList.add(index, vTree);
126     }
127
128     /**
129      * Method enumerateSequenceSet.
130      * 
131      * @return an Enumeration over all
132      * jalview.schemabinding.version2.SequenceSet elements
133      */
134     public java.util.Enumeration enumerateSequenceSet(
135     ) {
136         return this._sequenceSetList.elements();
137     }
138
139     /**
140      * Method enumerateTree.
141      * 
142      * @return an Enumeration over all java.lang.String elements
143      */
144     public java.util.Enumeration enumerateTree(
145     ) {
146         return this._treeList.elements();
147     }
148
149     /**
150      * Method getSequenceSet.
151      * 
152      * @param index
153      * @throws java.lang.IndexOutOfBoundsException if the index
154      * given is outside the bounds of the collection
155      * @return the value of the
156      * jalview.schemabinding.version2.SequenceSet at the given index
157      */
158     public jalview.schemabinding.version2.SequenceSet getSequenceSet(
159             final int index)
160     throws java.lang.IndexOutOfBoundsException {
161         // check bounds for index
162         if (index < 0 || index >= this._sequenceSetList.size()) {
163             throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
164         }
165         
166         return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.get(index);
167     }
168
169     /**
170      * Method getSequenceSet.Returns the contents of the collection
171      * in an Array.  <p>Note:  Just in case the collection contents
172      * are changing in another thread, we pass a 0-length Array of
173      * the correct type into the API call.  This way we <i>know</i>
174      * that the Array returned is of exactly the correct length.
175      * 
176      * @return this collection as an Array
177      */
178     public jalview.schemabinding.version2.SequenceSet[] getSequenceSet(
179     ) {
180         jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0];
181         return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList.toArray(array);
182     }
183
184     /**
185      * Method getSequenceSetCount.
186      * 
187      * @return the size of this collection
188      */
189     public int getSequenceSetCount(
190     ) {
191         return this._sequenceSetList.size();
192     }
193
194     /**
195      * Method getTree.
196      * 
197      * @param index
198      * @throws java.lang.IndexOutOfBoundsException if the index
199      * given is outside the bounds of the collection
200      * @return the value of the java.lang.String at the given index
201      */
202     public java.lang.String getTree(
203             final int index)
204     throws java.lang.IndexOutOfBoundsException {
205         // check bounds for index
206         if (index < 0 || index >= this._treeList.size()) {
207             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
208         }
209         
210         return (java.lang.String) _treeList.get(index);
211     }
212
213     /**
214      * Method getTree.Returns the contents of the collection in an
215      * Array.  <p>Note:  Just in case the collection contents are
216      * changing in another thread, we pass a 0-length Array of the
217      * correct type into the API call.  This way we <i>know</i>
218      * that the Array returned is of exactly the correct length.
219      * 
220      * @return this collection as an Array
221      */
222     public java.lang.String[] getTree(
223     ) {
224         java.lang.String[] array = new java.lang.String[0];
225         return (java.lang.String[]) this._treeList.toArray(array);
226     }
227
228     /**
229      * Method getTreeCount.
230      * 
231      * @return the size of this collection
232      */
233     public int getTreeCount(
234     ) {
235         return this._treeList.size();
236     }
237
238     /**
239      * Method isValid.
240      * 
241      * @return true if this object is valid according to the schema
242      */
243     public boolean isValid(
244     ) {
245         try {
246             validate();
247         } catch (org.exolab.castor.xml.ValidationException vex) {
248             return false;
249         }
250         return true;
251     }
252
253     /**
254      * 
255      * 
256      * @param out
257      * @throws org.exolab.castor.xml.MarshalException if object is
258      * null or if any SAXException is thrown during marshaling
259      * @throws org.exolab.castor.xml.ValidationException if this
260      * object is an invalid instance according to the schema
261      */
262     public void marshal(
263             final java.io.Writer out)
264     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
265         Marshaller.marshal(this, out);
266     }
267
268     /**
269      * 
270      * 
271      * @param handler
272      * @throws java.io.IOException if an IOException occurs during
273      * marshaling
274      * @throws org.exolab.castor.xml.ValidationException if this
275      * object is an invalid instance according to the schema
276      * @throws org.exolab.castor.xml.MarshalException if object is
277      * null or if any SAXException is thrown during marshaling
278      */
279     public void marshal(
280             final org.xml.sax.ContentHandler handler)
281     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
282         Marshaller.marshal(this, handler);
283     }
284
285     /**
286      */
287     public void removeAllSequenceSet(
288     ) {
289         this._sequenceSetList.clear();
290     }
291
292     /**
293      */
294     public void removeAllTree(
295     ) {
296         this._treeList.clear();
297     }
298
299     /**
300      * Method removeSequenceSet.
301      * 
302      * @param vSequenceSet
303      * @return true if the object was removed from the collection.
304      */
305     public boolean removeSequenceSet(
306             final jalview.schemabinding.version2.SequenceSet vSequenceSet) {
307         boolean removed = _sequenceSetList.remove(vSequenceSet);
308         return removed;
309     }
310
311     /**
312      * Method removeSequenceSetAt.
313      * 
314      * @param index
315      * @return the element removed from the collection
316      */
317     public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt(
318             final int index) {
319         java.lang.Object obj = this._sequenceSetList.remove(index);
320         return (jalview.schemabinding.version2.SequenceSet) obj;
321     }
322
323     /**
324      * Method removeTree.
325      * 
326      * @param vTree
327      * @return true if the object was removed from the collection.
328      */
329     public boolean removeTree(
330             final java.lang.String vTree) {
331         boolean removed = _treeList.remove(vTree);
332         return removed;
333     }
334
335     /**
336      * Method removeTreeAt.
337      * 
338      * @param index
339      * @return the element removed from the collection
340      */
341     public java.lang.String removeTreeAt(
342             final int index) {
343         java.lang.Object obj = this._treeList.remove(index);
344         return (java.lang.String) obj;
345     }
346
347     /**
348      * 
349      * 
350      * @param index
351      * @param vSequenceSet
352      * @throws java.lang.IndexOutOfBoundsException if the index
353      * given is outside the bounds of the collection
354      */
355     public void setSequenceSet(
356             final int index,
357             final jalview.schemabinding.version2.SequenceSet vSequenceSet)
358     throws java.lang.IndexOutOfBoundsException {
359         // check bounds for index
360         if (index < 0 || index >= this._sequenceSetList.size()) {
361             throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
362         }
363         
364         this._sequenceSetList.set(index, vSequenceSet);
365     }
366
367     /**
368      * 
369      * 
370      * @param vSequenceSetArray
371      */
372     public void setSequenceSet(
373             final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray) {
374         //-- copy array
375         _sequenceSetList.clear();
376         
377         for (int i = 0; i < vSequenceSetArray.length; i++) {
378                 this._sequenceSetList.add(vSequenceSetArray[i]);
379         }
380     }
381
382     /**
383      * 
384      * 
385      * @param index
386      * @param vTree
387      * @throws java.lang.IndexOutOfBoundsException if the index
388      * given is outside the bounds of the collection
389      */
390     public void setTree(
391             final int index,
392             final java.lang.String vTree)
393     throws java.lang.IndexOutOfBoundsException {
394         // check bounds for index
395         if (index < 0 || index >= this._treeList.size()) {
396             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
397         }
398         
399         this._treeList.set(index, vTree);
400     }
401
402     /**
403      * 
404      * 
405      * @param vTreeArray
406      */
407     public void setTree(
408             final java.lang.String[] vTreeArray) {
409         //-- copy array
410         _treeList.clear();
411         
412         for (int i = 0; i < vTreeArray.length; i++) {
413                 this._treeList.add(vTreeArray[i]);
414         }
415     }
416
417     /**
418      * Method unmarshal.
419      * 
420      * @param reader
421      * @throws org.exolab.castor.xml.MarshalException if object is
422      * null or if any SAXException is thrown during marshaling
423      * @throws org.exolab.castor.xml.ValidationException if this
424      * object is an invalid instance according to the schema
425      * @return the unmarshaled jalview.schemabinding.version2.VAMSAS
426      */
427     public static jalview.schemabinding.version2.VAMSAS unmarshal(
428             final java.io.Reader reader)
429     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
430         return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VAMSAS.class, reader);
431     }
432
433     /**
434      * 
435      * 
436      * @throws org.exolab.castor.xml.ValidationException if this
437      * object is an invalid instance according to the schema
438      */
439     public void validate(
440     )
441     throws org.exolab.castor.xml.ValidationException {
442         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
443         validator.validate(this);
444     }
445
446 }