c1bbb25c3325e98e3c8e7ebfc8a67dc6f6174994
[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       //----------------/
86      //- Constructors -/
87     //----------------/
88
89     public Feature() {
90         super();
91         this._otherDataList = new java.util.Vector();
92     }
93
94
95       //-----------/
96      //- Methods -/
97     //-----------/
98
99     /**
100      * 
101      * 
102      * @param vOtherData
103      * @throws java.lang.IndexOutOfBoundsException if the index
104      * given is outside the bounds of the collection
105      */
106     public void addOtherData(
107             final jalview.schemabinding.version2.OtherData vOtherData)
108     throws java.lang.IndexOutOfBoundsException {
109         this._otherDataList.addElement(vOtherData);
110     }
111
112     /**
113      * 
114      * 
115      * @param index
116      * @param vOtherData
117      * @throws java.lang.IndexOutOfBoundsException if the index
118      * given is outside the bounds of the collection
119      */
120     public void addOtherData(
121             final int index,
122             final jalview.schemabinding.version2.OtherData vOtherData)
123     throws java.lang.IndexOutOfBoundsException {
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
152      * jalview.schemabinding.version2.OtherData 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 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
207      */
208     public jalview.schemabinding.version2.OtherData getOtherData(
209             final int index)
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) + "]");
214         }
215         
216         return (jalview.schemabinding.version2.OtherData) _otherDataList.get(index);
217     }
218
219     /**
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.
225      * 
226      * @return this collection as an Array
227      */
228     public jalview.schemabinding.version2.OtherData[] getOtherData(
229     ) {
230         jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0];
231         return (jalview.schemabinding.version2.OtherData[]) this._otherDataList.toArray(array);
232     }
233
234     /**
235      * Method getOtherDataCount.
236      * 
237      * @return the size of this collection
238      */
239     public int getOtherDataCount(
240     ) {
241         return this._otherDataList.size();
242     }
243
244     /**
245      * Returns the value of field 'score'.
246      * 
247      * @return the value of field 'Score'.
248      */
249     public float getScore(
250     ) {
251         return this._score;
252     }
253
254     /**
255      * Returns the value of field 'status'.
256      * 
257      * @return the value of field 'Status'.
258      */
259     public java.lang.String getStatus(
260     ) {
261         return this._status;
262     }
263
264     /**
265      * Returns the value of field 'type'.
266      * 
267      * @return the value of field 'Type'.
268      */
269     public java.lang.String getType(
270     ) {
271         return this._type;
272     }
273
274     /**
275      * Method hasBegin.
276      * 
277      * @return true if at least one Begin has been added
278      */
279     public boolean hasBegin(
280     ) {
281         return this._has_begin;
282     }
283
284     /**
285      * Method hasEnd.
286      * 
287      * @return true if at least one End has been added
288      */
289     public boolean hasEnd(
290     ) {
291         return this._has_end;
292     }
293
294     /**
295      * Method hasScore.
296      * 
297      * @return true if at least one Score has been added
298      */
299     public boolean hasScore(
300     ) {
301         return this._has_score;
302     }
303
304     /**
305      * Method isValid.
306      * 
307      * @return true if this object is valid according to the schema
308      */
309     public boolean isValid(
310     ) {
311         try {
312             validate();
313         } catch (org.exolab.castor.xml.ValidationException vex) {
314             return false;
315         }
316         return true;
317     }
318
319     /**
320      * 
321      * 
322      * @param out
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
327      */
328     public void marshal(
329             final java.io.Writer out)
330     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
331         Marshaller.marshal(this, out);
332     }
333
334     /**
335      * 
336      * 
337      * @param handler
338      * @throws java.io.IOException if an IOException occurs during
339      * marshaling
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
344      */
345     public void marshal(
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);
349     }
350
351     /**
352      */
353     public void removeAllOtherData(
354     ) {
355         this._otherDataList.clear();
356     }
357
358     /**
359      * Method removeOtherData.
360      * 
361      * @param vOtherData
362      * @return true if the object was removed from the collection.
363      */
364     public boolean removeOtherData(
365             final jalview.schemabinding.version2.OtherData vOtherData) {
366         boolean removed = _otherDataList.remove(vOtherData);
367         return removed;
368     }
369
370     /**
371      * Method removeOtherDataAt.
372      * 
373      * @param index
374      * @return the element removed from the collection
375      */
376     public jalview.schemabinding.version2.OtherData removeOtherDataAt(
377             final int index) {
378         java.lang.Object obj = this._otherDataList.remove(index);
379         return (jalview.schemabinding.version2.OtherData) obj;
380     }
381
382     /**
383      * Sets the value of field 'begin'.
384      * 
385      * @param begin the value of field 'begin'.
386      */
387     public void setBegin(
388             final int begin) {
389         this._begin = begin;
390         this._has_begin = true;
391     }
392
393     /**
394      * Sets the value of field 'description'.
395      * 
396      * @param description the value of field 'description'.
397      */
398     public void setDescription(
399             final java.lang.String description) {
400         this._description = description;
401     }
402
403     /**
404      * Sets the value of field 'end'.
405      * 
406      * @param end the value of field 'end'.
407      */
408     public void setEnd(
409             final int end) {
410         this._end = end;
411         this._has_end = true;
412     }
413
414     /**
415      * Sets the value of field 'featureGroup'.
416      * 
417      * @param featureGroup the value of field 'featureGroup'.
418      */
419     public void setFeatureGroup(
420             final java.lang.String featureGroup) {
421         this._featureGroup = featureGroup;
422     }
423
424     /**
425      * 
426      * 
427      * @param index
428      * @param vOtherData
429      * @throws java.lang.IndexOutOfBoundsException if the index
430      * given is outside the bounds of the collection
431      */
432     public void setOtherData(
433             final int index,
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) + "]");
439         }
440         
441         this._otherDataList.set(index, vOtherData);
442     }
443
444     /**
445      * 
446      * 
447      * @param vOtherDataArray
448      */
449     public void setOtherData(
450             final jalview.schemabinding.version2.OtherData[] vOtherDataArray) {
451         //-- copy array
452         _otherDataList.clear();
453         
454         for (int i = 0; i < vOtherDataArray.length; i++) {
455                 this._otherDataList.add(vOtherDataArray[i]);
456         }
457     }
458
459     /**
460      * Sets the value of field 'score'.
461      * 
462      * @param score the value of field 'score'.
463      */
464     public void setScore(
465             final float score) {
466         this._score = score;
467         this._has_score = true;
468     }
469
470     /**
471      * Sets the value of field 'status'.
472      * 
473      * @param status the value of field 'status'.
474      */
475     public void setStatus(
476             final java.lang.String status) {
477         this._status = status;
478     }
479
480     /**
481      * Sets the value of field 'type'.
482      * 
483      * @param type the value of field 'type'.
484      */
485     public void setType(
486             final java.lang.String type) {
487         this._type = type;
488     }
489
490     /**
491      * Method unmarshal.
492      * 
493      * @param reader
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
499      */
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);
504     }
505
506     /**
507      * 
508      * 
509      * @throws org.exolab.castor.xml.ValidationException if this
510      * object is an invalid instance according to the schema
511      */
512     public void validate(
513     )
514     throws org.exolab.castor.xml.ValidationException {
515         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
516         validator.validate(this);
517     }
518
519 }