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();
103 * @throws java.lang.IndexOutOfBoundsException if the index
104 * given is outside the bounds of the collection
106 public void addOtherData(
107 final jalview.schemabinding.version2.OtherData vOtherData)
108 throws java.lang.IndexOutOfBoundsException {
109 this._otherDataList.addElement(vOtherData);
117 * @throws java.lang.IndexOutOfBoundsException if the index
118 * given is outside the bounds of the collection
120 public void addOtherData(
122 final jalview.schemabinding.version2.OtherData vOtherData)
123 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
152 * jalview.schemabinding.version2.OtherData elements
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'.
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 if the index
204 * given is outside the bounds of the collection
205 * @return the value of the
206 * jalview.schemabinding.version2.OtherData at the given index
208 public jalview.schemabinding.version2.OtherData getOtherData(
210 throws java.lang.IndexOutOfBoundsException {
211 // check bounds for index
212 if (index < 0 || index >= this._otherDataList.size()) {
213 throw new IndexOutOfBoundsException("getOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]");
216 return (jalview.schemabinding.version2.OtherData) _otherDataList.get(index);
220 * Method getOtherData.Returns the contents of the collection
221 * in an Array. <p>Note: Just in case the collection contents
222 * are changing in another thread, we pass a 0-length Array of
223 * the correct type into the API call. This way we <i>know</i>
224 * that the Array returned is of exactly the correct length.
226 * @return this collection as an Array
228 public jalview.schemabinding.version2.OtherData[] getOtherData(
230 jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];
231 return (jalview.schemabinding.version2.OtherData[]) this._otherDataList.toArray(array);
235 * Method getOtherDataCount.
237 * @return the size of this collection
239 public int getOtherDataCount(
241 return this._otherDataList.size();
245 * Returns the value of field 'score'.
247 * @return the value of field 'Score'.
249 public float getScore(
255 * Returns the value of field 'status'.
257 * @return the value of field 'Status'.
259 public java.lang.String getStatus(
265 * Returns the value of field 'type'.
267 * @return the value of field 'Type'.
269 public java.lang.String getType(
277 * @return true if at least one Begin has been added
279 public boolean hasBegin(
281 return this._has_begin;
287 * @return true if at least one End has been added
289 public boolean hasEnd(
291 return this._has_end;
297 * @return true if at least one Score has been added
299 public boolean hasScore(
301 return this._has_score;
307 * @return true if this object is valid according to the schema
309 public boolean isValid(
313 } catch (org.exolab.castor.xml.ValidationException vex) {
323 * @throws org.exolab.castor.xml.MarshalException if object is
324 * null or if any SAXException is thrown during marshaling
325 * @throws org.exolab.castor.xml.ValidationException if this
326 * object is an invalid instance according to the schema
329 final java.io.Writer out)
330 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
331 Marshaller.marshal(this, out);
338 * @throws java.io.IOException if an IOException occurs during
340 * @throws org.exolab.castor.xml.ValidationException if this
341 * object is an invalid instance according to the schema
342 * @throws org.exolab.castor.xml.MarshalException if object is
343 * null or if any SAXException is thrown during marshaling
346 final org.xml.sax.ContentHandler handler)
347 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
348 Marshaller.marshal(this, handler);
353 public void removeAllOtherData(
355 this._otherDataList.clear();
359 * Method removeOtherData.
362 * @return true if the object was removed from the collection.
364 public boolean removeOtherData(
365 final jalview.schemabinding.version2.OtherData vOtherData) {
366 boolean removed = _otherDataList.remove(vOtherData);
371 * Method removeOtherDataAt.
374 * @return the element removed from the collection
376 public jalview.schemabinding.version2.OtherData removeOtherDataAt(
378 java.lang.Object obj = this._otherDataList.remove(index);
379 return (jalview.schemabinding.version2.OtherData) obj;
383 * Sets the value of field 'begin'.
385 * @param begin the value of field 'begin'.
387 public void setBegin(
390 this._has_begin = true;
394 * Sets the value of field 'description'.
396 * @param description the value of field 'description'.
398 public void setDescription(
399 final java.lang.String description) {
400 this._description = description;
404 * Sets the value of field 'end'.
406 * @param end the value of field 'end'.
411 this._has_end = true;
415 * Sets the value of field 'featureGroup'.
417 * @param featureGroup the value of field 'featureGroup'.
419 public void setFeatureGroup(
420 final java.lang.String featureGroup) {
421 this._featureGroup = featureGroup;
429 * @throws java.lang.IndexOutOfBoundsException if the index
430 * given is outside the bounds of the collection
432 public void setOtherData(
434 final jalview.schemabinding.version2.OtherData vOtherData)
435 throws java.lang.IndexOutOfBoundsException {
436 // check bounds for index
437 if (index < 0 || index >= this._otherDataList.size()) {
438 throw new IndexOutOfBoundsException("setOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]");
441 this._otherDataList.set(index, vOtherData);
447 * @param vOtherDataArray
449 public void setOtherData(
450 final jalview.schemabinding.version2.OtherData[] vOtherDataArray) {
452 _otherDataList.clear();
454 for (int i = 0; i < vOtherDataArray.length; i++) {
455 this._otherDataList.add(vOtherDataArray[i]);
460 * Sets the value of field 'score'.
462 * @param score the value of field 'score'.
464 public void setScore(
467 this._has_score = true;
471 * Sets the value of field 'status'.
473 * @param status the value of field 'status'.
475 public void setStatus(
476 final java.lang.String status) {
477 this._status = status;
481 * Sets the value of field 'type'.
483 * @param type the value of field 'type'.
486 final java.lang.String type) {
494 * @throws org.exolab.castor.xml.MarshalException if object is
495 * null or if any SAXException is thrown during marshaling
496 * @throws org.exolab.castor.xml.ValidationException if this
497 * object is an invalid instance according to the schema
498 * @return the unmarshaled jalview.schemabinding.version2.Featur
500 public static jalview.schemabinding.version2.Feature unmarshal(
501 final java.io.Reader reader)
502 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
503 return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(jalview.schemabinding.version2.Feature.class, reader);
509 * @throws org.exolab.castor.xml.ValidationException if this
510 * object is an invalid instance according to the schema
512 public void validate(
514 throws org.exolab.castor.xml.ValidationException {
515 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
516 validator.validate(this);