2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import java.io.IOException;
\r
15 import java.io.Reader;
\r
16 import java.io.Serializable;
\r
17 import java.io.Writer;
\r
18 import java.util.Enumeration;
\r
19 import java.util.Vector;
\r
20 import org.exolab.castor.xml.MarshalException;
\r
21 import org.exolab.castor.xml.Marshaller;
\r
22 import org.exolab.castor.xml.Unmarshaller;
\r
23 import org.exolab.castor.xml.ValidationException;
\r
24 import org.xml.sax.ContentHandler;
\r
27 * Class FeatureSettings.
\r
29 * @version $Revision$ $Date$
\r
31 public class FeatureSettings implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
39 * Field _settingList
\r
41 private java.util.Vector _settingList;
\r
48 public FeatureSettings() {
\r
50 _settingList = new Vector();
\r
51 } //-- jalview.binding.FeatureSettings()
\r
65 public void addSetting(jalview.binding.Setting vSetting)
\r
66 throws java.lang.IndexOutOfBoundsException
\r
68 _settingList.addElement(vSetting);
\r
69 } //-- void addSetting(jalview.binding.Setting)
\r
79 public void addSetting(int index, jalview.binding.Setting vSetting)
\r
80 throws java.lang.IndexOutOfBoundsException
\r
82 _settingList.insertElementAt(vSetting, index);
\r
83 } //-- void addSetting(int, jalview.binding.Setting)
\r
86 * Method enumerateSetting
\r
90 * @return Enumeration
\r
92 public java.util.Enumeration enumerateSetting()
\r
94 return _settingList.elements();
\r
95 } //-- java.util.Enumeration enumerateSetting()
\r
105 public jalview.binding.Setting getSetting(int index)
\r
106 throws java.lang.IndexOutOfBoundsException
\r
108 //-- check bounds for index
\r
109 if ((index < 0) || (index > _settingList.size())) {
\r
110 throw new IndexOutOfBoundsException();
\r
113 return (jalview.binding.Setting) _settingList.elementAt(index);
\r
114 } //-- jalview.binding.Setting getSetting(int)
\r
117 * Method getSetting
\r
123 public jalview.binding.Setting[] getSetting()
\r
125 int size = _settingList.size();
\r
126 jalview.binding.Setting[] mArray = new jalview.binding.Setting[size];
\r
127 for (int index = 0; index < size; index++) {
\r
128 mArray[index] = (jalview.binding.Setting) _settingList.elementAt(index);
\r
131 } //-- jalview.binding.Setting[] getSetting()
\r
134 * Method getSettingCount
\r
140 public int getSettingCount()
\r
142 return _settingList.size();
\r
143 } //-- int getSettingCount()
\r
152 public boolean isValid()
\r
157 catch (org.exolab.castor.xml.ValidationException vex) {
\r
161 } //-- boolean isValid()
\r
170 public void marshal(java.io.Writer out)
\r
171 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
174 Marshaller.marshal(this, out);
\r
175 } //-- void marshal(java.io.Writer)
\r
184 public void marshal(org.xml.sax.ContentHandler handler)
\r
185 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
188 Marshaller.marshal(this, handler);
\r
189 } //-- void marshal(org.xml.sax.ContentHandler)
\r
192 * Method removeAllSetting
\r
195 public void removeAllSetting()
\r
197 _settingList.removeAllElements();
\r
198 } //-- void removeAllSetting()
\r
201 * Method removeSetting
\r
208 public jalview.binding.Setting removeSetting(int index)
\r
210 java.lang.Object obj = _settingList.elementAt(index);
\r
211 _settingList.removeElementAt(index);
\r
212 return (jalview.binding.Setting) obj;
\r
213 } //-- jalview.binding.Setting removeSetting(int)
\r
216 * Method setSetting
\r
223 public void setSetting(int index, jalview.binding.Setting vSetting)
\r
224 throws java.lang.IndexOutOfBoundsException
\r
226 //-- check bounds for index
\r
227 if ((index < 0) || (index > _settingList.size())) {
\r
228 throw new IndexOutOfBoundsException();
\r
230 _settingList.setElementAt(vSetting, index);
\r
231 } //-- void setSetting(int, jalview.binding.Setting)
\r
234 * Method setSetting
\r
238 * @param settingArray
\r
240 public void setSetting(jalview.binding.Setting[] settingArray)
\r
243 _settingList.removeAllElements();
\r
244 for (int i = 0; i < settingArray.length; i++) {
\r
245 _settingList.addElement(settingArray[i]);
\r
247 } //-- void setSetting(jalview.binding.Setting)
\r
257 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
258 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
260 return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal(jalview.binding.FeatureSettings.class, reader);
\r
261 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
267 public void validate()
\r
268 throws org.exolab.castor.xml.ValidationException
\r
270 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
271 validator.validate(this);
\r
272 } //-- void validate()
\r