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 Feature implements java.io.Serializable
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
55 * keeps track of state for field: _begin
57 private boolean _has_begin;
65 * keeps track of state for field: _end
67 private boolean _has_end;
72 private java.lang.String _type;
77 private java.lang.String _description;
82 private java.lang.String _status;
85 * Field _featureGroup.
87 private java.lang.String _featureGroup;
95 * keeps track of state for field: _score
97 private boolean _has_score;
100 * Field _otherDataList.
102 private java.util.Vector _otherDataList;
111 this._otherDataList = new java.util.Vector();
122 * @throws java.lang.IndexOutOfBoundsException
123 * if the index given is outside the bounds of the collection
125 public void addOtherData(
126 final jalview.schemabinding.version2.OtherData vOtherData)
127 throws java.lang.IndexOutOfBoundsException
129 this._otherDataList.addElement(vOtherData);
137 * @throws java.lang.IndexOutOfBoundsException
138 * if the index given is outside the bounds of the collection
140 public void addOtherData(final int index,
141 final jalview.schemabinding.version2.OtherData vOtherData)
142 throws java.lang.IndexOutOfBoundsException
144 this._otherDataList.add(index, vOtherData);
149 public void deleteBegin()
151 this._has_begin = false;
156 public void deleteEnd()
158 this._has_end = false;
163 public void deleteScore()
165 this._has_score = false;
169 * Method enumerateOtherData.
171 * @return an Enumeration over all jalview.schemabinding.version2.OtherData
174 public java.util.Enumeration enumerateOtherData()
176 return this._otherDataList.elements();
180 * Returns the value of field 'begin'.
182 * @return the value of field 'Begin'.
184 public int getBegin()
190 * Returns the value of field 'description'.
192 * @return the value of field 'Description'.
194 public java.lang.String getDescription()
196 return this._description;
200 * Returns the value of field 'end'.
202 * @return the value of field 'End'.
210 * Returns the value of field 'featureGroup'.
212 * @return the value of field 'FeatureGroup'.
214 public java.lang.String getFeatureGroup()
216 return this._featureGroup;
220 * Method getOtherData.
223 * @throws java.lang.IndexOutOfBoundsException
224 * if the index given is outside the bounds of the collection
225 * @return the value of the jalview.schemabinding.version2.OtherData at the
228 public jalview.schemabinding.version2.OtherData getOtherData(
229 final int index) throws java.lang.IndexOutOfBoundsException
231 // check bounds for index
232 if (index < 0 || index >= this._otherDataList.size())
234 throw new IndexOutOfBoundsException("getOtherData: Index value '"
235 + index + "' not in range [0.."
236 + (this._otherDataList.size() - 1) + "]");
239 return (jalview.schemabinding.version2.OtherData) _otherDataList
244 * Method getOtherData.Returns the contents of the collection in an Array.
246 * Note: Just in case the collection contents are changing in another thread,
247 * we pass a 0-length Array of the correct type into the API call. This way we
248 * <i>know</i> that the Array returned is of exactly the correct length.
250 * @return this collection as an Array
252 public jalview.schemabinding.version2.OtherData[] getOtherData()
254 jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];
255 return (jalview.schemabinding.version2.OtherData[]) this._otherDataList
260 * Method getOtherDataCount.
262 * @return the size of this collection
264 public int getOtherDataCount()
266 return this._otherDataList.size();
270 * Returns the value of field 'score'.
272 * @return the value of field 'Score'.
274 public float getScore()
280 * Returns the value of field 'status'.
282 * @return the value of field 'Status'.
284 public java.lang.String getStatus()
290 * Returns the value of field 'type'.
292 * @return the value of field 'Type'.
294 public java.lang.String getType()
302 * @return true if at least one Begin has been added
304 public boolean hasBegin()
306 return this._has_begin;
312 * @return true if at least one End has been added
314 public boolean hasEnd()
316 return this._has_end;
322 * @return true if at least one Score has been added
324 public boolean hasScore()
326 return this._has_score;
332 * @return true if this object is valid according to the schema
334 public boolean isValid()
339 } catch (org.exolab.castor.xml.ValidationException vex)
350 * @throws org.exolab.castor.xml.MarshalException
351 * if object is null or if any SAXException is thrown during
353 * @throws org.exolab.castor.xml.ValidationException
354 * if this object is an invalid instance according to the schema
356 public void marshal(final java.io.Writer out)
357 throws org.exolab.castor.xml.MarshalException,
358 org.exolab.castor.xml.ValidationException
360 Marshaller.marshal(this, out);
367 * @throws java.io.IOException
368 * if an IOException occurs during marshaling
369 * @throws org.exolab.castor.xml.ValidationException
370 * if this object is an invalid instance according to the schema
371 * @throws org.exolab.castor.xml.MarshalException
372 * if object is null or if any SAXException is thrown during
375 public void marshal(final org.xml.sax.ContentHandler handler)
376 throws java.io.IOException,
377 org.exolab.castor.xml.MarshalException,
378 org.exolab.castor.xml.ValidationException
380 Marshaller.marshal(this, handler);
385 public void removeAllOtherData()
387 this._otherDataList.clear();
391 * Method removeOtherData.
394 * @return true if the object was removed from the collection.
396 public boolean removeOtherData(
397 final jalview.schemabinding.version2.OtherData vOtherData)
399 boolean removed = _otherDataList.remove(vOtherData);
404 * Method removeOtherDataAt.
407 * @return the element removed from the collection
409 public jalview.schemabinding.version2.OtherData removeOtherDataAt(
412 java.lang.Object obj = this._otherDataList.remove(index);
413 return (jalview.schemabinding.version2.OtherData) obj;
417 * Sets the value of field 'begin'.
420 * the value of field 'begin'.
422 public void setBegin(final int begin)
425 this._has_begin = true;
429 * Sets the value of field 'description'.
432 * the value of field 'description'.
434 public void setDescription(final java.lang.String description)
436 this._description = description;
440 * Sets the value of field 'end'.
443 * the value of field 'end'.
445 public void setEnd(final int end)
448 this._has_end = true;
452 * Sets the value of field 'featureGroup'.
454 * @param featureGroup
455 * the value of field 'featureGroup'.
457 public void setFeatureGroup(final java.lang.String featureGroup)
459 this._featureGroup = featureGroup;
467 * @throws java.lang.IndexOutOfBoundsException
468 * if the index given is outside the bounds of the collection
470 public void setOtherData(final int index,
471 final jalview.schemabinding.version2.OtherData vOtherData)
472 throws java.lang.IndexOutOfBoundsException
474 // check bounds for index
475 if (index < 0 || index >= this._otherDataList.size())
477 throw new IndexOutOfBoundsException("setOtherData: Index value '"
478 + index + "' not in range [0.."
479 + (this._otherDataList.size() - 1) + "]");
482 this._otherDataList.set(index, vOtherData);
488 * @param vOtherDataArray
490 public void setOtherData(
491 final jalview.schemabinding.version2.OtherData[] vOtherDataArray)
494 _otherDataList.clear();
496 for (int i = 0; i < vOtherDataArray.length; i++)
498 this._otherDataList.add(vOtherDataArray[i]);
503 * Sets the value of field 'score'.
506 * the value of field 'score'.
508 public void setScore(final float score)
511 this._has_score = true;
515 * Sets the value of field 'status'.
518 * the value of field 'status'.
520 public void setStatus(final java.lang.String status)
522 this._status = status;
526 * Sets the value of field 'type'.
529 * the value of field 'type'.
531 public void setType(final java.lang.String type)
540 * @throws org.exolab.castor.xml.MarshalException
541 * if object is null or if any SAXException is thrown during
543 * @throws org.exolab.castor.xml.ValidationException
544 * if this object is an invalid instance according to the schema
545 * @return the unmarshaled jalview.schemabinding.version2.Featur
547 public static jalview.schemabinding.version2.Feature unmarshal(
548 final java.io.Reader reader)
549 throws org.exolab.castor.xml.MarshalException,
550 org.exolab.castor.xml.ValidationException
552 return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(
553 jalview.schemabinding.version2.Feature.class, reader);
559 * @throws org.exolab.castor.xml.ValidationException
560 * if this object is an invalid instance according to the schema
562 public void validate() throws org.exolab.castor.xml.ValidationException
564 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
565 validator.validate(this);