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;
46 this._alcodonList = new java.util.Vector();
47 this._alcodMapList = new java.util.Vector();
58 * @throws java.lang.IndexOutOfBoundsException
59 * if the index given is outside the bounds of the collection
61 public void addAlcodMap(
62 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
63 throws java.lang.IndexOutOfBoundsException
65 this._alcodMapList.addElement(vAlcodMap);
73 * @throws java.lang.IndexOutOfBoundsException
74 * if the index given is outside the bounds of the collection
76 public void addAlcodMap(final int index,
77 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
78 throws java.lang.IndexOutOfBoundsException
80 this._alcodMapList.add(index, vAlcodMap);
87 * @throws java.lang.IndexOutOfBoundsException
88 * if the index given is outside the bounds of the collection
90 public void addAlcodon(
91 final jalview.schemabinding.version2.Alcodon vAlcodon)
92 throws java.lang.IndexOutOfBoundsException
94 this._alcodonList.addElement(vAlcodon);
102 * @throws java.lang.IndexOutOfBoundsException
103 * if the index given is outside the bounds of the collection
105 public void addAlcodon(final int index,
106 final jalview.schemabinding.version2.Alcodon vAlcodon)
107 throws java.lang.IndexOutOfBoundsException
109 this._alcodonList.add(index, vAlcodon);
113 * Method enumerateAlcodMap.
115 * @return an Enumeration over all jalview.schemabinding.version2.AlcodMap
118 public java.util.Enumeration enumerateAlcodMap()
120 return this._alcodMapList.elements();
124 * Method enumerateAlcodon.
126 * @return an Enumeration over all jalview.schemabinding.version2.Alcodon
129 public java.util.Enumeration enumerateAlcodon()
131 return this._alcodonList.elements();
135 * Method getAlcodMap.
138 * @throws java.lang.IndexOutOfBoundsException
139 * if the index given is outside the bounds of the collection
140 * @return the value of the jalview.schemabinding.version2.AlcodMap at the
143 public jalview.schemabinding.version2.AlcodMap getAlcodMap(final int index)
144 throws java.lang.IndexOutOfBoundsException
146 // check bounds for index
147 if (index < 0 || index >= this._alcodMapList.size())
149 throw new IndexOutOfBoundsException("getAlcodMap: Index value '"
150 + index + "' not in range [0.."
151 + (this._alcodMapList.size() - 1) + "]");
154 return (jalview.schemabinding.version2.AlcodMap) _alcodMapList
159 * Method getAlcodMap.Returns the contents of the collection in an Array.
161 * Note: Just in case the collection contents are changing in another thread,
162 * we pass a 0-length Array of the correct type into the API call. This way we
163 * <i>know</i> that the Array returned is of exactly the correct length.
165 * @return this collection as an Array
167 public jalview.schemabinding.version2.AlcodMap[] getAlcodMap()
169 jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0];
170 return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList
175 * Method getAlcodMapCount.
177 * @return the size of this collection
179 public int getAlcodMapCount()
181 return this._alcodMapList.size();
188 * @throws java.lang.IndexOutOfBoundsException
189 * if the index given is outside the bounds of the collection
190 * @return the value of the jalview.schemabinding.version2.Alcodon at the
193 public jalview.schemabinding.version2.Alcodon getAlcodon(final int index)
194 throws java.lang.IndexOutOfBoundsException
196 // check bounds for index
197 if (index < 0 || index >= this._alcodonList.size())
199 throw new IndexOutOfBoundsException("getAlcodon: Index value '"
200 + index + "' not in range [0.."
201 + (this._alcodonList.size() - 1) + "]");
204 return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index);
208 * Method getAlcodon.Returns the contents of the collection in an Array.
210 * Note: Just in case the collection contents are changing in another thread,
211 * we pass a 0-length Array of the correct type into the API call. This way we
212 * <i>know</i> that the Array returned is of exactly the correct length.
214 * @return this collection as an Array
216 public jalview.schemabinding.version2.Alcodon[] getAlcodon()
218 jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0];
219 return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList
224 * Method getAlcodonCount.
226 * @return the size of this collection
228 public int getAlcodonCount()
230 return this._alcodonList.size();
236 * @return true if this object is valid according to the schema
238 public boolean isValid()
243 } catch (org.exolab.castor.xml.ValidationException vex)
254 * @throws org.exolab.castor.xml.MarshalException
255 * if object is null or if any SAXException is thrown during
257 * @throws org.exolab.castor.xml.ValidationException
258 * if this object is an invalid instance according to the schema
260 public void marshal(final java.io.Writer out)
261 throws org.exolab.castor.xml.MarshalException,
262 org.exolab.castor.xml.ValidationException
264 Marshaller.marshal(this, out);
271 * @throws java.io.IOException
272 * if an IOException occurs during marshaling
273 * @throws org.exolab.castor.xml.ValidationException
274 * if this object is an invalid instance according to the schema
275 * @throws org.exolab.castor.xml.MarshalException
276 * if object is null or if any SAXException is thrown during
279 public void marshal(final org.xml.sax.ContentHandler handler)
280 throws java.io.IOException,
281 org.exolab.castor.xml.MarshalException,
282 org.exolab.castor.xml.ValidationException
284 Marshaller.marshal(this, handler);
288 * Method removeAlcodMap.
291 * @return true if the object was removed from the collection.
293 public boolean removeAlcodMap(
294 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
296 boolean removed = _alcodMapList.remove(vAlcodMap);
301 * Method removeAlcodMapAt.
304 * @return the element removed from the collection
306 public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt(
309 java.lang.Object obj = this._alcodMapList.remove(index);
310 return (jalview.schemabinding.version2.AlcodMap) obj;
314 * Method removeAlcodon.
317 * @return true if the object was removed from the collection.
319 public boolean removeAlcodon(
320 final jalview.schemabinding.version2.Alcodon vAlcodon)
322 boolean removed = _alcodonList.remove(vAlcodon);
327 * Method removeAlcodonAt.
330 * @return the element removed from the collection
332 public jalview.schemabinding.version2.Alcodon removeAlcodonAt(
335 java.lang.Object obj = this._alcodonList.remove(index);
336 return (jalview.schemabinding.version2.Alcodon) obj;
341 public void removeAllAlcodMap()
343 this._alcodMapList.clear();
348 public void removeAllAlcodon()
350 this._alcodonList.clear();
358 * @throws java.lang.IndexOutOfBoundsException
359 * if the index given is outside the bounds of the collection
361 public void setAlcodMap(final int index,
362 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
363 throws java.lang.IndexOutOfBoundsException
365 // check bounds for index
366 if (index < 0 || index >= this._alcodMapList.size())
368 throw new IndexOutOfBoundsException("setAlcodMap: Index value '"
369 + index + "' not in range [0.."
370 + (this._alcodMapList.size() - 1) + "]");
373 this._alcodMapList.set(index, vAlcodMap);
379 * @param vAlcodMapArray
381 public void setAlcodMap(
382 final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray)
385 _alcodMapList.clear();
387 for (int i = 0; i < vAlcodMapArray.length; i++)
389 this._alcodMapList.add(vAlcodMapArray[i]);
398 * @throws java.lang.IndexOutOfBoundsException
399 * if the index given is outside the bounds of the collection
401 public void setAlcodon(final int index,
402 final jalview.schemabinding.version2.Alcodon vAlcodon)
403 throws java.lang.IndexOutOfBoundsException
405 // check bounds for index
406 if (index < 0 || index >= this._alcodonList.size())
408 throw new IndexOutOfBoundsException("setAlcodon: Index value '"
409 + index + "' not in range [0.."
410 + (this._alcodonList.size() - 1) + "]");
413 this._alcodonList.set(index, vAlcodon);
419 * @param vAlcodonArray
421 public void setAlcodon(
422 final jalview.schemabinding.version2.Alcodon[] vAlcodonArray)
425 _alcodonList.clear();
427 for (int i = 0; i < vAlcodonArray.length; i++)
429 this._alcodonList.add(vAlcodonArray[i]);
437 * @throws org.exolab.castor.xml.MarshalException
438 * if object is null or if any SAXException is thrown during
440 * @throws org.exolab.castor.xml.ValidationException
441 * if this object is an invalid instance according to the schema
442 * @return the unmarshaled jalview.schemabinding.version2.AlcodonFrame
444 public static jalview.schemabinding.version2.AlcodonFrame unmarshal(
445 final java.io.Reader reader)
446 throws org.exolab.castor.xml.MarshalException,
447 org.exolab.castor.xml.ValidationException
449 return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller
450 .unmarshal(jalview.schemabinding.version2.AlcodonFrame.class,
457 * @throws org.exolab.castor.xml.ValidationException
458 * if this object is an invalid instance according to the schema
460 public void validate() throws org.exolab.castor.xml.ValidationException
462 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
463 validator.validate(this);