2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
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;
38 public FeatureSettings()
41 this._settingList = new java.util.Vector();
52 * @throws java.lang.IndexOutOfBoundsException
53 * if the index given is outside the bounds of the collection
55 public void addSetting(final jalview.binding.Setting vSetting)
56 throws java.lang.IndexOutOfBoundsException
58 this._settingList.addElement(vSetting);
66 * @throws java.lang.IndexOutOfBoundsException
67 * if the index given is outside the bounds of the collection
69 public void addSetting(final int index,
70 final jalview.binding.Setting vSetting)
71 throws java.lang.IndexOutOfBoundsException
73 this._settingList.add(index, vSetting);
77 * Method enumerateSetting.
79 * @return an Enumeration over all jalview.binding.Setting elements
81 public java.util.Enumeration enumerateSetting()
83 return this._settingList.elements();
90 * @throws java.lang.IndexOutOfBoundsException
91 * if the index given is outside the bounds of the collection
92 * @return the value of the jalview.binding.Setting at the given index
94 public jalview.binding.Setting getSetting(final int index)
95 throws java.lang.IndexOutOfBoundsException
97 // check bounds for index
98 if (index < 0 || index >= this._settingList.size())
100 throw new IndexOutOfBoundsException("getSetting: Index value '"
101 + index + "' not in range [0.."
102 + (this._settingList.size() - 1) + "]");
105 return (jalview.binding.Setting) _settingList.get(index);
109 * Method getSetting.Returns the contents of the collection in an Array.
111 * Note: Just in case the collection contents are changing in another thread,
112 * we pass a 0-length Array of the correct type into the API call. This way we
113 * <i>know</i> that the Array returned is of exactly the correct length.
115 * @return this collection as an Array
117 public jalview.binding.Setting[] getSetting()
119 jalview.binding.Setting[] array = new jalview.binding.Setting[0];
120 return (jalview.binding.Setting[]) this._settingList.toArray(array);
124 * Method getSettingCount.
126 * @return the size of this collection
128 public int getSettingCount()
130 return this._settingList.size();
136 * @return true if this object is valid according to the schema
138 public boolean isValid()
143 } catch (org.exolab.castor.xml.ValidationException vex)
154 * @throws org.exolab.castor.xml.MarshalException
155 * if object is null or if any SAXException is thrown during
157 * @throws org.exolab.castor.xml.ValidationException
158 * if this object is an invalid instance according to the schema
160 public void marshal(final java.io.Writer out)
161 throws org.exolab.castor.xml.MarshalException,
162 org.exolab.castor.xml.ValidationException
164 Marshaller.marshal(this, out);
171 * @throws java.io.IOException
172 * if an IOException occurs during marshaling
173 * @throws org.exolab.castor.xml.ValidationException
174 * if this object is an invalid instance according to the schema
175 * @throws org.exolab.castor.xml.MarshalException
176 * if object is null or if any SAXException is thrown during
179 public void marshal(final org.xml.sax.ContentHandler handler)
180 throws java.io.IOException,
181 org.exolab.castor.xml.MarshalException,
182 org.exolab.castor.xml.ValidationException
184 Marshaller.marshal(this, handler);
189 public void removeAllSetting()
191 this._settingList.clear();
195 * Method removeSetting.
198 * @return true if the object was removed from the collection.
200 public boolean removeSetting(final jalview.binding.Setting vSetting)
202 boolean removed = _settingList.remove(vSetting);
207 * Method removeSettingAt.
210 * @return the element removed from the collection
212 public jalview.binding.Setting removeSettingAt(final int index)
214 java.lang.Object obj = this._settingList.remove(index);
215 return (jalview.binding.Setting) obj;
223 * @throws java.lang.IndexOutOfBoundsException
224 * if the index given is outside the bounds of the collection
226 public void setSetting(final int index,
227 final jalview.binding.Setting vSetting)
228 throws java.lang.IndexOutOfBoundsException
230 // check bounds for index
231 if (index < 0 || index >= this._settingList.size())
233 throw new IndexOutOfBoundsException("setSetting: Index value '"
234 + index + "' not in range [0.."
235 + (this._settingList.size() - 1) + "]");
238 this._settingList.set(index, vSetting);
244 * @param vSettingArray
246 public void setSetting(final jalview.binding.Setting[] vSettingArray)
249 _settingList.clear();
251 for (int i = 0; i < vSettingArray.length; i++)
253 this._settingList.add(vSettingArray[i]);
261 * @throws org.exolab.castor.xml.MarshalException
262 * if object is null or if any SAXException is thrown during
264 * @throws org.exolab.castor.xml.ValidationException
265 * if this object is an invalid instance according to the schema
266 * @return the unmarshaled jalview.binding.FeatureSettings
268 public static jalview.binding.FeatureSettings unmarshal(
269 final java.io.Reader reader)
270 throws org.exolab.castor.xml.MarshalException,
271 org.exolab.castor.xml.ValidationException
273 return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal(
274 jalview.binding.FeatureSettings.class, reader);
280 * @throws org.exolab.castor.xml.ValidationException
281 * if this object is an invalid instance according to the schema
283 public void validate() throws org.exolab.castor.xml.ValidationException
285 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
286 validator.validate(this);