jalview XML schema update for 2.4.1 (or 2.5?) introducing IDs for views and treepanel...
[jalview.git] / src / jalview / schemabinding / version2 / FeatureSettings.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 FeatureSettings.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class FeatureSettings implements java.io.Serializable {\r
23 \r
24 \r
25       //--------------------------/\r
26      //- Class/Member Variables -/\r
27     //--------------------------/\r
28 \r
29     /**\r
30      * Field _settingList.\r
31      */\r
32     private java.util.Vector _settingList;\r
33 \r
34     /**\r
35      * Field _groupList.\r
36      */\r
37     private java.util.Vector _groupList;\r
38 \r
39 \r
40       //----------------/\r
41      //- Constructors -/\r
42     //----------------/\r
43 \r
44     public FeatureSettings() {\r
45         super();\r
46         this._settingList = new java.util.Vector();\r
47         this._groupList = 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 vGroup\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 addGroup(\r
63             final jalview.schemabinding.version2.Group vGroup)\r
64     throws java.lang.IndexOutOfBoundsException {\r
65         this._groupList.addElement(vGroup);\r
66     }\r
67 \r
68     /**\r
69      * \r
70      * \r
71      * @param index\r
72      * @param vGroup\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 addGroup(\r
77             final int index,\r
78             final jalview.schemabinding.version2.Group vGroup)\r
79     throws java.lang.IndexOutOfBoundsException {\r
80         this._groupList.add(index, vGroup);\r
81     }\r
82 \r
83     /**\r
84      * \r
85      * \r
86      * @param vSetting\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 addSetting(\r
91             final jalview.schemabinding.version2.Setting vSetting)\r
92     throws java.lang.IndexOutOfBoundsException {\r
93         this._settingList.addElement(vSetting);\r
94     }\r
95 \r
96     /**\r
97      * \r
98      * \r
99      * @param index\r
100      * @param vSetting\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 addSetting(\r
105             final int index,\r
106             final jalview.schemabinding.version2.Setting vSetting)\r
107     throws java.lang.IndexOutOfBoundsException {\r
108         this._settingList.add(index, vSetting);\r
109     }\r
110 \r
111     /**\r
112      * Method enumerateGroup.\r
113      * \r
114      * @return an Enumeration over all\r
115      * jalview.schemabinding.version2.Group elements\r
116      */\r
117     public java.util.Enumeration enumerateGroup(\r
118     ) {\r
119         return this._groupList.elements();\r
120     }\r
121 \r
122     /**\r
123      * Method enumerateSetting.\r
124      * \r
125      * @return an Enumeration over all\r
126      * jalview.schemabinding.version2.Setting elements\r
127      */\r
128     public java.util.Enumeration enumerateSetting(\r
129     ) {\r
130         return this._settingList.elements();\r
131     }\r
132 \r
133     /**\r
134      * Method getGroup.\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.Group at the given index\r
141      */\r
142     public jalview.schemabinding.version2.Group getGroup(\r
143             final int index)\r
144     throws java.lang.IndexOutOfBoundsException {\r
145         // check bounds for index\r
146         if (index < 0 || index >= this._groupList.size()) {\r
147             throw new IndexOutOfBoundsException("getGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]");\r
148         }\r
149         \r
150         return (jalview.schemabinding.version2.Group) _groupList.get(index);\r
151     }\r
152 \r
153     /**\r
154      * Method getGroup.Returns the contents of the collection in an\r
155      * Array.  <p>Note:  Just in case the collection contents are\r
156      * changing in another thread, we pass a 0-length Array of the\r
157      * 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.Group[] getGroup(\r
163     ) {\r
164         jalview.schemabinding.version2.Group[] array = new jalview.schemabinding.version2.Group[0];\r
165         return (jalview.schemabinding.version2.Group[]) this._groupList.toArray(array);\r
166     }\r
167 \r
168     /**\r
169      * Method getGroupCount.\r
170      * \r
171      * @return the size of this collection\r
172      */\r
173     public int getGroupCount(\r
174     ) {\r
175         return this._groupList.size();\r
176     }\r
177 \r
178     /**\r
179      * Method getSetting.\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.Setting at the given index\r
186      */\r
187     public jalview.schemabinding.version2.Setting getSetting(\r
188             final int index)\r
189     throws java.lang.IndexOutOfBoundsException {\r
190         // check bounds for index\r
191         if (index < 0 || index >= this._settingList.size()) {\r
192             throw new IndexOutOfBoundsException("getSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");\r
193         }\r
194         \r
195         return (jalview.schemabinding.version2.Setting) _settingList.get(index);\r
196     }\r
197 \r
198     /**\r
199      * Method getSetting.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.Setting[] getSetting(\r
208     ) {\r
209         jalview.schemabinding.version2.Setting[] array = new jalview.schemabinding.version2.Setting[0];\r
210         return (jalview.schemabinding.version2.Setting[]) this._settingList.toArray(array);\r
211     }\r
212 \r
213     /**\r
214      * Method getSettingCount.\r
215      * \r
216      * @return the size of this collection\r
217      */\r
218     public int getSettingCount(\r
219     ) {\r
220         return this._settingList.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      */\r
272     public void removeAllGroup(\r
273     ) {\r
274         this._groupList.clear();\r
275     }\r
276 \r
277     /**\r
278      */\r
279     public void removeAllSetting(\r
280     ) {\r
281         this._settingList.clear();\r
282     }\r
283 \r
284     /**\r
285      * Method removeGroup.\r
286      * \r
287      * @param vGroup\r
288      * @return true if the object was removed from the collection.\r
289      */\r
290     public boolean removeGroup(\r
291             final jalview.schemabinding.version2.Group vGroup) {\r
292         boolean removed = _groupList.remove(vGroup);\r
293         return removed;\r
294     }\r
295 \r
296     /**\r
297      * Method removeGroupAt.\r
298      * \r
299      * @param index\r
300      * @return the element removed from the collection\r
301      */\r
302     public jalview.schemabinding.version2.Group removeGroupAt(\r
303             final int index) {\r
304         java.lang.Object obj = this._groupList.remove(index);\r
305         return (jalview.schemabinding.version2.Group) obj;\r
306     }\r
307 \r
308     /**\r
309      * Method removeSetting.\r
310      * \r
311      * @param vSetting\r
312      * @return true if the object was removed from the collection.\r
313      */\r
314     public boolean removeSetting(\r
315             final jalview.schemabinding.version2.Setting vSetting) {\r
316         boolean removed = _settingList.remove(vSetting);\r
317         return removed;\r
318     }\r
319 \r
320     /**\r
321      * Method removeSettingAt.\r
322      * \r
323      * @param index\r
324      * @return the element removed from the collection\r
325      */\r
326     public jalview.schemabinding.version2.Setting removeSettingAt(\r
327             final int index) {\r
328         java.lang.Object obj = this._settingList.remove(index);\r
329         return (jalview.schemabinding.version2.Setting) obj;\r
330     }\r
331 \r
332     /**\r
333      * \r
334      * \r
335      * @param index\r
336      * @param vGroup\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 setGroup(\r
341             final int index,\r
342             final jalview.schemabinding.version2.Group vGroup)\r
343     throws java.lang.IndexOutOfBoundsException {\r
344         // check bounds for index\r
345         if (index < 0 || index >= this._groupList.size()) {\r
346             throw new IndexOutOfBoundsException("setGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]");\r
347         }\r
348         \r
349         this._groupList.set(index, vGroup);\r
350     }\r
351 \r
352     /**\r
353      * \r
354      * \r
355      * @param vGroupArray\r
356      */\r
357     public void setGroup(\r
358             final jalview.schemabinding.version2.Group[] vGroupArray) {\r
359         //-- copy array\r
360         _groupList.clear();\r
361         \r
362         for (int i = 0; i < vGroupArray.length; i++) {\r
363                 this._groupList.add(vGroupArray[i]);\r
364         }\r
365     }\r
366 \r
367     /**\r
368      * \r
369      * \r
370      * @param index\r
371      * @param vSetting\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 setSetting(\r
376             final int index,\r
377             final jalview.schemabinding.version2.Setting vSetting)\r
378     throws java.lang.IndexOutOfBoundsException {\r
379         // check bounds for index\r
380         if (index < 0 || index >= this._settingList.size()) {\r
381             throw new IndexOutOfBoundsException("setSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");\r
382         }\r
383         \r
384         this._settingList.set(index, vSetting);\r
385     }\r
386 \r
387     /**\r
388      * \r
389      * \r
390      * @param vSettingArray\r
391      */\r
392     public void setSetting(\r
393             final jalview.schemabinding.version2.Setting[] vSettingArray) {\r
394         //-- copy array\r
395         _settingList.clear();\r
396         \r
397         for (int i = 0; i < vSettingArray.length; i++) {\r
398                 this._settingList.add(vSettingArray[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.FeatureSettings\r
412      */\r
413     public static jalview.schemabinding.version2.FeatureSettings 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.FeatureSettings) Unmarshaller.unmarshal(jalview.schemabinding.version2.FeatureSettings.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