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