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