1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import org.exolab.castor.xml.Marshaller;
34 import org.exolab.castor.xml.Unmarshaller;
39 * @version $Revision$ $Date$
41 public class AlcodonFrame implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
51 private java.util.Vector _alcodonList;
54 * Field _alcodMapList.
56 private java.util.Vector _alcodMapList;
65 this._alcodonList = new java.util.Vector();
66 this._alcodMapList = new java.util.Vector();
77 * @throws java.lang.IndexOutOfBoundsException
78 * if the index given is outside the bounds of the collection
80 public void addAlcodMap(
81 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
82 throws java.lang.IndexOutOfBoundsException
84 this._alcodMapList.addElement(vAlcodMap);
92 * @throws java.lang.IndexOutOfBoundsException
93 * if the index given is outside the bounds of the collection
95 public void addAlcodMap(final int index,
96 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
97 throws java.lang.IndexOutOfBoundsException
99 this._alcodMapList.add(index, vAlcodMap);
106 * @throws java.lang.IndexOutOfBoundsException
107 * if the index given is outside the bounds of the collection
109 public void addAlcodon(
110 final jalview.schemabinding.version2.Alcodon vAlcodon)
111 throws java.lang.IndexOutOfBoundsException
113 this._alcodonList.addElement(vAlcodon);
121 * @throws java.lang.IndexOutOfBoundsException
122 * if the index given is outside the bounds of the collection
124 public void addAlcodon(final int index,
125 final jalview.schemabinding.version2.Alcodon vAlcodon)
126 throws java.lang.IndexOutOfBoundsException
128 this._alcodonList.add(index, vAlcodon);
132 * Method enumerateAlcodMap.
134 * @return an Enumeration over all jalview.schemabinding.version2.AlcodMap
137 public java.util.Enumeration enumerateAlcodMap()
139 return this._alcodMapList.elements();
143 * Method enumerateAlcodon.
145 * @return an Enumeration over all jalview.schemabinding.version2.Alcodon
148 public java.util.Enumeration enumerateAlcodon()
150 return this._alcodonList.elements();
154 * Method getAlcodMap.
157 * @throws java.lang.IndexOutOfBoundsException
158 * if the index given is outside the bounds of the collection
159 * @return the value of the jalview.schemabinding.version2.AlcodMap at the
162 public jalview.schemabinding.version2.AlcodMap getAlcodMap(final int index)
163 throws java.lang.IndexOutOfBoundsException
165 // check bounds for index
166 if (index < 0 || index >= this._alcodMapList.size())
168 throw new IndexOutOfBoundsException("getAlcodMap: Index value '"
169 + index + "' not in range [0.."
170 + (this._alcodMapList.size() - 1) + "]");
173 return (jalview.schemabinding.version2.AlcodMap) _alcodMapList
178 * Method getAlcodMap.Returns the contents of the collection in an Array.
180 * Note: Just in case the collection contents are changing in another thread,
181 * we pass a 0-length Array of the correct type into the API call. This way we
182 * <i>know</i> that the Array returned is of exactly the correct length.
184 * @return this collection as an Array
186 public jalview.schemabinding.version2.AlcodMap[] getAlcodMap()
188 jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0];
189 return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList
194 * Method getAlcodMapCount.
196 * @return the size of this collection
198 public int getAlcodMapCount()
200 return this._alcodMapList.size();
207 * @throws java.lang.IndexOutOfBoundsException
208 * if the index given is outside the bounds of the collection
209 * @return the value of the jalview.schemabinding.version2.Alcodon at the
212 public jalview.schemabinding.version2.Alcodon getAlcodon(final int index)
213 throws java.lang.IndexOutOfBoundsException
215 // check bounds for index
216 if (index < 0 || index >= this._alcodonList.size())
218 throw new IndexOutOfBoundsException("getAlcodon: Index value '"
219 + index + "' not in range [0.."
220 + (this._alcodonList.size() - 1) + "]");
223 return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index);
227 * Method getAlcodon.Returns the contents of the collection in an Array.
229 * Note: Just in case the collection contents are changing in another thread,
230 * we pass a 0-length Array of the correct type into the API call. This way we
231 * <i>know</i> that the Array returned is of exactly the correct length.
233 * @return this collection as an Array
235 public jalview.schemabinding.version2.Alcodon[] getAlcodon()
237 jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0];
238 return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList
243 * Method getAlcodonCount.
245 * @return the size of this collection
247 public int getAlcodonCount()
249 return this._alcodonList.size();
255 * @return true if this object is valid according to the schema
257 public boolean isValid()
262 } catch (org.exolab.castor.xml.ValidationException vex)
273 * @throws org.exolab.castor.xml.MarshalException
274 * if object is null or if any SAXException is thrown during
276 * @throws org.exolab.castor.xml.ValidationException
277 * if this object is an invalid instance according to the schema
279 public void marshal(final java.io.Writer out)
280 throws org.exolab.castor.xml.MarshalException,
281 org.exolab.castor.xml.ValidationException
283 Marshaller.marshal(this, out);
290 * @throws java.io.IOException
291 * if an IOException occurs during marshaling
292 * @throws org.exolab.castor.xml.ValidationException
293 * if this object is an invalid instance according to the schema
294 * @throws org.exolab.castor.xml.MarshalException
295 * if object is null or if any SAXException is thrown during
298 public void marshal(final org.xml.sax.ContentHandler handler)
299 throws java.io.IOException,
300 org.exolab.castor.xml.MarshalException,
301 org.exolab.castor.xml.ValidationException
303 Marshaller.marshal(this, handler);
307 * Method removeAlcodMap.
310 * @return true if the object was removed from the collection.
312 public boolean removeAlcodMap(
313 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
315 boolean removed = _alcodMapList.remove(vAlcodMap);
320 * Method removeAlcodMapAt.
323 * @return the element removed from the collection
325 public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt(
328 java.lang.Object obj = this._alcodMapList.remove(index);
329 return (jalview.schemabinding.version2.AlcodMap) obj;
333 * Method removeAlcodon.
336 * @return true if the object was removed from the collection.
338 public boolean removeAlcodon(
339 final jalview.schemabinding.version2.Alcodon vAlcodon)
341 boolean removed = _alcodonList.remove(vAlcodon);
346 * Method removeAlcodonAt.
349 * @return the element removed from the collection
351 public jalview.schemabinding.version2.Alcodon removeAlcodonAt(
354 java.lang.Object obj = this._alcodonList.remove(index);
355 return (jalview.schemabinding.version2.Alcodon) obj;
360 public void removeAllAlcodMap()
362 this._alcodMapList.clear();
367 public void removeAllAlcodon()
369 this._alcodonList.clear();
377 * @throws java.lang.IndexOutOfBoundsException
378 * if the index given is outside the bounds of the collection
380 public void setAlcodMap(final int index,
381 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
382 throws java.lang.IndexOutOfBoundsException
384 // check bounds for index
385 if (index < 0 || index >= this._alcodMapList.size())
387 throw new IndexOutOfBoundsException("setAlcodMap: Index value '"
388 + index + "' not in range [0.."
389 + (this._alcodMapList.size() - 1) + "]");
392 this._alcodMapList.set(index, vAlcodMap);
398 * @param vAlcodMapArray
400 public void setAlcodMap(
401 final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray)
404 _alcodMapList.clear();
406 for (int i = 0; i < vAlcodMapArray.length; i++)
408 this._alcodMapList.add(vAlcodMapArray[i]);
417 * @throws java.lang.IndexOutOfBoundsException
418 * if the index given is outside the bounds of the collection
420 public void setAlcodon(final int index,
421 final jalview.schemabinding.version2.Alcodon vAlcodon)
422 throws java.lang.IndexOutOfBoundsException
424 // check bounds for index
425 if (index < 0 || index >= this._alcodonList.size())
427 throw new IndexOutOfBoundsException("setAlcodon: Index value '"
428 + index + "' not in range [0.."
429 + (this._alcodonList.size() - 1) + "]");
432 this._alcodonList.set(index, vAlcodon);
438 * @param vAlcodonArray
440 public void setAlcodon(
441 final jalview.schemabinding.version2.Alcodon[] vAlcodonArray)
444 _alcodonList.clear();
446 for (int i = 0; i < vAlcodonArray.length; i++)
448 this._alcodonList.add(vAlcodonArray[i]);
456 * @throws org.exolab.castor.xml.MarshalException
457 * if object is null or if any SAXException is thrown during
459 * @throws org.exolab.castor.xml.ValidationException
460 * if this object is an invalid instance according to the schema
461 * @return the unmarshaled jalview.schemabinding.version2.AlcodonFrame
463 public static jalview.schemabinding.version2.AlcodonFrame unmarshal(
464 final java.io.Reader reader)
465 throws org.exolab.castor.xml.MarshalException,
466 org.exolab.castor.xml.ValidationException
468 return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller
469 .unmarshal(jalview.schemabinding.version2.AlcodonFrame.class,
476 * @throws org.exolab.castor.xml.ValidationException
477 * if this object is an invalid instance according to the schema
479 public void validate() throws org.exolab.castor.xml.ValidationException
481 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
482 validator.validate(this);