2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Feature implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
35 * keeps track of state for field: _begin
37 private boolean _has_begin;
45 * keeps track of state for field: _end
47 private boolean _has_end;
52 private java.lang.String _type;
57 private java.lang.String _description;
62 private java.lang.String _status;
65 * Field _featureGroup.
67 private java.lang.String _featureGroup;
75 * keeps track of state for field: _score
77 private boolean _has_score;
80 * Field _otherDataList.
82 private java.util.Vector _otherDataList;
91 this._otherDataList = new java.util.Vector();
102 * @throws java.lang.IndexOutOfBoundsException
103 * if the index given is outside the bounds of the collection
105 public void addOtherData(
106 final jalview.schemabinding.version2.OtherData vOtherData)
107 throws java.lang.IndexOutOfBoundsException
109 this._otherDataList.addElement(vOtherData);
117 * @throws java.lang.IndexOutOfBoundsException
118 * if the index given is outside the bounds of the collection
120 public void addOtherData(final int index,
121 final jalview.schemabinding.version2.OtherData vOtherData)
122 throws java.lang.IndexOutOfBoundsException
124 this._otherDataList.add(index, vOtherData);
129 public void deleteBegin()
131 this._has_begin = false;
136 public void deleteEnd()
138 this._has_end = false;
143 public void deleteScore()
145 this._has_score = false;
149 * Method enumerateOtherData.
151 * @return an Enumeration over all jalview.schemabinding.version2.OtherData
154 public java.util.Enumeration enumerateOtherData()
156 return this._otherDataList.elements();
160 * Returns the value of field 'begin'.
162 * @return the value of field 'Begin'.
164 public int getBegin()
170 * Returns the value of field 'description'.
172 * @return the value of field 'Description'.
174 public java.lang.String getDescription()
176 return this._description;
180 * Returns the value of field 'end'.
182 * @return the value of field 'End'.
190 * Returns the value of field 'featureGroup'.
192 * @return the value of field 'FeatureGroup'.
194 public java.lang.String getFeatureGroup()
196 return this._featureGroup;
200 * Method getOtherData.
203 * @throws java.lang.IndexOutOfBoundsException
204 * if the index given is outside the bounds of the collection
205 * @return the value of the jalview.schemabinding.version2.OtherData at the
208 public jalview.schemabinding.version2.OtherData getOtherData(
209 final int index) throws java.lang.IndexOutOfBoundsException
211 // check bounds for index
212 if (index < 0 || index >= this._otherDataList.size())
214 throw new IndexOutOfBoundsException("getOtherData: Index value '"
215 + index + "' not in range [0.."
216 + (this._otherDataList.size() - 1) + "]");
219 return (jalview.schemabinding.version2.OtherData) _otherDataList
224 * Method getOtherData.Returns the contents of the collection in an Array.
226 * Note: Just in case the collection contents are changing in another thread,
227 * we pass a 0-length Array of the correct type into the API call. This way we
228 * <i>know</i> that the Array returned is of exactly the correct length.
230 * @return this collection as an Array
232 public jalview.schemabinding.version2.OtherData[] getOtherData()
234 jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];
235 return (jalview.schemabinding.version2.OtherData[]) this._otherDataList
240 * Method getOtherDataCount.
242 * @return the size of this collection
244 public int getOtherDataCount()
246 return this._otherDataList.size();
250 * Returns the value of field 'score'.
252 * @return the value of field 'Score'.
254 public float getScore()
260 * Returns the value of field 'status'.
262 * @return the value of field 'Status'.
264 public java.lang.String getStatus()
270 * Returns the value of field 'type'.
272 * @return the value of field 'Type'.
274 public java.lang.String getType()
282 * @return true if at least one Begin has been added
284 public boolean hasBegin()
286 return this._has_begin;
292 * @return true if at least one End has been added
294 public boolean hasEnd()
296 return this._has_end;
302 * @return true if at least one Score has been added
304 public boolean hasScore()
306 return this._has_score;
312 * @return true if this object is valid according to the schema
314 public boolean isValid()
319 } catch (org.exolab.castor.xml.ValidationException vex)
330 * @throws org.exolab.castor.xml.MarshalException
331 * if object is null or if any SAXException is thrown during
333 * @throws org.exolab.castor.xml.ValidationException
334 * if this object is an invalid instance according to the schema
336 public void marshal(final java.io.Writer out)
337 throws org.exolab.castor.xml.MarshalException,
338 org.exolab.castor.xml.ValidationException
340 Marshaller.marshal(this, out);
347 * @throws java.io.IOException
348 * if an IOException occurs during marshaling
349 * @throws org.exolab.castor.xml.ValidationException
350 * if this object is an invalid instance according to the schema
351 * @throws org.exolab.castor.xml.MarshalException
352 * if object is null or if any SAXException is thrown during
355 public void marshal(final org.xml.sax.ContentHandler handler)
356 throws java.io.IOException,
357 org.exolab.castor.xml.MarshalException,
358 org.exolab.castor.xml.ValidationException
360 Marshaller.marshal(this, handler);
365 public void removeAllOtherData()
367 this._otherDataList.clear();
371 * Method removeOtherData.
374 * @return true if the object was removed from the collection.
376 public boolean removeOtherData(
377 final jalview.schemabinding.version2.OtherData vOtherData)
379 boolean removed = _otherDataList.remove(vOtherData);
384 * Method removeOtherDataAt.
387 * @return the element removed from the collection
389 public jalview.schemabinding.version2.OtherData removeOtherDataAt(
392 java.lang.Object obj = this._otherDataList.remove(index);
393 return (jalview.schemabinding.version2.OtherData) obj;
397 * Sets the value of field 'begin'.
400 * the value of field 'begin'.
402 public void setBegin(final int begin)
405 this._has_begin = true;
409 * Sets the value of field 'description'.
412 * the value of field 'description'.
414 public void setDescription(final java.lang.String description)
416 this._description = description;
420 * Sets the value of field 'end'.
423 * the value of field 'end'.
425 public void setEnd(final int end)
428 this._has_end = true;
432 * Sets the value of field 'featureGroup'.
434 * @param featureGroup
435 * the value of field 'featureGroup'.
437 public void setFeatureGroup(final java.lang.String featureGroup)
439 this._featureGroup = featureGroup;
447 * @throws java.lang.IndexOutOfBoundsException
448 * if the index given is outside the bounds of the collection
450 public void setOtherData(final int index,
451 final jalview.schemabinding.version2.OtherData vOtherData)
452 throws java.lang.IndexOutOfBoundsException
454 // check bounds for index
455 if (index < 0 || index >= this._otherDataList.size())
457 throw new IndexOutOfBoundsException("setOtherData: Index value '"
458 + index + "' not in range [0.."
459 + (this._otherDataList.size() - 1) + "]");
462 this._otherDataList.set(index, vOtherData);
468 * @param vOtherDataArray
470 public void setOtherData(
471 final jalview.schemabinding.version2.OtherData[] vOtherDataArray)
474 _otherDataList.clear();
476 for (int i = 0; i < vOtherDataArray.length; i++)
478 this._otherDataList.add(vOtherDataArray[i]);
483 * Sets the value of field 'score'.
486 * the value of field 'score'.
488 public void setScore(final float score)
491 this._has_score = true;
495 * Sets the value of field 'status'.
498 * the value of field 'status'.
500 public void setStatus(final java.lang.String status)
502 this._status = status;
506 * Sets the value of field 'type'.
509 * the value of field 'type'.
511 public void setType(final java.lang.String type)
520 * @throws org.exolab.castor.xml.MarshalException
521 * if object is null or if any SAXException is thrown during
523 * @throws org.exolab.castor.xml.ValidationException
524 * if this object is an invalid instance according to the schema
525 * @return the unmarshaled jalview.schemabinding.version2.Featur
527 public static jalview.schemabinding.version2.Feature unmarshal(
528 final java.io.Reader reader)
529 throws org.exolab.castor.xml.MarshalException,
530 org.exolab.castor.xml.ValidationException
532 return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(
533 jalview.schemabinding.version2.Feature.class, reader);
539 * @throws org.exolab.castor.xml.ValidationException
540 * if this object is an invalid instance according to the schema
542 public void validate() throws org.exolab.castor.xml.ValidationException
544 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
545 validator.validate(this);