AlignmentAnnotation: added annotation score attribute and allowed for annotation...
[jalview.git] / src / jalview / schemabinding / version2 / Annotation.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.6</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 java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import java.util.Enumeration;\r
19 import java.util.Vector;\r
20 import org.exolab.castor.xml.MarshalException;\r
21 import org.exolab.castor.xml.Marshaller;\r
22 import org.exolab.castor.xml.Unmarshaller;\r
23 import org.exolab.castor.xml.ValidationException;\r
24 import org.xml.sax.ContentHandler;\r
25 \r
26 /**\r
27  * Class Annotation.\r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class Annotation implements java.io.Serializable {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Field _graph\r
40      */\r
41     private boolean _graph;\r
42 \r
43     /**\r
44      * keeps track of state for field: _graph\r
45      */\r
46     private boolean _has_graph;\r
47 \r
48     /**\r
49      * Field _graphType\r
50      */\r
51     private int _graphType;\r
52 \r
53     /**\r
54      * keeps track of state for field: _graphType\r
55      */\r
56     private boolean _has_graphType;\r
57 \r
58     /**\r
59      * Field _sequenceRef\r
60      */\r
61     private java.lang.String _sequenceRef;\r
62 \r
63     /**\r
64      * Field _graphColour\r
65      */\r
66     private int _graphColour;\r
67 \r
68     /**\r
69      * keeps track of state for field: _graphColour\r
70      */\r
71     private boolean _has_graphColour;\r
72 \r
73     /**\r
74      * Field _graphGroup\r
75      */\r
76     private int _graphGroup;\r
77 \r
78     /**\r
79      * keeps track of state for field: _graphGroup\r
80      */\r
81     private boolean _has_graphGroup;\r
82 \r
83     /**\r
84      * Field _id\r
85      */\r
86     private java.lang.String _id;\r
87 \r
88     /**\r
89      * Field _scoreOnly\r
90      */\r
91     private boolean _scoreOnly = false;\r
92 \r
93     /**\r
94      * keeps track of state for field: _scoreOnly\r
95      */\r
96     private boolean _has_scoreOnly;\r
97 \r
98     /**\r
99      * Field _score\r
100      */\r
101     private float _score;\r
102 \r
103     /**\r
104      * keeps track of state for field: _score\r
105      */\r
106     private boolean _has_score;\r
107 \r
108     /**\r
109      * Field _annotationElementList\r
110      */\r
111     private java.util.Vector _annotationElementList;\r
112 \r
113     /**\r
114      * Field _label\r
115      */\r
116     private java.lang.String _label;\r
117 \r
118     /**\r
119      * Field _description\r
120      */\r
121     private java.lang.String _description;\r
122 \r
123     /**\r
124      * Field _thresholdLine\r
125      */\r
126     private jalview.schemabinding.version2.ThresholdLine _thresholdLine;\r
127 \r
128 \r
129       //----------------/\r
130      //- Constructors -/\r
131     //----------------/\r
132 \r
133     public Annotation() {\r
134         super();\r
135         _annotationElementList = new Vector();\r
136     } //-- jalview.schemabinding.version2.Annotation()\r
137 \r
138 \r
139       //-----------/\r
140      //- Methods -/\r
141     //-----------/\r
142 \r
143     /**\r
144      * Method addAnnotationElement\r
145      * \r
146      * \r
147      * \r
148      * @param vAnnotationElement\r
149      */\r
150     public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
151         throws java.lang.IndexOutOfBoundsException\r
152     {\r
153         _annotationElementList.addElement(vAnnotationElement);\r
154     } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
155 \r
156     /**\r
157      * Method addAnnotationElement\r
158      * \r
159      * \r
160      * \r
161      * @param index\r
162      * @param vAnnotationElement\r
163      */\r
164     public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
165         throws java.lang.IndexOutOfBoundsException\r
166     {\r
167         _annotationElementList.insertElementAt(vAnnotationElement, index);\r
168     } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
169 \r
170     /**\r
171      * Method deleteGraph\r
172      * \r
173      */\r
174     public void deleteGraph()\r
175     {\r
176         this._has_graph= false;\r
177     } //-- void deleteGraph() \r
178 \r
179     /**\r
180      * Method deleteGraphColour\r
181      * \r
182      */\r
183     public void deleteGraphColour()\r
184     {\r
185         this._has_graphColour= false;\r
186     } //-- void deleteGraphColour() \r
187 \r
188     /**\r
189      * Method deleteGraphGroup\r
190      * \r
191      */\r
192     public void deleteGraphGroup()\r
193     {\r
194         this._has_graphGroup= false;\r
195     } //-- void deleteGraphGroup() \r
196 \r
197     /**\r
198      * Method deleteGraphType\r
199      * \r
200      */\r
201     public void deleteGraphType()\r
202     {\r
203         this._has_graphType= false;\r
204     } //-- void deleteGraphType() \r
205 \r
206     /**\r
207      * Method deleteScore\r
208      * \r
209      */\r
210     public void deleteScore()\r
211     {\r
212         this._has_score= false;\r
213     } //-- void deleteScore() \r
214 \r
215     /**\r
216      * Method deleteScoreOnly\r
217      * \r
218      */\r
219     public void deleteScoreOnly()\r
220     {\r
221         this._has_scoreOnly= false;\r
222     } //-- void deleteScoreOnly() \r
223 \r
224     /**\r
225      * Method enumerateAnnotationElement\r
226      * \r
227      * \r
228      * \r
229      * @return Enumeration\r
230      */\r
231     public java.util.Enumeration enumerateAnnotationElement()\r
232     {\r
233         return _annotationElementList.elements();\r
234     } //-- java.util.Enumeration enumerateAnnotationElement() \r
235 \r
236     /**\r
237      * Method getAnnotationElement\r
238      * \r
239      * \r
240      * \r
241      * @param index\r
242      * @return AnnotationElement\r
243      */\r
244     public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)\r
245         throws java.lang.IndexOutOfBoundsException\r
246     {\r
247         //-- check bounds for index\r
248         if ((index < 0) || (index > _annotationElementList.size())) {\r
249             throw new IndexOutOfBoundsException();\r
250         }\r
251         \r
252         return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
253     } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) \r
254 \r
255     /**\r
256      * Method getAnnotationElement\r
257      * \r
258      * \r
259      * \r
260      * @return AnnotationElement\r
261      */\r
262     public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()\r
263     {\r
264         int size = _annotationElementList.size();\r
265         jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];\r
266         for (int index = 0; index < size; index++) {\r
267             mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
268         }\r
269         return mArray;\r
270     } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() \r
271 \r
272     /**\r
273      * Method getAnnotationElementCount\r
274      * \r
275      * \r
276      * \r
277      * @return int\r
278      */\r
279     public int getAnnotationElementCount()\r
280     {\r
281         return _annotationElementList.size();\r
282     } //-- int getAnnotationElementCount() \r
283 \r
284     /**\r
285      * Returns the value of field 'description'.\r
286      * \r
287      * @return String\r
288      * @return the value of field 'description'.\r
289      */\r
290     public java.lang.String getDescription()\r
291     {\r
292         return this._description;\r
293     } //-- java.lang.String getDescription() \r
294 \r
295     /**\r
296      * Returns the value of field 'graph'.\r
297      * \r
298      * @return boolean\r
299      * @return the value of field 'graph'.\r
300      */\r
301     public boolean getGraph()\r
302     {\r
303         return this._graph;\r
304     } //-- boolean getGraph() \r
305 \r
306     /**\r
307      * Returns the value of field 'graphColour'.\r
308      * \r
309      * @return int\r
310      * @return the value of field 'graphColour'.\r
311      */\r
312     public int getGraphColour()\r
313     {\r
314         return this._graphColour;\r
315     } //-- int getGraphColour() \r
316 \r
317     /**\r
318      * Returns the value of field 'graphGroup'.\r
319      * \r
320      * @return int\r
321      * @return the value of field 'graphGroup'.\r
322      */\r
323     public int getGraphGroup()\r
324     {\r
325         return this._graphGroup;\r
326     } //-- int getGraphGroup() \r
327 \r
328     /**\r
329      * Returns the value of field 'graphType'.\r
330      * \r
331      * @return int\r
332      * @return the value of field 'graphType'.\r
333      */\r
334     public int getGraphType()\r
335     {\r
336         return this._graphType;\r
337     } //-- int getGraphType() \r
338 \r
339     /**\r
340      * Returns the value of field 'id'.\r
341      * \r
342      * @return String\r
343      * @return the value of field 'id'.\r
344      */\r
345     public java.lang.String getId()\r
346     {\r
347         return this._id;\r
348     } //-- java.lang.String getId() \r
349 \r
350     /**\r
351      * Returns the value of field 'label'.\r
352      * \r
353      * @return String\r
354      * @return the value of field 'label'.\r
355      */\r
356     public java.lang.String getLabel()\r
357     {\r
358         return this._label;\r
359     } //-- java.lang.String getLabel() \r
360 \r
361     /**\r
362      * Returns the value of field 'score'.\r
363      * \r
364      * @return float\r
365      * @return the value of field 'score'.\r
366      */\r
367     public float getScore()\r
368     {\r
369         return this._score;\r
370     } //-- float getScore() \r
371 \r
372     /**\r
373      * Returns the value of field 'scoreOnly'.\r
374      * \r
375      * @return boolean\r
376      * @return the value of field 'scoreOnly'.\r
377      */\r
378     public boolean getScoreOnly()\r
379     {\r
380         return this._scoreOnly;\r
381     } //-- boolean getScoreOnly() \r
382 \r
383     /**\r
384      * Returns the value of field 'sequenceRef'.\r
385      * \r
386      * @return String\r
387      * @return the value of field 'sequenceRef'.\r
388      */\r
389     public java.lang.String getSequenceRef()\r
390     {\r
391         return this._sequenceRef;\r
392     } //-- java.lang.String getSequenceRef() \r
393 \r
394     /**\r
395      * Returns the value of field 'thresholdLine'.\r
396      * \r
397      * @return ThresholdLine\r
398      * @return the value of field 'thresholdLine'.\r
399      */\r
400     public jalview.schemabinding.version2.ThresholdLine getThresholdLine()\r
401     {\r
402         return this._thresholdLine;\r
403     } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() \r
404 \r
405     /**\r
406      * Method hasGraph\r
407      * \r
408      * \r
409      * \r
410      * @return boolean\r
411      */\r
412     public boolean hasGraph()\r
413     {\r
414         return this._has_graph;\r
415     } //-- boolean hasGraph() \r
416 \r
417     /**\r
418      * Method hasGraphColour\r
419      * \r
420      * \r
421      * \r
422      * @return boolean\r
423      */\r
424     public boolean hasGraphColour()\r
425     {\r
426         return this._has_graphColour;\r
427     } //-- boolean hasGraphColour() \r
428 \r
429     /**\r
430      * Method hasGraphGroup\r
431      * \r
432      * \r
433      * \r
434      * @return boolean\r
435      */\r
436     public boolean hasGraphGroup()\r
437     {\r
438         return this._has_graphGroup;\r
439     } //-- boolean hasGraphGroup() \r
440 \r
441     /**\r
442      * Method hasGraphType\r
443      * \r
444      * \r
445      * \r
446      * @return boolean\r
447      */\r
448     public boolean hasGraphType()\r
449     {\r
450         return this._has_graphType;\r
451     } //-- boolean hasGraphType() \r
452 \r
453     /**\r
454      * Method hasScore\r
455      * \r
456      * \r
457      * \r
458      * @return boolean\r
459      */\r
460     public boolean hasScore()\r
461     {\r
462         return this._has_score;\r
463     } //-- boolean hasScore() \r
464 \r
465     /**\r
466      * Method hasScoreOnly\r
467      * \r
468      * \r
469      * \r
470      * @return boolean\r
471      */\r
472     public boolean hasScoreOnly()\r
473     {\r
474         return this._has_scoreOnly;\r
475     } //-- boolean hasScoreOnly() \r
476 \r
477     /**\r
478      * Method isValid\r
479      * \r
480      * \r
481      * \r
482      * @return boolean\r
483      */\r
484     public boolean isValid()\r
485     {\r
486         try {\r
487             validate();\r
488         }\r
489         catch (org.exolab.castor.xml.ValidationException vex) {\r
490             return false;\r
491         }\r
492         return true;\r
493     } //-- boolean isValid() \r
494 \r
495     /**\r
496      * Method marshal\r
497      * \r
498      * \r
499      * \r
500      * @param out\r
501      */\r
502     public void marshal(java.io.Writer out)\r
503         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
504     {\r
505         \r
506         Marshaller.marshal(this, out);\r
507     } //-- void marshal(java.io.Writer) \r
508 \r
509     /**\r
510      * Method marshal\r
511      * \r
512      * \r
513      * \r
514      * @param handler\r
515      */\r
516     public void marshal(org.xml.sax.ContentHandler handler)\r
517         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
518     {\r
519         \r
520         Marshaller.marshal(this, handler);\r
521     } //-- void marshal(org.xml.sax.ContentHandler) \r
522 \r
523     /**\r
524      * Method removeAllAnnotationElement\r
525      * \r
526      */\r
527     public void removeAllAnnotationElement()\r
528     {\r
529         _annotationElementList.removeAllElements();\r
530     } //-- void removeAllAnnotationElement() \r
531 \r
532     /**\r
533      * Method removeAnnotationElement\r
534      * \r
535      * \r
536      * \r
537      * @param index\r
538      * @return AnnotationElement\r
539      */\r
540     public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)\r
541     {\r
542         java.lang.Object obj = _annotationElementList.elementAt(index);\r
543         _annotationElementList.removeElementAt(index);\r
544         return (jalview.schemabinding.version2.AnnotationElement) obj;\r
545     } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) \r
546 \r
547     /**\r
548      * Method setAnnotationElement\r
549      * \r
550      * \r
551      * \r
552      * @param index\r
553      * @param vAnnotationElement\r
554      */\r
555     public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
556         throws java.lang.IndexOutOfBoundsException\r
557     {\r
558         //-- check bounds for index\r
559         if ((index < 0) || (index > _annotationElementList.size())) {\r
560             throw new IndexOutOfBoundsException();\r
561         }\r
562         _annotationElementList.setElementAt(vAnnotationElement, index);\r
563     } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
564 \r
565     /**\r
566      * Method setAnnotationElement\r
567      * \r
568      * \r
569      * \r
570      * @param annotationElementArray\r
571      */\r
572     public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)\r
573     {\r
574         //-- copy array\r
575         _annotationElementList.removeAllElements();\r
576         for (int i = 0; i < annotationElementArray.length; i++) {\r
577             _annotationElementList.addElement(annotationElementArray[i]);\r
578         }\r
579     } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
580 \r
581     /**\r
582      * Sets the value of field 'description'.\r
583      * \r
584      * @param description the value of field 'description'.\r
585      */\r
586     public void setDescription(java.lang.String description)\r
587     {\r
588         this._description = description;\r
589     } //-- void setDescription(java.lang.String) \r
590 \r
591     /**\r
592      * Sets the value of field 'graph'.\r
593      * \r
594      * @param graph the value of field 'graph'.\r
595      */\r
596     public void setGraph(boolean graph)\r
597     {\r
598         this._graph = graph;\r
599         this._has_graph = true;\r
600     } //-- void setGraph(boolean) \r
601 \r
602     /**\r
603      * Sets the value of field 'graphColour'.\r
604      * \r
605      * @param graphColour the value of field 'graphColour'.\r
606      */\r
607     public void setGraphColour(int graphColour)\r
608     {\r
609         this._graphColour = graphColour;\r
610         this._has_graphColour = true;\r
611     } //-- void setGraphColour(int) \r
612 \r
613     /**\r
614      * Sets the value of field 'graphGroup'.\r
615      * \r
616      * @param graphGroup the value of field 'graphGroup'.\r
617      */\r
618     public void setGraphGroup(int graphGroup)\r
619     {\r
620         this._graphGroup = graphGroup;\r
621         this._has_graphGroup = true;\r
622     } //-- void setGraphGroup(int) \r
623 \r
624     /**\r
625      * Sets the value of field 'graphType'.\r
626      * \r
627      * @param graphType the value of field 'graphType'.\r
628      */\r
629     public void setGraphType(int graphType)\r
630     {\r
631         this._graphType = graphType;\r
632         this._has_graphType = true;\r
633     } //-- void setGraphType(int) \r
634 \r
635     /**\r
636      * Sets the value of field 'id'.\r
637      * \r
638      * @param id the value of field 'id'.\r
639      */\r
640     public void setId(java.lang.String id)\r
641     {\r
642         this._id = id;\r
643     } //-- void setId(java.lang.String) \r
644 \r
645     /**\r
646      * Sets the value of field 'label'.\r
647      * \r
648      * @param label the value of field 'label'.\r
649      */\r
650     public void setLabel(java.lang.String label)\r
651     {\r
652         this._label = label;\r
653     } //-- void setLabel(java.lang.String) \r
654 \r
655     /**\r
656      * Sets the value of field 'score'.\r
657      * \r
658      * @param score the value of field 'score'.\r
659      */\r
660     public void setScore(float score)\r
661     {\r
662         this._score = score;\r
663         this._has_score = true;\r
664     } //-- void setScore(float) \r
665 \r
666     /**\r
667      * Sets the value of field 'scoreOnly'.\r
668      * \r
669      * @param scoreOnly the value of field 'scoreOnly'.\r
670      */\r
671     public void setScoreOnly(boolean scoreOnly)\r
672     {\r
673         this._scoreOnly = scoreOnly;\r
674         this._has_scoreOnly = true;\r
675     } //-- void setScoreOnly(boolean) \r
676 \r
677     /**\r
678      * Sets the value of field 'sequenceRef'.\r
679      * \r
680      * @param sequenceRef the value of field 'sequenceRef'.\r
681      */\r
682     public void setSequenceRef(java.lang.String sequenceRef)\r
683     {\r
684         this._sequenceRef = sequenceRef;\r
685     } //-- void setSequenceRef(java.lang.String) \r
686 \r
687     /**\r
688      * Sets the value of field 'thresholdLine'.\r
689      * \r
690      * @param thresholdLine the value of field 'thresholdLine'.\r
691      */\r
692     public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)\r
693     {\r
694         this._thresholdLine = thresholdLine;\r
695     } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) \r
696 \r
697     /**\r
698      * Method unmarshal\r
699      * \r
700      * \r
701      * \r
702      * @param reader\r
703      * @return Object\r
704      */\r
705     public static java.lang.Object unmarshal(java.io.Reader reader)\r
706         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
707     {\r
708         return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);\r
709     } //-- java.lang.Object unmarshal(java.io.Reader) \r
710 \r
711     /**\r
712      * Method validate\r
713      * \r
714      */\r
715     public void validate()\r
716         throws org.exolab.castor.xml.ValidationException\r
717     {\r
718         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
719         validator.validate(this);\r
720     } //-- void validate() \r
721 \r
722 }\r