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;
20 * @version $Revision$ $Date$
22 public class AlcodonFrame implements java.io.Serializable {
25 //--------------------------/
26 //- Class/Member Variables -/
27 //--------------------------/
32 private java.util.Vector _alcodonList;
35 * Field _alcodMapList.
37 private java.util.Vector _alcodMapList;
44 public AlcodonFrame() {
46 this._alcodonList = new java.util.Vector();
47 this._alcodMapList = new java.util.Vector();
59 * @throws java.lang.IndexOutOfBoundsException if the index
60 * given is outside the bounds of the collection
62 public void addAlcodMap(
63 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
64 throws java.lang.IndexOutOfBoundsException {
65 this._alcodMapList.addElement(vAlcodMap);
73 * @throws java.lang.IndexOutOfBoundsException if the index
74 * given is outside the bounds of the collection
76 public void addAlcodMap(
78 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
79 throws java.lang.IndexOutOfBoundsException {
80 this._alcodMapList.add(index, vAlcodMap);
87 * @throws java.lang.IndexOutOfBoundsException if the index
88 * given is outside the bounds of the collection
90 public void addAlcodon(
91 final jalview.schemabinding.version2.Alcodon vAlcodon)
92 throws java.lang.IndexOutOfBoundsException {
93 this._alcodonList.addElement(vAlcodon);
101 * @throws java.lang.IndexOutOfBoundsException if the index
102 * given is outside the bounds of the collection
104 public void addAlcodon(
106 final jalview.schemabinding.version2.Alcodon vAlcodon)
107 throws java.lang.IndexOutOfBoundsException {
108 this._alcodonList.add(index, vAlcodon);
112 * Method enumerateAlcodMap.
114 * @return an Enumeration over all
115 * jalview.schemabinding.version2.AlcodMap elements
117 public java.util.Enumeration enumerateAlcodMap(
119 return this._alcodMapList.elements();
123 * Method enumerateAlcodon.
125 * @return an Enumeration over all
126 * jalview.schemabinding.version2.Alcodon elements
128 public java.util.Enumeration enumerateAlcodon(
130 return this._alcodonList.elements();
134 * Method getAlcodMap.
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.AlcodMap at the given index
142 public jalview.schemabinding.version2.AlcodMap getAlcodMap(
144 throws java.lang.IndexOutOfBoundsException {
145 // check bounds for index
146 if (index < 0 || index >= this._alcodMapList.size()) {
147 throw new IndexOutOfBoundsException("getAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]");
150 return (jalview.schemabinding.version2.AlcodMap) _alcodMapList.get(index);
154 * Method getAlcodMap.Returns the contents of the collection in
155 * an Array. <p>Note: Just in case the collection contents
156 * are changing in another thread, we pass a 0-length Array of
157 * the 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.AlcodMap[] getAlcodMap(
164 jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0];
165 return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList.toArray(array);
169 * Method getAlcodMapCount.
171 * @return the size of this collection
173 public int getAlcodMapCount(
175 return this._alcodMapList.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.Alcodon at the given index
187 public jalview.schemabinding.version2.Alcodon getAlcodon(
189 throws java.lang.IndexOutOfBoundsException {
190 // check bounds for index
191 if (index < 0 || index >= this._alcodonList.size()) {
192 throw new IndexOutOfBoundsException("getAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]");
195 return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index);
199 * Method getAlcodon.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.Alcodon[] getAlcodon(
209 jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0];
210 return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList.toArray(array);
214 * Method getAlcodonCount.
216 * @return the size of this collection
218 public int getAlcodonCount(
220 return this._alcodonList.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);
271 * Method removeAlcodMap.
274 * @return true if the object was removed from the collection.
276 public boolean removeAlcodMap(
277 final jalview.schemabinding.version2.AlcodMap vAlcodMap) {
278 boolean removed = _alcodMapList.remove(vAlcodMap);
283 * Method removeAlcodMapAt.
286 * @return the element removed from the collection
288 public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt(
290 java.lang.Object obj = this._alcodMapList.remove(index);
291 return (jalview.schemabinding.version2.AlcodMap) obj;
295 * Method removeAlcodon.
298 * @return true if the object was removed from the collection.
300 public boolean removeAlcodon(
301 final jalview.schemabinding.version2.Alcodon vAlcodon) {
302 boolean removed = _alcodonList.remove(vAlcodon);
307 * Method removeAlcodonAt.
310 * @return the element removed from the collection
312 public jalview.schemabinding.version2.Alcodon removeAlcodonAt(
314 java.lang.Object obj = this._alcodonList.remove(index);
315 return (jalview.schemabinding.version2.Alcodon) obj;
320 public void removeAllAlcodMap(
322 this._alcodMapList.clear();
327 public void removeAllAlcodon(
329 this._alcodonList.clear();
337 * @throws java.lang.IndexOutOfBoundsException if the index
338 * given is outside the bounds of the collection
340 public void setAlcodMap(
342 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
343 throws java.lang.IndexOutOfBoundsException {
344 // check bounds for index
345 if (index < 0 || index >= this._alcodMapList.size()) {
346 throw new IndexOutOfBoundsException("setAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]");
349 this._alcodMapList.set(index, vAlcodMap);
355 * @param vAlcodMapArray
357 public void setAlcodMap(
358 final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray) {
360 _alcodMapList.clear();
362 for (int i = 0; i < vAlcodMapArray.length; i++) {
363 this._alcodMapList.add(vAlcodMapArray[i]);
372 * @throws java.lang.IndexOutOfBoundsException if the index
373 * given is outside the bounds of the collection
375 public void setAlcodon(
377 final jalview.schemabinding.version2.Alcodon vAlcodon)
378 throws java.lang.IndexOutOfBoundsException {
379 // check bounds for index
380 if (index < 0 || index >= this._alcodonList.size()) {
381 throw new IndexOutOfBoundsException("setAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]");
384 this._alcodonList.set(index, vAlcodon);
390 * @param vAlcodonArray
392 public void setAlcodon(
393 final jalview.schemabinding.version2.Alcodon[] vAlcodonArray) {
395 _alcodonList.clear();
397 for (int i = 0; i < vAlcodonArray.length; i++) {
398 this._alcodonList.add(vAlcodonArray[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.AlcodonFrame
413 public static jalview.schemabinding.version2.AlcodonFrame unmarshal(
414 final java.io.Reader reader)
415 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
416 return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller.unmarshal(jalview.schemabinding.version2.AlcodonFrame.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);