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 Feature implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
54 * keeps track of state for field: _begin
56 private boolean _has_begin;
64 * keeps track of state for field: _end
66 private boolean _has_end;
71 private java.lang.String _type;
76 private java.lang.String _description;
81 private java.lang.String _status;
84 * Field _featureGroup.
86 private java.lang.String _featureGroup;
94 * keeps track of state for field: _score
96 private boolean _has_score;
99 * Field _otherDataList.
101 private java.util.Vector _otherDataList;
110 this._otherDataList = new java.util.Vector();
121 * @throws java.lang.IndexOutOfBoundsException
122 * if the index given is outside the bounds of the collection
124 public void addOtherData(
125 final jalview.schemabinding.version2.OtherData vOtherData)
126 throws java.lang.IndexOutOfBoundsException
128 this._otherDataList.addElement(vOtherData);
136 * @throws java.lang.IndexOutOfBoundsException
137 * if the index given is outside the bounds of the collection
139 public void addOtherData(final int index,
140 final jalview.schemabinding.version2.OtherData vOtherData)
141 throws java.lang.IndexOutOfBoundsException
143 this._otherDataList.add(index, vOtherData);
148 public void deleteBegin()
150 this._has_begin = false;
155 public void deleteEnd()
157 this._has_end = false;
162 public void deleteScore()
164 this._has_score = false;
168 * Method enumerateOtherData.
170 * @return an Enumeration over all jalview.schemabinding.version2.OtherData
173 public java.util.Enumeration enumerateOtherData()
175 return this._otherDataList.elements();
179 * Returns the value of field 'begin'.
181 * @return the value of field 'Begin'.
183 public int getBegin()
189 * Returns the value of field 'description'.
191 * @return the value of field 'Description'.
193 public java.lang.String getDescription()
195 return this._description;
199 * Returns the value of field 'end'.
201 * @return the value of field 'End'.
209 * Returns the value of field 'featureGroup'.
211 * @return the value of field 'FeatureGroup'.
213 public java.lang.String getFeatureGroup()
215 return this._featureGroup;
219 * Method getOtherData.
222 * @throws java.lang.IndexOutOfBoundsException
223 * if the index given is outside the bounds of the collection
224 * @return the value of the jalview.schemabinding.version2.OtherData at the
227 public jalview.schemabinding.version2.OtherData getOtherData(
228 final int index) throws java.lang.IndexOutOfBoundsException
230 // check bounds for index
231 if (index < 0 || index >= this._otherDataList.size())
233 throw new IndexOutOfBoundsException("getOtherData: Index value '"
234 + index + "' not in range [0.."
235 + (this._otherDataList.size() - 1) + "]");
238 return (jalview.schemabinding.version2.OtherData) _otherDataList
243 * Method getOtherData.Returns the contents of the collection in an Array.
245 * Note: Just in case the collection contents are changing in another thread,
246 * we pass a 0-length Array of the correct type into the API call. This way we
247 * <i>know</i> that the Array returned is of exactly the correct length.
249 * @return this collection as an Array
251 public jalview.schemabinding.version2.OtherData[] getOtherData()
253 jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];
254 return (jalview.schemabinding.version2.OtherData[]) this._otherDataList
259 * Method getOtherDataCount.
261 * @return the size of this collection
263 public int getOtherDataCount()
265 return this._otherDataList.size();
269 * Returns the value of field 'score'.
271 * @return the value of field 'Score'.
273 public float getScore()
279 * Returns the value of field 'status'.
281 * @return the value of field 'Status'.
283 public java.lang.String getStatus()
289 * Returns the value of field 'type'.
291 * @return the value of field 'Type'.
293 public java.lang.String getType()
301 * @return true if at least one Begin has been added
303 public boolean hasBegin()
305 return this._has_begin;
311 * @return true if at least one End has been added
313 public boolean hasEnd()
315 return this._has_end;
321 * @return true if at least one Score has been added
323 public boolean hasScore()
325 return this._has_score;
331 * @return true if this object is valid according to the schema
333 public boolean isValid()
338 } catch (org.exolab.castor.xml.ValidationException vex)
349 * @throws org.exolab.castor.xml.MarshalException
350 * if object is null or if any SAXException is thrown during
352 * @throws org.exolab.castor.xml.ValidationException
353 * if this object is an invalid instance according to the schema
355 public void marshal(final java.io.Writer out)
356 throws org.exolab.castor.xml.MarshalException,
357 org.exolab.castor.xml.ValidationException
359 Marshaller.marshal(this, out);
366 * @throws java.io.IOException
367 * if an IOException occurs during marshaling
368 * @throws org.exolab.castor.xml.ValidationException
369 * if this object is an invalid instance according to the schema
370 * @throws org.exolab.castor.xml.MarshalException
371 * if object is null or if any SAXException is thrown during
374 public void marshal(final org.xml.sax.ContentHandler handler)
375 throws java.io.IOException,
376 org.exolab.castor.xml.MarshalException,
377 org.exolab.castor.xml.ValidationException
379 Marshaller.marshal(this, handler);
384 public void removeAllOtherData()
386 this._otherDataList.clear();
390 * Method removeOtherData.
393 * @return true if the object was removed from the collection.
395 public boolean removeOtherData(
396 final jalview.schemabinding.version2.OtherData vOtherData)
398 boolean removed = _otherDataList.remove(vOtherData);
403 * Method removeOtherDataAt.
406 * @return the element removed from the collection
408 public jalview.schemabinding.version2.OtherData removeOtherDataAt(
411 java.lang.Object obj = this._otherDataList.remove(index);
412 return (jalview.schemabinding.version2.OtherData) obj;
416 * Sets the value of field 'begin'.
419 * the value of field 'begin'.
421 public void setBegin(final int begin)
424 this._has_begin = true;
428 * Sets the value of field 'description'.
431 * the value of field 'description'.
433 public void setDescription(final java.lang.String description)
435 this._description = description;
439 * Sets the value of field 'end'.
442 * the value of field 'end'.
444 public void setEnd(final int end)
447 this._has_end = true;
451 * Sets the value of field 'featureGroup'.
453 * @param featureGroup
454 * the value of field 'featureGroup'.
456 public void setFeatureGroup(final java.lang.String featureGroup)
458 this._featureGroup = featureGroup;
466 * @throws java.lang.IndexOutOfBoundsException
467 * if the index given is outside the bounds of the collection
469 public void setOtherData(final int index,
470 final jalview.schemabinding.version2.OtherData vOtherData)
471 throws java.lang.IndexOutOfBoundsException
473 // check bounds for index
474 if (index < 0 || index >= this._otherDataList.size())
476 throw new IndexOutOfBoundsException("setOtherData: Index value '"
477 + index + "' not in range [0.."
478 + (this._otherDataList.size() - 1) + "]");
481 this._otherDataList.set(index, vOtherData);
487 * @param vOtherDataArray
489 public void setOtherData(
490 final jalview.schemabinding.version2.OtherData[] vOtherDataArray)
493 _otherDataList.clear();
495 for (int i = 0; i < vOtherDataArray.length; i++)
497 this._otherDataList.add(vOtherDataArray[i]);
502 * Sets the value of field 'score'.
505 * the value of field 'score'.
507 public void setScore(final float score)
510 this._has_score = true;
514 * Sets the value of field 'status'.
517 * the value of field 'status'.
519 public void setStatus(final java.lang.String status)
521 this._status = status;
525 * Sets the value of field 'type'.
528 * the value of field 'type'.
530 public void setType(final java.lang.String type)
539 * @throws org.exolab.castor.xml.MarshalException
540 * if object is null or if any SAXException is thrown during
542 * @throws org.exolab.castor.xml.ValidationException
543 * if this object is an invalid instance according to the schema
544 * @return the unmarshaled jalview.schemabinding.version2.Featur
546 public static jalview.schemabinding.version2.Feature unmarshal(
547 final java.io.Reader reader)
548 throws org.exolab.castor.xml.MarshalException,
549 org.exolab.castor.xml.ValidationException
551 return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(
552 jalview.schemabinding.version2.Feature.class, reader);
558 * @throws org.exolab.castor.xml.ValidationException
559 * if this object is an invalid instance according to the schema
561 public void validate() throws org.exolab.castor.xml.ValidationException
563 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
564 validator.validate(this);