2dad54a19ca5f521f8aefbe39a89e4d3ad2dd176
[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 0.9.6</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 java.util.*;\r
15 \r
16 import org.exolab.castor.xml.*;\r
17 \r
18 /**\r
19  * Class FeatureSettings.\r
20  *\r
21  * @version $Revision$ $Date$\r
22  */\r
23 public class FeatureSettings\r
24     implements java.io.Serializable\r
25 {\r
26 \r
27   //--------------------------/\r
28   //- Class/Member Variables -/\r
29   //--------------------------/\r
30 \r
31   /**\r
32    * Field _settingList\r
33    */\r
34   private java.util.Vector _settingList;\r
35 \r
36   //----------------/\r
37   //- Constructors -/\r
38   //----------------/\r
39 \r
40   public FeatureSettings()\r
41   {\r
42     super();\r
43     _settingList = new Vector();\r
44   } //-- jalview.schemabinding.version2.FeatureSettings()\r
45 \r
46   //-----------/\r
47   //- Methods -/\r
48   //-----------/\r
49 \r
50   /**\r
51    * Method addSetting\r
52    *\r
53    *\r
54    *\r
55    * @param vSetting\r
56    */\r
57   public void addSetting(jalview.schemabinding.version2.Setting vSetting)\r
58       throws java.lang.IndexOutOfBoundsException\r
59   {\r
60     _settingList.addElement(vSetting);\r
61   } //-- void addSetting(jalview.schemabinding.version2.Setting)\r
62 \r
63   /**\r
64    * Method addSetting\r
65    *\r
66    *\r
67    *\r
68    * @param index\r
69    * @param vSetting\r
70    */\r
71   public void addSetting(int index,\r
72                          jalview.schemabinding.version2.Setting vSetting)\r
73       throws java.lang.IndexOutOfBoundsException\r
74   {\r
75     _settingList.insertElementAt(vSetting, index);\r
76   } //-- void addSetting(int, jalview.schemabinding.version2.Setting)\r
77 \r
78   /**\r
79    * Method enumerateSetting\r
80    *\r
81    *\r
82    *\r
83    * @return Enumeration\r
84    */\r
85   public java.util.Enumeration enumerateSetting()\r
86   {\r
87     return _settingList.elements();\r
88   } //-- java.util.Enumeration enumerateSetting()\r
89 \r
90   /**\r
91    * Method getSetting\r
92    *\r
93    *\r
94    *\r
95    * @param index\r
96    * @return Setting\r
97    */\r
98   public jalview.schemabinding.version2.Setting getSetting(int index)\r
99       throws java.lang.IndexOutOfBoundsException\r
100   {\r
101     //-- check bounds for index\r
102     if ( (index < 0) || (index > _settingList.size()))\r
103     {\r
104       throw new IndexOutOfBoundsException();\r
105     }\r
106 \r
107     return (jalview.schemabinding.version2.Setting) _settingList.elementAt(\r
108         index);\r
109   } //-- jalview.schemabinding.version2.Setting getSetting(int)\r
110 \r
111   /**\r
112    * Method getSetting\r
113    *\r
114    *\r
115    *\r
116    * @return Setting\r
117    */\r
118   public jalview.schemabinding.version2.Setting[] getSetting()\r
119   {\r
120     int size = _settingList.size();\r
121     jalview.schemabinding.version2.Setting[] mArray = new jalview.schemabinding.\r
122         version2.Setting[size];\r
123     for (int index = 0; index < size; index++)\r
124     {\r
125       mArray[index] = (jalview.schemabinding.version2.Setting) _settingList.\r
126           elementAt(index);\r
127     }\r
128     return mArray;\r
129   } //-- jalview.schemabinding.version2.Setting[] getSetting()\r
130 \r
131   /**\r
132    * Method getSettingCount\r
133    *\r
134    *\r
135    *\r
136    * @return int\r
137    */\r
138   public int getSettingCount()\r
139   {\r
140     return _settingList.size();\r
141   } //-- int getSettingCount()\r
142 \r
143   /**\r
144    * Method isValid\r
145    *\r
146    *\r
147    *\r
148    * @return boolean\r
149    */\r
150   public boolean isValid()\r
151   {\r
152     try\r
153     {\r
154       validate();\r
155     }\r
156     catch (org.exolab.castor.xml.ValidationException vex)\r
157     {\r
158       return false;\r
159     }\r
160     return true;\r
161   } //-- boolean isValid()\r
162 \r
163   /**\r
164    * Method marshal\r
165    *\r
166    *\r
167    *\r
168    * @param out\r
169    */\r
170   public void marshal(java.io.Writer out)\r
171       throws org.exolab.castor.xml.MarshalException,\r
172       org.exolab.castor.xml.ValidationException\r
173   {\r
174 \r
175     Marshaller.marshal(this, out);\r
176   } //-- void marshal(java.io.Writer)\r
177 \r
178   /**\r
179    * Method marshal\r
180    *\r
181    *\r
182    *\r
183    * @param handler\r
184    */\r
185   public void marshal(org.xml.sax.ContentHandler handler)\r
186       throws java.io.IOException, org.exolab.castor.xml.MarshalException,\r
187       org.exolab.castor.xml.ValidationException\r
188   {\r
189 \r
190     Marshaller.marshal(this, handler);\r
191   } //-- void marshal(org.xml.sax.ContentHandler)\r
192 \r
193   /**\r
194    * Method removeAllSetting\r
195    *\r
196    */\r
197   public void removeAllSetting()\r
198   {\r
199     _settingList.removeAllElements();\r
200   } //-- void removeAllSetting()\r
201 \r
202   /**\r
203    * Method removeSetting\r
204    *\r
205    *\r
206    *\r
207    * @param index\r
208    * @return Setting\r
209    */\r
210   public jalview.schemabinding.version2.Setting removeSetting(int index)\r
211   {\r
212     java.lang.Object obj = _settingList.elementAt(index);\r
213     _settingList.removeElementAt(index);\r
214     return (jalview.schemabinding.version2.Setting) obj;\r
215   } //-- jalview.schemabinding.version2.Setting removeSetting(int)\r
216 \r
217   /**\r
218    * Method setSetting\r
219    *\r
220    *\r
221    *\r
222    * @param index\r
223    * @param vSetting\r
224    */\r
225   public void setSetting(int index,\r
226                          jalview.schemabinding.version2.Setting vSetting)\r
227       throws java.lang.IndexOutOfBoundsException\r
228   {\r
229     //-- check bounds for index\r
230     if ( (index < 0) || (index > _settingList.size()))\r
231     {\r
232       throw new IndexOutOfBoundsException();\r
233     }\r
234     _settingList.setElementAt(vSetting, index);\r
235   } //-- void setSetting(int, jalview.schemabinding.version2.Setting)\r
236 \r
237   /**\r
238    * Method setSetting\r
239    *\r
240    *\r
241    *\r
242    * @param settingArray\r
243    */\r
244   public void setSetting(jalview.schemabinding.version2.Setting[] settingArray)\r
245   {\r
246     //-- copy array\r
247     _settingList.removeAllElements();\r
248     for (int i = 0; i < settingArray.length; i++)\r
249     {\r
250       _settingList.addElement(settingArray[i]);\r
251     }\r
252   } //-- void setSetting(jalview.schemabinding.version2.Setting)\r
253 \r
254   /**\r
255    * Method unmarshal\r
256    *\r
257    *\r
258    *\r
259    * @param reader\r
260    * @return Object\r
261    */\r
262   public static java.lang.Object unmarshal(java.io.Reader reader)\r
263       throws org.exolab.castor.xml.MarshalException,\r
264       org.exolab.castor.xml.ValidationException\r
265   {\r
266     return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller.\r
267         unmarshal(jalview.schemabinding.version2.FeatureSettings.class, reader);\r
268   } //-- java.lang.Object unmarshal(java.io.Reader)\r
269 \r
270   /**\r
271    * Method validate\r
272    *\r
273    */\r
274   public void validate()\r
275       throws org.exolab.castor.xml.ValidationException\r
276   {\r
277     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.\r
278         Validator();\r
279     validator.validate(this);\r
280   } //-- void validate()\r
281 \r
282 }\r