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;
39 public FeatureSettings() {
41 this._settingList = new java.util.Vector();
53 * @throws java.lang.IndexOutOfBoundsException if the index
54 * given is outside the bounds of the collection
56 public void addSetting(
57 final jalview.binding.Setting vSetting)
58 throws java.lang.IndexOutOfBoundsException {
59 this._settingList.addElement(vSetting);
67 * @throws java.lang.IndexOutOfBoundsException if the index
68 * given is outside the bounds of the collection
70 public void addSetting(
72 final jalview.binding.Setting vSetting)
73 throws java.lang.IndexOutOfBoundsException {
74 this._settingList.add(index, vSetting);
78 * Method enumerateSetting.
80 * @return an Enumeration over all jalview.binding.Setting
83 public java.util.Enumeration enumerateSetting(
85 return this._settingList.elements();
92 * @throws java.lang.IndexOutOfBoundsException if the index
93 * given is outside the bounds of the collection
94 * @return the value of the jalview.binding.Setting at the
97 public jalview.binding.Setting getSetting(
99 throws java.lang.IndexOutOfBoundsException {
100 // check bounds for index
101 if (index < 0 || index >= this._settingList.size()) {
102 throw new IndexOutOfBoundsException("getSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");
105 return (jalview.binding.Setting) _settingList.get(index);
109 * Method getSetting.Returns the contents of the collection in
110 * an Array. <p>Note: Just in case the collection contents
111 * are changing in another thread, we pass a 0-length Array of
112 * the correct type into the API call. This way we <i>know</i>
113 * 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(
142 } catch (org.exolab.castor.xml.ValidationException vex) {
152 * @throws org.exolab.castor.xml.MarshalException if object is
153 * null or if any SAXException is thrown during marshaling
154 * @throws org.exolab.castor.xml.ValidationException if this
155 * object is an invalid instance according to the schema
158 final java.io.Writer out)
159 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
160 Marshaller.marshal(this, out);
167 * @throws java.io.IOException if an IOException occurs during
169 * @throws org.exolab.castor.xml.ValidationException if this
170 * object is an invalid instance according to the schema
171 * @throws org.exolab.castor.xml.MarshalException if object is
172 * null or if any SAXException is thrown during marshaling
175 final org.xml.sax.ContentHandler handler)
176 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
177 Marshaller.marshal(this, handler);
182 public void removeAllSetting(
184 this._settingList.clear();
188 * Method removeSetting.
191 * @return true if the object was removed from the collection.
193 public boolean removeSetting(
194 final jalview.binding.Setting vSetting) {
195 boolean removed = _settingList.remove(vSetting);
200 * Method removeSettingAt.
203 * @return the element removed from the collection
205 public jalview.binding.Setting removeSettingAt(
207 java.lang.Object obj = this._settingList.remove(index);
208 return (jalview.binding.Setting) obj;
216 * @throws java.lang.IndexOutOfBoundsException if the index
217 * given is outside the bounds of the collection
219 public void setSetting(
221 final jalview.binding.Setting vSetting)
222 throws java.lang.IndexOutOfBoundsException {
223 // check bounds for index
224 if (index < 0 || index >= this._settingList.size()) {
225 throw new IndexOutOfBoundsException("setSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]");
228 this._settingList.set(index, vSetting);
234 * @param vSettingArray
236 public void setSetting(
237 final jalview.binding.Setting[] vSettingArray) {
239 _settingList.clear();
241 for (int i = 0; i < vSettingArray.length; i++) {
242 this._settingList.add(vSettingArray[i]);
250 * @throws org.exolab.castor.xml.MarshalException if object is
251 * null or if any SAXException is thrown during marshaling
252 * @throws org.exolab.castor.xml.ValidationException if this
253 * object is an invalid instance according to the schema
254 * @return the unmarshaled jalview.binding.FeatureSettings
256 public static jalview.binding.FeatureSettings unmarshal(
257 final java.io.Reader reader)
258 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
259 return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal(jalview.binding.FeatureSettings.class, reader);
265 * @throws org.exolab.castor.xml.ValidationException if this
266 * object is an invalid instance according to the schema
268 public void validate(
270 throws org.exolab.castor.xml.ValidationException {
271 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
272 validator.validate(this);