2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
18 * Class FeatureSettings.
20 * @version $Revision$ $Date$
22 public class FeatureSettings implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private java.util.Vector _settingList;
37 private java.util.Vector _groupList;
43 public FeatureSettings()
46 this._settingList = new java.util.Vector();
47 this._groupList = new java.util.Vector();
58 * @throws java.lang.IndexOutOfBoundsException
59 * if the index given is outside the bounds of the collection
61 public void addGroup(final jalview.schemabinding.version2.Group vGroup)
62 throws java.lang.IndexOutOfBoundsException
64 this._groupList.addElement(vGroup);
72 * @throws java.lang.IndexOutOfBoundsException
73 * if the index given is outside the bounds of the collection
75 public void addGroup(final int index,
76 final jalview.schemabinding.version2.Group vGroup)
77 throws java.lang.IndexOutOfBoundsException
79 this._groupList.add(index, vGroup);
86 * @throws java.lang.IndexOutOfBoundsException
87 * if the index given is outside the bounds of the collection
89 public void addSetting(
90 final jalview.schemabinding.version2.Setting vSetting)
91 throws java.lang.IndexOutOfBoundsException
93 this._settingList.addElement(vSetting);
101 * @throws java.lang.IndexOutOfBoundsException
102 * if the index given is outside the bounds of the collection
104 public void addSetting(final int index,
105 final jalview.schemabinding.version2.Setting vSetting)
106 throws java.lang.IndexOutOfBoundsException
108 this._settingList.add(index, vSetting);
112 * Method enumerateGroup.
114 * @return an Enumeration over all jalview.schemabinding.version2.Group
117 public java.util.Enumeration enumerateGroup()
119 return this._groupList.elements();
123 * Method enumerateSetting.
125 * @return an Enumeration over all jalview.schemabinding.version2.Setting
128 public java.util.Enumeration enumerateSetting()
130 return this._settingList.elements();
137 * @throws java.lang.IndexOutOfBoundsException
138 * if the index given is outside the bounds of the collection
139 * @return the value of the jalview.schemabinding.version2.Group at the given
142 public jalview.schemabinding.version2.Group getGroup(final int index)
143 throws java.lang.IndexOutOfBoundsException
145 // check bounds for index
146 if (index < 0 || index >= this._groupList.size())
148 throw new IndexOutOfBoundsException("getGroup: Index value '" + index
149 + "' not in range [0.." + (this._groupList.size() - 1) + "]");
152 return (jalview.schemabinding.version2.Group) _groupList.get(index);
156 * Method getGroup.Returns the contents of the collection in an Array.
158 * Note: Just in case the collection contents are changing in another thread,
159 * we pass a 0-length Array of the correct type into the API call. This way we
160 * <i>know</i> that the Array returned is of exactly the correct length.
162 * @return this collection as an Array
164 public jalview.schemabinding.version2.Group[] getGroup()
166 jalview.schemabinding.version2.Group[] array = new jalview.schemabinding.version2.Group[0];
167 return (jalview.schemabinding.version2.Group[]) this._groupList
172 * Method getGroupCount.
174 * @return the size of this collection
176 public int getGroupCount()
178 return this._groupList.size();
185 * @throws java.lang.IndexOutOfBoundsException
186 * if the index given is outside the bounds of the collection
187 * @return the value of the jalview.schemabinding.version2.Setting at the
190 public jalview.schemabinding.version2.Setting getSetting(final int index)
191 throws java.lang.IndexOutOfBoundsException
193 // check bounds for index
194 if (index < 0 || index >= this._settingList.size())
196 throw new IndexOutOfBoundsException("getSetting: Index value '"
197 + index + "' not in range [0.."
198 + (this._settingList.size() - 1) + "]");
201 return (jalview.schemabinding.version2.Setting) _settingList.get(index);
205 * Method getSetting.Returns the contents of the collection in an Array.
207 * Note: Just in case the collection contents are changing in another thread,
208 * we pass a 0-length Array of the correct type into the API call. This way we
209 * <i>know</i> that the Array returned is of exactly the correct length.
211 * @return this collection as an Array
213 public jalview.schemabinding.version2.Setting[] getSetting()
215 jalview.schemabinding.version2.Setting[] array = new jalview.schemabinding.version2.Setting[0];
216 return (jalview.schemabinding.version2.Setting[]) this._settingList
221 * Method getSettingCount.
223 * @return the size of this collection
225 public int getSettingCount()
227 return this._settingList.size();
233 * @return true if this object is valid according to the schema
235 public boolean isValid()
240 } catch (org.exolab.castor.xml.ValidationException vex)
251 * @throws org.exolab.castor.xml.MarshalException
252 * if object is null or if any SAXException is thrown during
254 * @throws org.exolab.castor.xml.ValidationException
255 * if this object is an invalid instance according to the schema
257 public void marshal(final java.io.Writer out)
258 throws org.exolab.castor.xml.MarshalException,
259 org.exolab.castor.xml.ValidationException
261 Marshaller.marshal(this, out);
268 * @throws java.io.IOException
269 * if an IOException occurs during marshaling
270 * @throws org.exolab.castor.xml.ValidationException
271 * if this object is an invalid instance according to the schema
272 * @throws org.exolab.castor.xml.MarshalException
273 * if object is null or if any SAXException is thrown during
276 public void marshal(final org.xml.sax.ContentHandler handler)
277 throws java.io.IOException,
278 org.exolab.castor.xml.MarshalException,
279 org.exolab.castor.xml.ValidationException
281 Marshaller.marshal(this, handler);
286 public void removeAllGroup()
288 this._groupList.clear();
293 public void removeAllSetting()
295 this._settingList.clear();
299 * Method removeGroup.
302 * @return true if the object was removed from the collection.
304 public boolean removeGroup(
305 final jalview.schemabinding.version2.Group vGroup)
307 boolean removed = _groupList.remove(vGroup);
312 * Method removeGroupAt.
315 * @return the element removed from the collection
317 public jalview.schemabinding.version2.Group removeGroupAt(final int index)
319 java.lang.Object obj = this._groupList.remove(index);
320 return (jalview.schemabinding.version2.Group) obj;
324 * Method removeSetting.
327 * @return true if the object was removed from the collection.
329 public boolean removeSetting(
330 final jalview.schemabinding.version2.Setting vSetting)
332 boolean removed = _settingList.remove(vSetting);
337 * Method removeSettingAt.
340 * @return the element removed from the collection
342 public jalview.schemabinding.version2.Setting removeSettingAt(
345 java.lang.Object obj = this._settingList.remove(index);
346 return (jalview.schemabinding.version2.Setting) obj;
354 * @throws java.lang.IndexOutOfBoundsException
355 * if the index given is outside the bounds of the collection
357 public void setGroup(final int index,
358 final jalview.schemabinding.version2.Group vGroup)
359 throws java.lang.IndexOutOfBoundsException
361 // check bounds for index
362 if (index < 0 || index >= this._groupList.size())
364 throw new IndexOutOfBoundsException("setGroup: Index value '" + index
365 + "' not in range [0.." + (this._groupList.size() - 1) + "]");
368 this._groupList.set(index, vGroup);
376 public void setGroup(
377 final jalview.schemabinding.version2.Group[] vGroupArray)
382 for (int i = 0; i < vGroupArray.length; i++)
384 this._groupList.add(vGroupArray[i]);
393 * @throws java.lang.IndexOutOfBoundsException
394 * if the index given is outside the bounds of the collection
396 public void setSetting(final int index,
397 final jalview.schemabinding.version2.Setting vSetting)
398 throws java.lang.IndexOutOfBoundsException
400 // check bounds for index
401 if (index < 0 || index >= this._settingList.size())
403 throw new IndexOutOfBoundsException("setSetting: Index value '"
404 + index + "' not in range [0.."
405 + (this._settingList.size() - 1) + "]");
408 this._settingList.set(index, vSetting);
414 * @param vSettingArray
416 public void setSetting(
417 final jalview.schemabinding.version2.Setting[] vSettingArray)
420 _settingList.clear();
422 for (int i = 0; i < vSettingArray.length; i++)
424 this._settingList.add(vSettingArray[i]);
432 * @throws org.exolab.castor.xml.MarshalException
433 * if object is null or if any SAXException is thrown during
435 * @throws org.exolab.castor.xml.ValidationException
436 * if this object is an invalid instance according to the schema
437 * @return the unmarshaled jalview.schemabinding.version2.FeatureSettings
439 public static jalview.schemabinding.version2.FeatureSettings unmarshal(
440 final java.io.Reader reader)
441 throws org.exolab.castor.xml.MarshalException,
442 org.exolab.castor.xml.ValidationException
444 return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller
446 jalview.schemabinding.version2.FeatureSettings.class,
453 * @throws org.exolab.castor.xml.ValidationException
454 * if this object is an invalid instance according to the schema
456 public void validate() throws org.exolab.castor.xml.ValidationException
458 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
459 validator.validate(this);