1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
37 * @version $Revision$ $Date$
39 public class AlcodonFrame implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
49 private java.util.Vector _alcodonList;
52 * Field _alcodMapList.
54 private java.util.Vector _alcodMapList;
61 public AlcodonFrame() {
63 this._alcodonList = new java.util.Vector();
64 this._alcodMapList = new java.util.Vector();
76 * @throws java.lang.IndexOutOfBoundsException if the index
77 * given is outside the bounds of the collection
79 public void addAlcodMap(
80 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
81 throws java.lang.IndexOutOfBoundsException {
82 this._alcodMapList.addElement(vAlcodMap);
90 * @throws java.lang.IndexOutOfBoundsException if the index
91 * given is outside the bounds of the collection
93 public void addAlcodMap(
95 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
96 throws java.lang.IndexOutOfBoundsException {
97 this._alcodMapList.add(index, vAlcodMap);
104 * @throws java.lang.IndexOutOfBoundsException if the index
105 * given is outside the bounds of the collection
107 public void addAlcodon(
108 final jalview.schemabinding.version2.Alcodon vAlcodon)
109 throws java.lang.IndexOutOfBoundsException {
110 this._alcodonList.addElement(vAlcodon);
118 * @throws java.lang.IndexOutOfBoundsException if the index
119 * given is outside the bounds of the collection
121 public void addAlcodon(
123 final jalview.schemabinding.version2.Alcodon vAlcodon)
124 throws java.lang.IndexOutOfBoundsException {
125 this._alcodonList.add(index, vAlcodon);
129 * Method enumerateAlcodMap.
131 * @return an Enumeration over all
132 * jalview.schemabinding.version2.AlcodMap elements
134 public java.util.Enumeration enumerateAlcodMap(
136 return this._alcodMapList.elements();
140 * Method enumerateAlcodon.
142 * @return an Enumeration over all
143 * jalview.schemabinding.version2.Alcodon elements
145 public java.util.Enumeration enumerateAlcodon(
147 return this._alcodonList.elements();
151 * Method getAlcodMap.
154 * @throws java.lang.IndexOutOfBoundsException if the index
155 * given is outside the bounds of the collection
156 * @return the value of the
157 * jalview.schemabinding.version2.AlcodMap at the given index
159 public jalview.schemabinding.version2.AlcodMap getAlcodMap(
161 throws java.lang.IndexOutOfBoundsException {
162 // check bounds for index
163 if (index < 0 || index >= this._alcodMapList.size()) {
164 throw new IndexOutOfBoundsException("getAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]");
167 return (jalview.schemabinding.version2.AlcodMap) _alcodMapList.get(index);
171 * Method getAlcodMap.Returns the contents of the collection in
172 * an Array. <p>Note: Just in case the collection contents
173 * are changing in another thread, we pass a 0-length Array of
174 * the correct type into the API call. This way we <i>know</i>
175 * that the Array returned is of exactly the correct length.
177 * @return this collection as an Array
179 public jalview.schemabinding.version2.AlcodMap[] getAlcodMap(
181 jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0];
182 return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList.toArray(array);
186 * Method getAlcodMapCount.
188 * @return the size of this collection
190 public int getAlcodMapCount(
192 return this._alcodMapList.size();
199 * @throws java.lang.IndexOutOfBoundsException if the index
200 * given is outside the bounds of the collection
201 * @return the value of the
202 * jalview.schemabinding.version2.Alcodon at the given index
204 public jalview.schemabinding.version2.Alcodon getAlcodon(
206 throws java.lang.IndexOutOfBoundsException {
207 // check bounds for index
208 if (index < 0 || index >= this._alcodonList.size()) {
209 throw new IndexOutOfBoundsException("getAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]");
212 return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index);
216 * Method getAlcodon.Returns the contents of the collection in
217 * an Array. <p>Note: Just in case the collection contents
218 * are changing in another thread, we pass a 0-length Array of
219 * the correct type into the API call. This way we <i>know</i>
220 * that the Array returned is of exactly the correct length.
222 * @return this collection as an Array
224 public jalview.schemabinding.version2.Alcodon[] getAlcodon(
226 jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0];
227 return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList.toArray(array);
231 * Method getAlcodonCount.
233 * @return the size of this collection
235 public int getAlcodonCount(
237 return this._alcodonList.size();
243 * @return true if this object is valid according to the schema
245 public boolean isValid(
249 } catch (org.exolab.castor.xml.ValidationException vex) {
259 * @throws org.exolab.castor.xml.MarshalException if object is
260 * null or if any SAXException is thrown during marshaling
261 * @throws org.exolab.castor.xml.ValidationException if this
262 * object is an invalid instance according to the schema
265 final java.io.Writer out)
266 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
267 Marshaller.marshal(this, out);
274 * @throws java.io.IOException if an IOException occurs during
276 * @throws org.exolab.castor.xml.ValidationException if this
277 * object is an invalid instance according to the schema
278 * @throws org.exolab.castor.xml.MarshalException if object is
279 * null or if any SAXException is thrown during marshaling
282 final org.xml.sax.ContentHandler handler)
283 throws java.io.IOException, org.exolab.castor.xml.MarshalException, 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) {
295 boolean removed = _alcodMapList.remove(vAlcodMap);
300 * Method removeAlcodMapAt.
303 * @return the element removed from the collection
305 public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt(
307 java.lang.Object obj = this._alcodMapList.remove(index);
308 return (jalview.schemabinding.version2.AlcodMap) obj;
312 * Method removeAlcodon.
315 * @return true if the object was removed from the collection.
317 public boolean removeAlcodon(
318 final jalview.schemabinding.version2.Alcodon vAlcodon) {
319 boolean removed = _alcodonList.remove(vAlcodon);
324 * Method removeAlcodonAt.
327 * @return the element removed from the collection
329 public jalview.schemabinding.version2.Alcodon removeAlcodonAt(
331 java.lang.Object obj = this._alcodonList.remove(index);
332 return (jalview.schemabinding.version2.Alcodon) obj;
337 public void removeAllAlcodMap(
339 this._alcodMapList.clear();
344 public void removeAllAlcodon(
346 this._alcodonList.clear();
354 * @throws java.lang.IndexOutOfBoundsException if the index
355 * given is outside the bounds of the collection
357 public void setAlcodMap(
359 final jalview.schemabinding.version2.AlcodMap vAlcodMap)
360 throws java.lang.IndexOutOfBoundsException {
361 // check bounds for index
362 if (index < 0 || index >= this._alcodMapList.size()) {
363 throw new IndexOutOfBoundsException("setAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]");
366 this._alcodMapList.set(index, vAlcodMap);
372 * @param vAlcodMapArray
374 public void setAlcodMap(
375 final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray) {
377 _alcodMapList.clear();
379 for (int i = 0; i < vAlcodMapArray.length; i++) {
380 this._alcodMapList.add(vAlcodMapArray[i]);
389 * @throws java.lang.IndexOutOfBoundsException if the index
390 * given is outside the bounds of the collection
392 public void setAlcodon(
394 final jalview.schemabinding.version2.Alcodon vAlcodon)
395 throws java.lang.IndexOutOfBoundsException {
396 // check bounds for index
397 if (index < 0 || index >= this._alcodonList.size()) {
398 throw new IndexOutOfBoundsException("setAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]");
401 this._alcodonList.set(index, vAlcodon);
407 * @param vAlcodonArray
409 public void setAlcodon(
410 final jalview.schemabinding.version2.Alcodon[] vAlcodonArray) {
412 _alcodonList.clear();
414 for (int i = 0; i < vAlcodonArray.length; i++) {
415 this._alcodonList.add(vAlcodonArray[i]);
423 * @throws org.exolab.castor.xml.MarshalException if object is
424 * null or if any SAXException is thrown during marshaling
425 * @throws org.exolab.castor.xml.ValidationException if this
426 * object is an invalid instance according to the schema
427 * @return the unmarshaled
428 * jalview.schemabinding.version2.AlcodonFrame
430 public static jalview.schemabinding.version2.AlcodonFrame unmarshal(
431 final java.io.Reader reader)
432 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
433 return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller.unmarshal(jalview.schemabinding.version2.AlcodonFrame.class, reader);
439 * @throws org.exolab.castor.xml.ValidationException if this
440 * object is an invalid instance according to the schema
442 public void validate(
444 throws org.exolab.castor.xml.ValidationException {
445 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
446 validator.validate(this);