2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
27 * Class FeatureSettings.
\r
29 * @version $Revision$ $Date$
\r
31 public class FeatureSettings implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
39 * Field _settingList
\r
41 private java.util.Vector _settingList;
\r
46 private java.util.Vector _groupList;
\r
53 public FeatureSettings() {
\r
55 _settingList = new Vector();
\r
56 _groupList = new Vector();
\r
57 } //-- jalview.schemabinding.version2.FeatureSettings()
\r
71 public void addGroup(jalview.schemabinding.version2.Group vGroup)
\r
72 throws java.lang.IndexOutOfBoundsException
\r
74 _groupList.addElement(vGroup);
\r
75 } //-- void addGroup(jalview.schemabinding.version2.Group)
\r
85 public void addGroup(int index, jalview.schemabinding.version2.Group vGroup)
\r
86 throws java.lang.IndexOutOfBoundsException
\r
88 _groupList.insertElementAt(vGroup, index);
\r
89 } //-- void addGroup(int, jalview.schemabinding.version2.Group)
\r
98 public void addSetting(jalview.schemabinding.version2.Setting vSetting)
\r
99 throws java.lang.IndexOutOfBoundsException
\r
101 _settingList.addElement(vSetting);
\r
102 } //-- void addSetting(jalview.schemabinding.version2.Setting)
\r
105 * Method addSetting
\r
112 public void addSetting(int index, jalview.schemabinding.version2.Setting vSetting)
\r
113 throws java.lang.IndexOutOfBoundsException
\r
115 _settingList.insertElementAt(vSetting, index);
\r
116 } //-- void addSetting(int, jalview.schemabinding.version2.Setting)
\r
119 * Method enumerateGroup
\r
123 * @return Enumeration
\r
125 public java.util.Enumeration enumerateGroup()
\r
127 return _groupList.elements();
\r
128 } //-- java.util.Enumeration enumerateGroup()
\r
131 * Method enumerateSetting
\r
135 * @return Enumeration
\r
137 public java.util.Enumeration enumerateSetting()
\r
139 return _settingList.elements();
\r
140 } //-- java.util.Enumeration enumerateSetting()
\r
150 public jalview.schemabinding.version2.Group getGroup(int index)
\r
151 throws java.lang.IndexOutOfBoundsException
\r
153 //-- check bounds for index
\r
154 if ((index < 0) || (index > _groupList.size())) {
\r
155 throw new IndexOutOfBoundsException();
\r
158 return (jalview.schemabinding.version2.Group) _groupList.elementAt(index);
\r
159 } //-- jalview.schemabinding.version2.Group getGroup(int)
\r
168 public jalview.schemabinding.version2.Group[] getGroup()
\r
170 int size = _groupList.size();
\r
171 jalview.schemabinding.version2.Group[] mArray = new jalview.schemabinding.version2.Group[size];
\r
172 for (int index = 0; index < size; index++) {
\r
173 mArray[index] = (jalview.schemabinding.version2.Group) _groupList.elementAt(index);
\r
176 } //-- jalview.schemabinding.version2.Group[] getGroup()
\r
179 * Method getGroupCount
\r
185 public int getGroupCount()
\r
187 return _groupList.size();
\r
188 } //-- int getGroupCount()
\r
191 * Method getSetting
\r
198 public jalview.schemabinding.version2.Setting getSetting(int index)
\r
199 throws java.lang.IndexOutOfBoundsException
\r
201 //-- check bounds for index
\r
202 if ((index < 0) || (index > _settingList.size())) {
\r
203 throw new IndexOutOfBoundsException();
\r
206 return (jalview.schemabinding.version2.Setting) _settingList.elementAt(index);
\r
207 } //-- jalview.schemabinding.version2.Setting getSetting(int)
\r
210 * Method getSetting
\r
216 public jalview.schemabinding.version2.Setting[] getSetting()
\r
218 int size = _settingList.size();
\r
219 jalview.schemabinding.version2.Setting[] mArray = new jalview.schemabinding.version2.Setting[size];
\r
220 for (int index = 0; index < size; index++) {
\r
221 mArray[index] = (jalview.schemabinding.version2.Setting) _settingList.elementAt(index);
\r
224 } //-- jalview.schemabinding.version2.Setting[] getSetting()
\r
227 * Method getSettingCount
\r
233 public int getSettingCount()
\r
235 return _settingList.size();
\r
236 } //-- int getSettingCount()
\r
245 public boolean isValid()
\r
250 catch (org.exolab.castor.xml.ValidationException vex) {
\r
254 } //-- boolean isValid()
\r
263 public void marshal(java.io.Writer out)
\r
264 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
267 Marshaller.marshal(this, out);
\r
268 } //-- void marshal(java.io.Writer)
\r
277 public void marshal(org.xml.sax.ContentHandler handler)
\r
278 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
281 Marshaller.marshal(this, handler);
\r
282 } //-- void marshal(org.xml.sax.ContentHandler)
\r
285 * Method removeAllGroup
\r
288 public void removeAllGroup()
\r
290 _groupList.removeAllElements();
\r
291 } //-- void removeAllGroup()
\r
294 * Method removeAllSetting
\r
297 public void removeAllSetting()
\r
299 _settingList.removeAllElements();
\r
300 } //-- void removeAllSetting()
\r
303 * Method removeGroup
\r
310 public jalview.schemabinding.version2.Group removeGroup(int index)
\r
312 java.lang.Object obj = _groupList.elementAt(index);
\r
313 _groupList.removeElementAt(index);
\r
314 return (jalview.schemabinding.version2.Group) obj;
\r
315 } //-- jalview.schemabinding.version2.Group removeGroup(int)
\r
318 * Method removeSetting
\r
325 public jalview.schemabinding.version2.Setting removeSetting(int index)
\r
327 java.lang.Object obj = _settingList.elementAt(index);
\r
328 _settingList.removeElementAt(index);
\r
329 return (jalview.schemabinding.version2.Setting) obj;
\r
330 } //-- jalview.schemabinding.version2.Setting removeSetting(int)
\r
340 public void setGroup(int index, jalview.schemabinding.version2.Group vGroup)
\r
341 throws java.lang.IndexOutOfBoundsException
\r
343 //-- check bounds for index
\r
344 if ((index < 0) || (index > _groupList.size())) {
\r
345 throw new IndexOutOfBoundsException();
\r
347 _groupList.setElementAt(vGroup, index);
\r
348 } //-- void setGroup(int, jalview.schemabinding.version2.Group)
\r
355 * @param groupArray
\r
357 public void setGroup(jalview.schemabinding.version2.Group[] groupArray)
\r
360 _groupList.removeAllElements();
\r
361 for (int i = 0; i < groupArray.length; i++) {
\r
362 _groupList.addElement(groupArray[i]);
\r
364 } //-- void setGroup(jalview.schemabinding.version2.Group)
\r
367 * Method setSetting
\r
374 public void setSetting(int index, jalview.schemabinding.version2.Setting vSetting)
\r
375 throws java.lang.IndexOutOfBoundsException
\r
377 //-- check bounds for index
\r
378 if ((index < 0) || (index > _settingList.size())) {
\r
379 throw new IndexOutOfBoundsException();
\r
381 _settingList.setElementAt(vSetting, index);
\r
382 } //-- void setSetting(int, jalview.schemabinding.version2.Setting)
\r
385 * Method setSetting
\r
389 * @param settingArray
\r
391 public void setSetting(jalview.schemabinding.version2.Setting[] settingArray)
\r
394 _settingList.removeAllElements();
\r
395 for (int i = 0; i < settingArray.length; i++) {
\r
396 _settingList.addElement(settingArray[i]);
\r
398 } //-- void setSetting(jalview.schemabinding.version2.Setting)
\r
408 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
409 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
411 return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller.unmarshal(jalview.schemabinding.version2.FeatureSettings.class, reader);
\r
412 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
418 public void validate()
\r
419 throws org.exolab.castor.xml.ValidationException
\r
421 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
422 validator.validate(this);
\r
423 } //-- void validate()
\r