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