2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * Class FeatureSettings.
\r
20 * @version $Revision$ $Date$
\r
22 public class FeatureSettings implements java.io.Serializable {
\r
25 //--------------------------/
\r
26 //- Class/Member Variables -/
\r
27 //--------------------------/
\r
30 * Field _settingList.
\r
32 private java.util.Vector _settingList;
\r
37 private java.util.Vector _groupList;
\r
44 public FeatureSettings() {
\r
46 this._settingList = new java.util.Vector();
\r
47 this._groupList = new java.util.Vector();
\r
59 * @throws java.lang.IndexOutOfBoundsException if the index
\r
60 * given is outside the bounds of the collection
\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
73 * @throws java.lang.IndexOutOfBoundsException if the index
\r
74 * given is outside the bounds of the collection
\r
76 public void addGroup(
\r
78 final jalview.schemabinding.version2.Group vGroup)
\r
79 throws java.lang.IndexOutOfBoundsException {
\r
80 this._groupList.add(index, vGroup);
\r
87 * @throws java.lang.IndexOutOfBoundsException if the index
\r
88 * given is outside the bounds of the collection
\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
101 * @throws java.lang.IndexOutOfBoundsException if the index
\r
102 * given is outside the bounds of the collection
\r
104 public void addSetting(
\r
106 final jalview.schemabinding.version2.Setting vSetting)
\r
107 throws java.lang.IndexOutOfBoundsException {
\r
108 this._settingList.add(index, vSetting);
\r
112 * Method enumerateGroup.
\r
114 * @return an Enumeration over all
\r
115 * jalview.schemabinding.version2.Group elements
\r
117 public java.util.Enumeration enumerateGroup(
\r
119 return this._groupList.elements();
\r
123 * Method enumerateSetting.
\r
125 * @return an Enumeration over all
\r
126 * jalview.schemabinding.version2.Setting elements
\r
128 public java.util.Enumeration enumerateSetting(
\r
130 return this._settingList.elements();
\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
142 public jalview.schemabinding.version2.Group getGroup(
\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
150 return (jalview.schemabinding.version2.Group) _groupList.get(index);
\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
160 * @return this collection as an Array
\r
162 public jalview.schemabinding.version2.Group[] getGroup(
\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
169 * Method getGroupCount.
\r
171 * @return the size of this collection
\r
173 public int getGroupCount(
\r
175 return this._groupList.size();
\r
179 * Method getSetting.
\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
187 public jalview.schemabinding.version2.Setting getSetting(
\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
195 return (jalview.schemabinding.version2.Setting) _settingList.get(index);
\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
205 * @return this collection as an Array
\r
207 public jalview.schemabinding.version2.Setting[] getSetting(
\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
214 * Method getSettingCount.
\r
216 * @return the size of this collection
\r
218 public int getSettingCount(
\r
220 return this._settingList.size();
\r
226 * @return true if this object is valid according to the schema
\r
228 public boolean isValid(
\r
232 } catch (org.exolab.castor.xml.ValidationException vex) {
\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
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
257 * @throws java.io.IOException if an IOException occurs during
\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
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
272 public void removeAllGroup(
\r
274 this._groupList.clear();
\r
279 public void removeAllSetting(
\r
281 this._settingList.clear();
\r
285 * Method removeGroup.
\r
288 * @return true if the object was removed from the collection.
\r
290 public boolean removeGroup(
\r
291 final jalview.schemabinding.version2.Group vGroup) {
\r
292 boolean removed = _groupList.remove(vGroup);
\r
297 * Method removeGroupAt.
\r
300 * @return the element removed from the collection
\r
302 public jalview.schemabinding.version2.Group removeGroupAt(
\r
304 java.lang.Object obj = this._groupList.remove(index);
\r
305 return (jalview.schemabinding.version2.Group) obj;
\r
309 * Method removeSetting.
\r
312 * @return true if the object was removed from the collection.
\r
314 public boolean removeSetting(
\r
315 final jalview.schemabinding.version2.Setting vSetting) {
\r
316 boolean removed = _settingList.remove(vSetting);
\r
321 * Method removeSettingAt.
\r
324 * @return the element removed from the collection
\r
326 public jalview.schemabinding.version2.Setting removeSettingAt(
\r
328 java.lang.Object obj = this._settingList.remove(index);
\r
329 return (jalview.schemabinding.version2.Setting) obj;
\r
337 * @throws java.lang.IndexOutOfBoundsException if the index
\r
338 * given is outside the bounds of the collection
\r
340 public void setGroup(
\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
349 this._groupList.set(index, vGroup);
\r
355 * @param vGroupArray
\r
357 public void setGroup(
\r
358 final jalview.schemabinding.version2.Group[] vGroupArray) {
\r
360 _groupList.clear();
\r
362 for (int i = 0; i < vGroupArray.length; i++) {
\r
363 this._groupList.add(vGroupArray[i]);
\r
372 * @throws java.lang.IndexOutOfBoundsException if the index
\r
373 * given is outside the bounds of the collection
\r
375 public void setSetting(
\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
384 this._settingList.set(index, vSetting);
\r
390 * @param vSettingArray
\r
392 public void setSetting(
\r
393 final jalview.schemabinding.version2.Setting[] vSettingArray) {
\r
395 _settingList.clear();
\r
397 for (int i = 0; i < vSettingArray.length; i++) {
\r
398 this._settingList.add(vSettingArray[i]);
\r
403 * Method unmarshal.
\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
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
422 * @throws org.exolab.castor.xml.ValidationException if this
\r
423 * object is an invalid instance according to the schema
\r
425 public void validate(
\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