1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) 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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
40 * @version $Revision$ $Date$
42 public class AlcodonFrame implements java.io.Serializable
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
52 private java.util.Vector _alcodonList;
55 * Field _alcodMapList.
57 private java.util.Vector _alcodMapList;
66 this._alcodonList = new java.util.Vector();
67 this._alcodMapList = new java.util.Vector();
78 * @throws java.lang.IndexOutOfBoundsException
79 * if the index given is outside the bounds of the collection
81 public void addAlcodMap(
82 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
83 throws java.lang.IndexOutOfBoundsException
85 this._alcodMapList.addElement(vAlcodMap);
93 * @throws java.lang.IndexOutOfBoundsException
94 * if the index given is outside the bounds of the collection
96 public void addAlcodMap(final int index,
97 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
98 throws java.lang.IndexOutOfBoundsException
100 this._alcodMapList.add(index, vAlcodMap);
107 * @throws java.lang.IndexOutOfBoundsException
108 * if the index given is outside the bounds of the collection
110 public void addAlcodon(
111 final jalview.schemabinding.version2.Alcodon vAlcodon)
112 throws java.lang.IndexOutOfBoundsException
114 this._alcodonList.addElement(vAlcodon);
122 * @throws java.lang.IndexOutOfBoundsException
123 * if the index given is outside the bounds of the collection
125 public void addAlcodon(final int index,
126 final jalview.schemabinding.version2.Alcodon vAlcodon)
127 throws java.lang.IndexOutOfBoundsException
129 this._alcodonList.add(index, vAlcodon);
133 * Method enumerateAlcodMap.
135 * @return an Enumeration over all jalview.schemabinding.version2.AlcodMap
138 public java.util.Enumeration enumerateAlcodMap()
140 return this._alcodMapList.elements();
144 * Method enumerateAlcodon.
146 * @return an Enumeration over all jalview.schemabinding.version2.Alcodon
149 public java.util.Enumeration enumerateAlcodon()
151 return this._alcodonList.elements();
155 * Method getAlcodMap.
158 * @throws java.lang.IndexOutOfBoundsException
159 * if the index given is outside the bounds of the collection
160 * @return the value of the jalview.schemabinding.version2.AlcodMap at the
163 public jalview.schemabinding.version2.AlcodMap getAlcodMap(final int index)
164 throws java.lang.IndexOutOfBoundsException
166 // check bounds for index
167 if (index < 0 || index >= this._alcodMapList.size())
169 throw new IndexOutOfBoundsException("getAlcodMap: Index value '"
170 + index + "' not in range [0.."
171 + (this._alcodMapList.size() - 1) + "]");
174 return (jalview.schemabinding.version2.AlcodMap) _alcodMapList
179 * Method getAlcodMap.Returns the contents of the collection in an Array.
181 * Note: Just in case the collection contents are changing in another thread,
182 * we pass a 0-length Array of the correct type into the API call. This way we
183 * <i>know</i> that the Array returned is of exactly the correct length.
185 * @return this collection as an Array
187 public jalview.schemabinding.version2.AlcodMap[] getAlcodMap()
189 jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0];
190 return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList
195 * Method getAlcodMapCount.
197 * @return the size of this collection
199 public int getAlcodMapCount()
201 return this._alcodMapList.size();
208 * @throws java.lang.IndexOutOfBoundsException
209 * if the index given is outside the bounds of the collection
210 * @return the value of the jalview.schemabinding.version2.Alcodon at the
213 public jalview.schemabinding.version2.Alcodon getAlcodon(final int index)
214 throws java.lang.IndexOutOfBoundsException
216 // check bounds for index
217 if (index < 0 || index >= this._alcodonList.size())
219 throw new IndexOutOfBoundsException("getAlcodon: Index value '"
220 + index + "' not in range [0.."
221 + (this._alcodonList.size() - 1) + "]");
224 return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index);
228 * Method getAlcodon.Returns the contents of the collection in an Array.
230 * Note: Just in case the collection contents are changing in another thread,
231 * we pass a 0-length Array of the correct type into the API call. This way we
232 * <i>know</i> that the Array returned is of exactly the correct length.
234 * @return this collection as an Array
236 public jalview.schemabinding.version2.Alcodon[] getAlcodon()
238 jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0];
239 return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList
244 * Method getAlcodonCount.
246 * @return the size of this collection
248 public int getAlcodonCount()
250 return this._alcodonList.size();
256 * @return true if this object is valid according to the schema
258 public boolean isValid()
263 } catch (org.exolab.castor.xml.ValidationException vex)
274 * @throws org.exolab.castor.xml.MarshalException
275 * if object is null or if any SAXException is thrown during
277 * @throws org.exolab.castor.xml.ValidationException
278 * if this object is an invalid instance according to the schema
280 public void marshal(final java.io.Writer out)
281 throws org.exolab.castor.xml.MarshalException,
282 org.exolab.castor.xml.ValidationException
284 Marshaller.marshal(this, out);
291 * @throws java.io.IOException
292 * if an IOException occurs during marshaling
293 * @throws org.exolab.castor.xml.ValidationException
294 * if this object is an invalid instance according to the schema
295 * @throws org.exolab.castor.xml.MarshalException
296 * if object is null or if any SAXException is thrown during
299 public void marshal(final org.xml.sax.ContentHandler handler)
300 throws java.io.IOException,
301 org.exolab.castor.xml.MarshalException,
302 org.exolab.castor.xml.ValidationException
304 Marshaller.marshal(this, handler);
308 * Method removeAlcodMap.
311 * @return true if the object was removed from the collection.
313 public boolean removeAlcodMap(
314 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
316 boolean removed = _alcodMapList.remove(vAlcodMap);
321 * Method removeAlcodMapAt.
324 * @return the element removed from the collection
326 public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt(
329 java.lang.Object obj = this._alcodMapList.remove(index);
330 return (jalview.schemabinding.version2.AlcodMap) obj;
334 * Method removeAlcodon.
337 * @return true if the object was removed from the collection.
339 public boolean removeAlcodon(
340 final jalview.schemabinding.version2.Alcodon vAlcodon)
342 boolean removed = _alcodonList.remove(vAlcodon);
347 * Method removeAlcodonAt.
350 * @return the element removed from the collection
352 public jalview.schemabinding.version2.Alcodon removeAlcodonAt(
355 java.lang.Object obj = this._alcodonList.remove(index);
356 return (jalview.schemabinding.version2.Alcodon) obj;
361 public void removeAllAlcodMap()
363 this._alcodMapList.clear();
368 public void removeAllAlcodon()
370 this._alcodonList.clear();
378 * @throws java.lang.IndexOutOfBoundsException
379 * if the index given is outside the bounds of the collection
381 public void setAlcodMap(final int index,
382 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
383 throws java.lang.IndexOutOfBoundsException
385 // check bounds for index
386 if (index < 0 || index >= this._alcodMapList.size())
388 throw new IndexOutOfBoundsException("setAlcodMap: Index value '"
389 + index + "' not in range [0.."
390 + (this._alcodMapList.size() - 1) + "]");
393 this._alcodMapList.set(index, vAlcodMap);
399 * @param vAlcodMapArray
401 public void setAlcodMap(
402 final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray)
405 _alcodMapList.clear();
407 for (int i = 0; i < vAlcodMapArray.length; i++)
409 this._alcodMapList.add(vAlcodMapArray[i]);
418 * @throws java.lang.IndexOutOfBoundsException
419 * if the index given is outside the bounds of the collection
421 public void setAlcodon(final int index,
422 final jalview.schemabinding.version2.Alcodon vAlcodon)
423 throws java.lang.IndexOutOfBoundsException
425 // check bounds for index
426 if (index < 0 || index >= this._alcodonList.size())
428 throw new IndexOutOfBoundsException("setAlcodon: Index value '"
429 + index + "' not in range [0.."
430 + (this._alcodonList.size() - 1) + "]");
433 this._alcodonList.set(index, vAlcodon);
439 * @param vAlcodonArray
441 public void setAlcodon(
442 final jalview.schemabinding.version2.Alcodon[] vAlcodonArray)
445 _alcodonList.clear();
447 for (int i = 0; i < vAlcodonArray.length; i++)
449 this._alcodonList.add(vAlcodonArray[i]);
457 * @throws org.exolab.castor.xml.MarshalException
458 * if object is null or if any SAXException is thrown during
460 * @throws org.exolab.castor.xml.ValidationException
461 * if this object is an invalid instance according to the schema
462 * @return the unmarshaled jalview.schemabinding.version2.AlcodonFrame
464 public static jalview.schemabinding.version2.AlcodonFrame unmarshal(
465 final java.io.Reader reader)
466 throws org.exolab.castor.xml.MarshalException,
467 org.exolab.castor.xml.ValidationException
469 return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller
470 .unmarshal(jalview.schemabinding.version2.AlcodonFrame.class,
477 * @throws org.exolab.castor.xml.ValidationException
478 * if this object is an invalid instance according to the schema
480 public void validate() throws org.exolab.castor.xml.ValidationException
482 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
483 validator.validate(this);