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