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;
44 public FeatureSettings() {
46 this._settingList = new java.util.Vector();
47 this._groupList = new java.util.Vector();
59 * @throws java.lang.IndexOutOfBoundsException if the index
60 * given is outside the bounds of the collection
63 final jalview.schemabinding.version2.Group vGroup)
64 throws java.lang.IndexOutOfBoundsException {
65 this._groupList.addElement(vGroup);
73 * @throws java.lang.IndexOutOfBoundsException if the index
74 * given is outside the bounds of the collection
78 final jalview.schemabinding.version2.Group vGroup)
79 throws java.lang.IndexOutOfBoundsException {
80 this._groupList.add(index, vGroup);
87 * @throws java.lang.IndexOutOfBoundsException if the index
88 * given is outside the bounds of the collection
90 public void addSetting(
91 final jalview.schemabinding.version2.Setting vSetting)
92 throws java.lang.IndexOutOfBoundsException {
93 this._settingList.addElement(vSetting);
101 * @throws java.lang.IndexOutOfBoundsException if the index
102 * given is outside the bounds of the collection
104 public void addSetting(
106 final jalview.schemabinding.version2.Setting vSetting)
107 throws java.lang.IndexOutOfBoundsException {
108 this._settingList.add(index, vSetting);
112 * Method enumerateGroup.
114 * @return an Enumeration over all
115 * jalview.schemabinding.version2.Group elements
117 public java.util.Enumeration enumerateGroup(
119 return this._groupList.elements();
123 * Method enumerateSetting.
125 * @return an Enumeration over all
126 * jalview.schemabinding.version2.Setting elements
128 public java.util.Enumeration enumerateSetting(
130 return this._settingList.elements();
137 * @throws java.lang.IndexOutOfBoundsException if the index
138 * given is outside the bounds of the collection
139 * @return the value of the
140 * jalview.schemabinding.version2.Group at the given index
142 public jalview.schemabinding.version2.Group getGroup(
144 throws java.lang.IndexOutOfBoundsException {
145 // check bounds for index
146 if (index < 0 || index >= this._groupList.size()) {
147 throw new IndexOutOfBoundsException("getGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]");
150 return (jalview.schemabinding.version2.Group) _groupList.get(index);
154 * Method getGroup.Returns the contents of the collection in an
155 * Array. <p>Note: Just in case the collection contents are
156 * changing in another thread, we pass a 0-length Array of the
157 * correct type into the API call. This way we <i>know</i>
158 * that the Array returned is of exactly the correct length.
160 * @return this collection as an Array
162 public jalview.schemabinding.version2.Group[] getGroup(
164 jalview.schemabinding.version2.Group[] array = new jalview.schemabinding.version2.Group[0];
165 return (jalview.schemabinding.version2.Group[]) this._groupList.toArray(array);
169 * Method getGroupCount.
171 * @return the size of this collection
173 public int getGroupCount(
175 return this._groupList.size();
182 * @throws java.lang.IndexOutOfBoundsException if the index
183 * given is outside the bounds of the collection
184 * @return the value of the
185 * jalview.schemabinding.version2.Setting at the given index
187 public jalview.schemabinding.version2.Setting getSetting(
189 throws java.lang.IndexOutOfBoundsException {
190 // check bounds for index
191 if (index < 0 || index >= this._settingList.size()) {
192 throw new IndexOutOfBoundsException("getSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");
195 return (jalview.schemabinding.version2.Setting) _settingList.get(index);
199 * Method getSetting.Returns the contents of the collection in
200 * an Array. <p>Note: Just in case the collection contents
201 * are changing in another thread, we pass a 0-length Array of
202 * the correct type into the API call. This way we <i>know</i>
203 * that the Array returned is of exactly the correct length.
205 * @return this collection as an Array
207 public jalview.schemabinding.version2.Setting[] getSetting(
209 jalview.schemabinding.version2.Setting[] array = new jalview.schemabinding.version2.Setting[0];
210 return (jalview.schemabinding.version2.Setting[]) this._settingList.toArray(array);
214 * Method getSettingCount.
216 * @return the size of this collection
218 public int getSettingCount(
220 return this._settingList.size();
226 * @return true if this object is valid according to the schema
228 public boolean isValid(
232 } catch (org.exolab.castor.xml.ValidationException vex) {
242 * @throws org.exolab.castor.xml.MarshalException if object is
243 * null or if any SAXException is thrown during marshaling
244 * @throws org.exolab.castor.xml.ValidationException if this
245 * object is an invalid instance according to the schema
248 final java.io.Writer out)
249 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
250 Marshaller.marshal(this, out);
257 * @throws java.io.IOException if an IOException occurs during
259 * @throws org.exolab.castor.xml.ValidationException if this
260 * object is an invalid instance according to the schema
261 * @throws org.exolab.castor.xml.MarshalException if object is
262 * null or if any SAXException is thrown during marshaling
265 final org.xml.sax.ContentHandler handler)
266 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
267 Marshaller.marshal(this, handler);
272 public void removeAllGroup(
274 this._groupList.clear();
279 public void removeAllSetting(
281 this._settingList.clear();
285 * Method removeGroup.
288 * @return true if the object was removed from the collection.
290 public boolean removeGroup(
291 final jalview.schemabinding.version2.Group vGroup) {
292 boolean removed = _groupList.remove(vGroup);
297 * Method removeGroupAt.
300 * @return the element removed from the collection
302 public jalview.schemabinding.version2.Group removeGroupAt(
304 java.lang.Object obj = this._groupList.remove(index);
305 return (jalview.schemabinding.version2.Group) obj;
309 * Method removeSetting.
312 * @return true if the object was removed from the collection.
314 public boolean removeSetting(
315 final jalview.schemabinding.version2.Setting vSetting) {
316 boolean removed = _settingList.remove(vSetting);
321 * Method removeSettingAt.
324 * @return the element removed from the collection
326 public jalview.schemabinding.version2.Setting removeSettingAt(
328 java.lang.Object obj = this._settingList.remove(index);
329 return (jalview.schemabinding.version2.Setting) obj;
337 * @throws java.lang.IndexOutOfBoundsException if the index
338 * given is outside the bounds of the collection
340 public void setGroup(
342 final jalview.schemabinding.version2.Group vGroup)
343 throws java.lang.IndexOutOfBoundsException {
344 // check bounds for index
345 if (index < 0 || index >= this._groupList.size()) {
346 throw new IndexOutOfBoundsException("setGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]");
349 this._groupList.set(index, vGroup);
357 public void setGroup(
358 final jalview.schemabinding.version2.Group[] vGroupArray) {
362 for (int i = 0; i < vGroupArray.length; i++) {
363 this._groupList.add(vGroupArray[i]);
372 * @throws java.lang.IndexOutOfBoundsException if the index
373 * given is outside the bounds of the collection
375 public void setSetting(
377 final jalview.schemabinding.version2.Setting vSetting)
378 throws java.lang.IndexOutOfBoundsException {
379 // check bounds for index
380 if (index < 0 || index >= this._settingList.size()) {
381 throw new IndexOutOfBoundsException("setSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");
384 this._settingList.set(index, vSetting);
390 * @param vSettingArray
392 public void setSetting(
393 final jalview.schemabinding.version2.Setting[] vSettingArray) {
395 _settingList.clear();
397 for (int i = 0; i < vSettingArray.length; i++) {
398 this._settingList.add(vSettingArray[i]);
406 * @throws org.exolab.castor.xml.MarshalException if object is
407 * null or if any SAXException is thrown during marshaling
408 * @throws org.exolab.castor.xml.ValidationException if this
409 * object is an invalid instance according to the schema
410 * @return the unmarshaled
411 * jalview.schemabinding.version2.FeatureSettings
413 public static jalview.schemabinding.version2.FeatureSettings unmarshal(
414 final java.io.Reader reader)
415 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
416 return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller.unmarshal(jalview.schemabinding.version2.FeatureSettings.class, reader);
422 * @throws org.exolab.castor.xml.ValidationException if this
423 * object is an invalid instance according to the schema
425 public void validate(
427 throws org.exolab.castor.xml.ValidationException {
428 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
429 validator.validate(this);