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