109ec6e49102a5e0c7edf36a375fa1af07d41e5c
[jalview.git] / src / jalview / schemabinding / version2 / Feature.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.schemabinding.version2;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class Feature.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Feature implements java.io.Serializable {\r
23 \r
24 \r
25       //--------------------------/\r
26      //- Class/Member Variables -/\r
27     //--------------------------/\r
28 \r
29     /**\r
30      * Field _begin.\r
31      */\r
32     private int _begin;\r
33 \r
34     /**\r
35      * keeps track of state for field: _begin\r
36      */\r
37     private boolean _has_begin;\r
38 \r
39     /**\r
40      * Field _end.\r
41      */\r
42     private int _end;\r
43 \r
44     /**\r
45      * keeps track of state for field: _end\r
46      */\r
47     private boolean _has_end;\r
48 \r
49     /**\r
50      * Field _type.\r
51      */\r
52     private java.lang.String _type;\r
53 \r
54     /**\r
55      * Field _description.\r
56      */\r
57     private java.lang.String _description;\r
58 \r
59     /**\r
60      * Field _status.\r
61      */\r
62     private java.lang.String _status;\r
63 \r
64     /**\r
65      * Field _featureGroup.\r
66      */\r
67     private java.lang.String _featureGroup;\r
68 \r
69     /**\r
70      * Field _score.\r
71      */\r
72     private float _score;\r
73 \r
74     /**\r
75      * keeps track of state for field: _score\r
76      */\r
77     private boolean _has_score;\r
78 \r
79     /**\r
80      * Field _otherDataList.\r
81      */\r
82     private java.util.Vector _otherDataList;\r
83 \r
84 \r
85       //----------------/\r
86      //- Constructors -/\r
87     //----------------/\r
88 \r
89     public Feature() {\r
90         super();\r
91         this._otherDataList = new java.util.Vector();\r
92     }\r
93 \r
94 \r
95       //-----------/\r
96      //- Methods -/\r
97     //-----------/\r
98 \r
99     /**\r
100      * \r
101      * \r
102      * @param vOtherData\r
103      * @throws java.lang.IndexOutOfBoundsException if the index\r
104      * given is outside the bounds of the collection\r
105      */\r
106     public void addOtherData(\r
107             final jalview.schemabinding.version2.OtherData vOtherData)\r
108     throws java.lang.IndexOutOfBoundsException {\r
109         this._otherDataList.addElement(vOtherData);\r
110     }\r
111 \r
112     /**\r
113      * \r
114      * \r
115      * @param index\r
116      * @param vOtherData\r
117      * @throws java.lang.IndexOutOfBoundsException if the index\r
118      * given is outside the bounds of the collection\r
119      */\r
120     public void addOtherData(\r
121             final int index,\r
122             final jalview.schemabinding.version2.OtherData vOtherData)\r
123     throws java.lang.IndexOutOfBoundsException {\r
124         this._otherDataList.add(index, vOtherData);\r
125     }\r
126 \r
127     /**\r
128      */\r
129     public void deleteBegin(\r
130     ) {\r
131         this._has_begin= false;\r
132     }\r
133 \r
134     /**\r
135      */\r
136     public void deleteEnd(\r
137     ) {\r
138         this._has_end= false;\r
139     }\r
140 \r
141     /**\r
142      */\r
143     public void deleteScore(\r
144     ) {\r
145         this._has_score= false;\r
146     }\r
147 \r
148     /**\r
149      * Method enumerateOtherData.\r
150      * \r
151      * @return an Enumeration over all\r
152      * jalview.schemabinding.version2.OtherData elements\r
153      */\r
154     public java.util.Enumeration enumerateOtherData(\r
155     ) {\r
156         return this._otherDataList.elements();\r
157     }\r
158 \r
159     /**\r
160      * Returns the value of field 'begin'.\r
161      * \r
162      * @return the value of field 'Begin'.\r
163      */\r
164     public int getBegin(\r
165     ) {\r
166         return this._begin;\r
167     }\r
168 \r
169     /**\r
170      * Returns the value of field 'description'.\r
171      * \r
172      * @return the value of field 'Description'.\r
173      */\r
174     public java.lang.String getDescription(\r
175     ) {\r
176         return this._description;\r
177     }\r
178 \r
179     /**\r
180      * Returns the value of field 'end'.\r
181      * \r
182      * @return the value of field 'End'.\r
183      */\r
184     public int getEnd(\r
185     ) {\r
186         return this._end;\r
187     }\r
188 \r
189     /**\r
190      * Returns the value of field 'featureGroup'.\r
191      * \r
192      * @return the value of field 'FeatureGroup'.\r
193      */\r
194     public java.lang.String getFeatureGroup(\r
195     ) {\r
196         return this._featureGroup;\r
197     }\r
198 \r
199     /**\r
200      * Method getOtherData.\r
201      * \r
202      * @param index\r
203      * @throws java.lang.IndexOutOfBoundsException if the index\r
204      * given is outside the bounds of the collection\r
205      * @return the value of the\r
206      * jalview.schemabinding.version2.OtherData at the given index\r
207      */\r
208     public jalview.schemabinding.version2.OtherData getOtherData(\r
209             final int index)\r
210     throws java.lang.IndexOutOfBoundsException {\r
211         // check bounds for index\r
212         if (index < 0 || index >= this._otherDataList.size()) {\r
213             throw new IndexOutOfBoundsException("getOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]");\r
214         }\r
215         \r
216         return (jalview.schemabinding.version2.OtherData) _otherDataList.get(index);\r
217     }\r
218 \r
219     /**\r
220      * Method getOtherData.Returns the contents of the collection\r
221      * in an Array.  <p>Note:  Just in case the collection contents\r
222      * are changing in another thread, we pass a 0-length Array of\r
223      * the correct type into the API call.  This way we <i>know</i>\r
224      * that the Array returned is of exactly the correct length.\r
225      * \r
226      * @return this collection as an Array\r
227      */\r
228     public jalview.schemabinding.version2.OtherData[] getOtherData(\r
229     ) {\r
230         jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];\r
231         return (jalview.schemabinding.version2.OtherData[]) this._otherDataList.toArray(array);\r
232     }\r
233 \r
234     /**\r
235      * Method getOtherDataCount.\r
236      * \r
237      * @return the size of this collection\r
238      */\r
239     public int getOtherDataCount(\r
240     ) {\r
241         return this._otherDataList.size();\r
242     }\r
243 \r
244     /**\r
245      * Returns the value of field 'score'.\r
246      * \r
247      * @return the value of field 'Score'.\r
248      */\r
249     public float getScore(\r
250     ) {\r
251         return this._score;\r
252     }\r
253 \r
254     /**\r
255      * Returns the value of field 'status'.\r
256      * \r
257      * @return the value of field 'Status'.\r
258      */\r
259     public java.lang.String getStatus(\r
260     ) {\r
261         return this._status;\r
262     }\r
263 \r
264     /**\r
265      * Returns the value of field 'type'.\r
266      * \r
267      * @return the value of field 'Type'.\r
268      */\r
269     public java.lang.String getType(\r
270     ) {\r
271         return this._type;\r
272     }\r
273 \r
274     /**\r
275      * Method hasBegin.\r
276      * \r
277      * @return true if at least one Begin has been added\r
278      */\r
279     public boolean hasBegin(\r
280     ) {\r
281         return this._has_begin;\r
282     }\r
283 \r
284     /**\r
285      * Method hasEnd.\r
286      * \r
287      * @return true if at least one End has been added\r
288      */\r
289     public boolean hasEnd(\r
290     ) {\r
291         return this._has_end;\r
292     }\r
293 \r
294     /**\r
295      * Method hasScore.\r
296      * \r
297      * @return true if at least one Score has been added\r
298      */\r
299     public boolean hasScore(\r
300     ) {\r
301         return this._has_score;\r
302     }\r
303 \r
304     /**\r
305      * Method isValid.\r
306      * \r
307      * @return true if this object is valid according to the schema\r
308      */\r
309     public boolean isValid(\r
310     ) {\r
311         try {\r
312             validate();\r
313         } catch (org.exolab.castor.xml.ValidationException vex) {\r
314             return false;\r
315         }\r
316         return true;\r
317     }\r
318 \r
319     /**\r
320      * \r
321      * \r
322      * @param out\r
323      * @throws org.exolab.castor.xml.MarshalException if object is\r
324      * null or if any SAXException is thrown during marshaling\r
325      * @throws org.exolab.castor.xml.ValidationException if this\r
326      * object is an invalid instance according to the schema\r
327      */\r
328     public void marshal(\r
329             final java.io.Writer out)\r
330     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
331         Marshaller.marshal(this, out);\r
332     }\r
333 \r
334     /**\r
335      * \r
336      * \r
337      * @param handler\r
338      * @throws java.io.IOException if an IOException occurs during\r
339      * marshaling\r
340      * @throws org.exolab.castor.xml.ValidationException if this\r
341      * object is an invalid instance according to the schema\r
342      * @throws org.exolab.castor.xml.MarshalException if object is\r
343      * null or if any SAXException is thrown during marshaling\r
344      */\r
345     public void marshal(\r
346             final org.xml.sax.ContentHandler handler)\r
347     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
348         Marshaller.marshal(this, handler);\r
349     }\r
350 \r
351     /**\r
352      */\r
353     public void removeAllOtherData(\r
354     ) {\r
355         this._otherDataList.clear();\r
356     }\r
357 \r
358     /**\r
359      * Method removeOtherData.\r
360      * \r
361      * @param vOtherData\r
362      * @return true if the object was removed from the collection.\r
363      */\r
364     public boolean removeOtherData(\r
365             final jalview.schemabinding.version2.OtherData vOtherData) {\r
366         boolean removed = _otherDataList.remove(vOtherData);\r
367         return removed;\r
368     }\r
369 \r
370     /**\r
371      * Method removeOtherDataAt.\r
372      * \r
373      * @param index\r
374      * @return the element removed from the collection\r
375      */\r
376     public jalview.schemabinding.version2.OtherData removeOtherDataAt(\r
377             final int index) {\r
378         java.lang.Object obj = this._otherDataList.remove(index);\r
379         return (jalview.schemabinding.version2.OtherData) obj;\r
380     }\r
381 \r
382     /**\r
383      * Sets the value of field 'begin'.\r
384      * \r
385      * @param begin the value of field 'begin'.\r
386      */\r
387     public void setBegin(\r
388             final int begin) {\r
389         this._begin = begin;\r
390         this._has_begin = true;\r
391     }\r
392 \r
393     /**\r
394      * Sets the value of field 'description'.\r
395      * \r
396      * @param description the value of field 'description'.\r
397      */\r
398     public void setDescription(\r
399             final java.lang.String description) {\r
400         this._description = description;\r
401     }\r
402 \r
403     /**\r
404      * Sets the value of field 'end'.\r
405      * \r
406      * @param end the value of field 'end'.\r
407      */\r
408     public void setEnd(\r
409             final int end) {\r
410         this._end = end;\r
411         this._has_end = true;\r
412     }\r
413 \r
414     /**\r
415      * Sets the value of field 'featureGroup'.\r
416      * \r
417      * @param featureGroup the value of field 'featureGroup'.\r
418      */\r
419     public void setFeatureGroup(\r
420             final java.lang.String featureGroup) {\r
421         this._featureGroup = featureGroup;\r
422     }\r
423 \r
424     /**\r
425      * \r
426      * \r
427      * @param index\r
428      * @param vOtherData\r
429      * @throws java.lang.IndexOutOfBoundsException if the index\r
430      * given is outside the bounds of the collection\r
431      */\r
432     public void setOtherData(\r
433             final int index,\r
434             final jalview.schemabinding.version2.OtherData vOtherData)\r
435     throws java.lang.IndexOutOfBoundsException {\r
436         // check bounds for index\r
437         if (index < 0 || index >= this._otherDataList.size()) {\r
438             throw new IndexOutOfBoundsException("setOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]");\r
439         }\r
440         \r
441         this._otherDataList.set(index, vOtherData);\r
442     }\r
443 \r
444     /**\r
445      * \r
446      * \r
447      * @param vOtherDataArray\r
448      */\r
449     public void setOtherData(\r
450             final jalview.schemabinding.version2.OtherData[] vOtherDataArray) {\r
451         //-- copy array\r
452         _otherDataList.clear();\r
453         \r
454         for (int i = 0; i < vOtherDataArray.length; i++) {\r
455                 this._otherDataList.add(vOtherDataArray[i]);\r
456         }\r
457     }\r
458 \r
459     /**\r
460      * Sets the value of field 'score'.\r
461      * \r
462      * @param score the value of field 'score'.\r
463      */\r
464     public void setScore(\r
465             final float score) {\r
466         this._score = score;\r
467         this._has_score = true;\r
468     }\r
469 \r
470     /**\r
471      * Sets the value of field 'status'.\r
472      * \r
473      * @param status the value of field 'status'.\r
474      */\r
475     public void setStatus(\r
476             final java.lang.String status) {\r
477         this._status = status;\r
478     }\r
479 \r
480     /**\r
481      * Sets the value of field 'type'.\r
482      * \r
483      * @param type the value of field 'type'.\r
484      */\r
485     public void setType(\r
486             final java.lang.String type) {\r
487         this._type = type;\r
488     }\r
489 \r
490     /**\r
491      * Method unmarshal.\r
492      * \r
493      * @param reader\r
494      * @throws org.exolab.castor.xml.MarshalException if object is\r
495      * null or if any SAXException is thrown during marshaling\r
496      * @throws org.exolab.castor.xml.ValidationException if this\r
497      * object is an invalid instance according to the schema\r
498      * @return the unmarshaled jalview.schemabinding.version2.Featur\r
499      */\r
500     public static jalview.schemabinding.version2.Feature unmarshal(\r
501             final java.io.Reader reader)\r
502     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
503         return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(jalview.schemabinding.version2.Feature.class, reader);\r
504     }\r
505 \r
506     /**\r
507      * \r
508      * \r
509      * @throws org.exolab.castor.xml.ValidationException if this\r
510      * object is an invalid instance according to the schema\r
511      */\r
512     public void validate(\r
513     )\r
514     throws org.exolab.castor.xml.ValidationException {\r
515         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
516         validator.validate(this);\r
517     }\r
518 \r
519 }\r