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