Saves Jmol status
[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 _annotationElementList\r
90      */\r
91     private java.util.Vector _annotationElementList;\r
92 \r
93     /**\r
94      * Field _label\r
95      */\r
96     private java.lang.String _label;\r
97 \r
98     /**\r
99      * Field _description\r
100      */\r
101     private java.lang.String _description;\r
102 \r
103     /**\r
104      * Field _thresholdLine\r
105      */\r
106     private jalview.schemabinding.version2.ThresholdLine _thresholdLine;\r
107 \r
108 \r
109       //----------------/\r
110      //- Constructors -/\r
111     //----------------/\r
112 \r
113     public Annotation() {\r
114         super();\r
115         _annotationElementList = new Vector();\r
116     } //-- jalview.schemabinding.version2.Annotation()\r
117 \r
118 \r
119       //-----------/\r
120      //- Methods -/\r
121     //-----------/\r
122 \r
123     /**\r
124      * Method addAnnotationElement\r
125      * \r
126      * \r
127      * \r
128      * @param vAnnotationElement\r
129      */\r
130     public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
131         throws java.lang.IndexOutOfBoundsException\r
132     {\r
133         _annotationElementList.addElement(vAnnotationElement);\r
134     } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
135 \r
136     /**\r
137      * Method addAnnotationElement\r
138      * \r
139      * \r
140      * \r
141      * @param index\r
142      * @param vAnnotationElement\r
143      */\r
144     public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
145         throws java.lang.IndexOutOfBoundsException\r
146     {\r
147         _annotationElementList.insertElementAt(vAnnotationElement, index);\r
148     } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
149 \r
150     /**\r
151      * Method deleteGraph\r
152      * \r
153      */\r
154     public void deleteGraph()\r
155     {\r
156         this._has_graph= false;\r
157     } //-- void deleteGraph() \r
158 \r
159     /**\r
160      * Method deleteGraphColour\r
161      * \r
162      */\r
163     public void deleteGraphColour()\r
164     {\r
165         this._has_graphColour= false;\r
166     } //-- void deleteGraphColour() \r
167 \r
168     /**\r
169      * Method deleteGraphGroup\r
170      * \r
171      */\r
172     public void deleteGraphGroup()\r
173     {\r
174         this._has_graphGroup= false;\r
175     } //-- void deleteGraphGroup() \r
176 \r
177     /**\r
178      * Method deleteGraphType\r
179      * \r
180      */\r
181     public void deleteGraphType()\r
182     {\r
183         this._has_graphType= false;\r
184     } //-- void deleteGraphType() \r
185 \r
186     /**\r
187      * Method enumerateAnnotationElement\r
188      * \r
189      * \r
190      * \r
191      * @return Enumeration\r
192      */\r
193     public java.util.Enumeration enumerateAnnotationElement()\r
194     {\r
195         return _annotationElementList.elements();\r
196     } //-- java.util.Enumeration enumerateAnnotationElement() \r
197 \r
198     /**\r
199      * Method getAnnotationElement\r
200      * \r
201      * \r
202      * \r
203      * @param index\r
204      * @return AnnotationElement\r
205      */\r
206     public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)\r
207         throws java.lang.IndexOutOfBoundsException\r
208     {\r
209         //-- check bounds for index\r
210         if ((index < 0) || (index > _annotationElementList.size())) {\r
211             throw new IndexOutOfBoundsException();\r
212         }\r
213         \r
214         return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
215     } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) \r
216 \r
217     /**\r
218      * Method getAnnotationElement\r
219      * \r
220      * \r
221      * \r
222      * @return AnnotationElement\r
223      */\r
224     public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()\r
225     {\r
226         int size = _annotationElementList.size();\r
227         jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];\r
228         for (int index = 0; index < size; index++) {\r
229             mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
230         }\r
231         return mArray;\r
232     } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() \r
233 \r
234     /**\r
235      * Method getAnnotationElementCount\r
236      * \r
237      * \r
238      * \r
239      * @return int\r
240      */\r
241     public int getAnnotationElementCount()\r
242     {\r
243         return _annotationElementList.size();\r
244     } //-- int getAnnotationElementCount() \r
245 \r
246     /**\r
247      * Returns the value of field 'description'.\r
248      * \r
249      * @return String\r
250      * @return the value of field 'description'.\r
251      */\r
252     public java.lang.String getDescription()\r
253     {\r
254         return this._description;\r
255     } //-- java.lang.String getDescription() \r
256 \r
257     /**\r
258      * Returns the value of field 'graph'.\r
259      * \r
260      * @return boolean\r
261      * @return the value of field 'graph'.\r
262      */\r
263     public boolean getGraph()\r
264     {\r
265         return this._graph;\r
266     } //-- boolean getGraph() \r
267 \r
268     /**\r
269      * Returns the value of field 'graphColour'.\r
270      * \r
271      * @return int\r
272      * @return the value of field 'graphColour'.\r
273      */\r
274     public int getGraphColour()\r
275     {\r
276         return this._graphColour;\r
277     } //-- int getGraphColour() \r
278 \r
279     /**\r
280      * Returns the value of field 'graphGroup'.\r
281      * \r
282      * @return int\r
283      * @return the value of field 'graphGroup'.\r
284      */\r
285     public int getGraphGroup()\r
286     {\r
287         return this._graphGroup;\r
288     } //-- int getGraphGroup() \r
289 \r
290     /**\r
291      * Returns the value of field 'graphType'.\r
292      * \r
293      * @return int\r
294      * @return the value of field 'graphType'.\r
295      */\r
296     public int getGraphType()\r
297     {\r
298         return this._graphType;\r
299     } //-- int getGraphType() \r
300 \r
301     /**\r
302      * Returns the value of field 'id'.\r
303      * \r
304      * @return String\r
305      * @return the value of field 'id'.\r
306      */\r
307     public java.lang.String getId()\r
308     {\r
309         return this._id;\r
310     } //-- java.lang.String getId() \r
311 \r
312     /**\r
313      * Returns the value of field 'label'.\r
314      * \r
315      * @return String\r
316      * @return the value of field 'label'.\r
317      */\r
318     public java.lang.String getLabel()\r
319     {\r
320         return this._label;\r
321     } //-- java.lang.String getLabel() \r
322 \r
323     /**\r
324      * Returns the value of field 'sequenceRef'.\r
325      * \r
326      * @return String\r
327      * @return the value of field 'sequenceRef'.\r
328      */\r
329     public java.lang.String getSequenceRef()\r
330     {\r
331         return this._sequenceRef;\r
332     } //-- java.lang.String getSequenceRef() \r
333 \r
334     /**\r
335      * Returns the value of field 'thresholdLine'.\r
336      * \r
337      * @return ThresholdLine\r
338      * @return the value of field 'thresholdLine'.\r
339      */\r
340     public jalview.schemabinding.version2.ThresholdLine getThresholdLine()\r
341     {\r
342         return this._thresholdLine;\r
343     } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() \r
344 \r
345     /**\r
346      * Method hasGraph\r
347      * \r
348      * \r
349      * \r
350      * @return boolean\r
351      */\r
352     public boolean hasGraph()\r
353     {\r
354         return this._has_graph;\r
355     } //-- boolean hasGraph() \r
356 \r
357     /**\r
358      * Method hasGraphColour\r
359      * \r
360      * \r
361      * \r
362      * @return boolean\r
363      */\r
364     public boolean hasGraphColour()\r
365     {\r
366         return this._has_graphColour;\r
367     } //-- boolean hasGraphColour() \r
368 \r
369     /**\r
370      * Method hasGraphGroup\r
371      * \r
372      * \r
373      * \r
374      * @return boolean\r
375      */\r
376     public boolean hasGraphGroup()\r
377     {\r
378         return this._has_graphGroup;\r
379     } //-- boolean hasGraphGroup() \r
380 \r
381     /**\r
382      * Method hasGraphType\r
383      * \r
384      * \r
385      * \r
386      * @return boolean\r
387      */\r
388     public boolean hasGraphType()\r
389     {\r
390         return this._has_graphType;\r
391     } //-- boolean hasGraphType() \r
392 \r
393     /**\r
394      * Method isValid\r
395      * \r
396      * \r
397      * \r
398      * @return boolean\r
399      */\r
400     public boolean isValid()\r
401     {\r
402         try {\r
403             validate();\r
404         }\r
405         catch (org.exolab.castor.xml.ValidationException vex) {\r
406             return false;\r
407         }\r
408         return true;\r
409     } //-- boolean isValid() \r
410 \r
411     /**\r
412      * Method marshal\r
413      * \r
414      * \r
415      * \r
416      * @param out\r
417      */\r
418     public void marshal(java.io.Writer out)\r
419         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
420     {\r
421         \r
422         Marshaller.marshal(this, out);\r
423     } //-- void marshal(java.io.Writer) \r
424 \r
425     /**\r
426      * Method marshal\r
427      * \r
428      * \r
429      * \r
430      * @param handler\r
431      */\r
432     public void marshal(org.xml.sax.ContentHandler handler)\r
433         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
434     {\r
435         \r
436         Marshaller.marshal(this, handler);\r
437     } //-- void marshal(org.xml.sax.ContentHandler) \r
438 \r
439     /**\r
440      * Method removeAllAnnotationElement\r
441      * \r
442      */\r
443     public void removeAllAnnotationElement()\r
444     {\r
445         _annotationElementList.removeAllElements();\r
446     } //-- void removeAllAnnotationElement() \r
447 \r
448     /**\r
449      * Method removeAnnotationElement\r
450      * \r
451      * \r
452      * \r
453      * @param index\r
454      * @return AnnotationElement\r
455      */\r
456     public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)\r
457     {\r
458         java.lang.Object obj = _annotationElementList.elementAt(index);\r
459         _annotationElementList.removeElementAt(index);\r
460         return (jalview.schemabinding.version2.AnnotationElement) obj;\r
461     } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) \r
462 \r
463     /**\r
464      * Method setAnnotationElement\r
465      * \r
466      * \r
467      * \r
468      * @param index\r
469      * @param vAnnotationElement\r
470      */\r
471     public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
472         throws java.lang.IndexOutOfBoundsException\r
473     {\r
474         //-- check bounds for index\r
475         if ((index < 0) || (index > _annotationElementList.size())) {\r
476             throw new IndexOutOfBoundsException();\r
477         }\r
478         _annotationElementList.setElementAt(vAnnotationElement, index);\r
479     } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
480 \r
481     /**\r
482      * Method setAnnotationElement\r
483      * \r
484      * \r
485      * \r
486      * @param annotationElementArray\r
487      */\r
488     public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)\r
489     {\r
490         //-- copy array\r
491         _annotationElementList.removeAllElements();\r
492         for (int i = 0; i < annotationElementArray.length; i++) {\r
493             _annotationElementList.addElement(annotationElementArray[i]);\r
494         }\r
495     } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
496 \r
497     /**\r
498      * Sets the value of field 'description'.\r
499      * \r
500      * @param description the value of field 'description'.\r
501      */\r
502     public void setDescription(java.lang.String description)\r
503     {\r
504         this._description = description;\r
505     } //-- void setDescription(java.lang.String) \r
506 \r
507     /**\r
508      * Sets the value of field 'graph'.\r
509      * \r
510      * @param graph the value of field 'graph'.\r
511      */\r
512     public void setGraph(boolean graph)\r
513     {\r
514         this._graph = graph;\r
515         this._has_graph = true;\r
516     } //-- void setGraph(boolean) \r
517 \r
518     /**\r
519      * Sets the value of field 'graphColour'.\r
520      * \r
521      * @param graphColour the value of field 'graphColour'.\r
522      */\r
523     public void setGraphColour(int graphColour)\r
524     {\r
525         this._graphColour = graphColour;\r
526         this._has_graphColour = true;\r
527     } //-- void setGraphColour(int) \r
528 \r
529     /**\r
530      * Sets the value of field 'graphGroup'.\r
531      * \r
532      * @param graphGroup the value of field 'graphGroup'.\r
533      */\r
534     public void setGraphGroup(int graphGroup)\r
535     {\r
536         this._graphGroup = graphGroup;\r
537         this._has_graphGroup = true;\r
538     } //-- void setGraphGroup(int) \r
539 \r
540     /**\r
541      * Sets the value of field 'graphType'.\r
542      * \r
543      * @param graphType the value of field 'graphType'.\r
544      */\r
545     public void setGraphType(int graphType)\r
546     {\r
547         this._graphType = graphType;\r
548         this._has_graphType = true;\r
549     } //-- void setGraphType(int) \r
550 \r
551     /**\r
552      * Sets the value of field 'id'.\r
553      * \r
554      * @param id the value of field 'id'.\r
555      */\r
556     public void setId(java.lang.String id)\r
557     {\r
558         this._id = id;\r
559     } //-- void setId(java.lang.String) \r
560 \r
561     /**\r
562      * Sets the value of field 'label'.\r
563      * \r
564      * @param label the value of field 'label'.\r
565      */\r
566     public void setLabel(java.lang.String label)\r
567     {\r
568         this._label = label;\r
569     } //-- void setLabel(java.lang.String) \r
570 \r
571     /**\r
572      * Sets the value of field 'sequenceRef'.\r
573      * \r
574      * @param sequenceRef the value of field 'sequenceRef'.\r
575      */\r
576     public void setSequenceRef(java.lang.String sequenceRef)\r
577     {\r
578         this._sequenceRef = sequenceRef;\r
579     } //-- void setSequenceRef(java.lang.String) \r
580 \r
581     /**\r
582      * Sets the value of field 'thresholdLine'.\r
583      * \r
584      * @param thresholdLine the value of field 'thresholdLine'.\r
585      */\r
586     public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)\r
587     {\r
588         this._thresholdLine = thresholdLine;\r
589     } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) \r
590 \r
591     /**\r
592      * Method unmarshal\r
593      * \r
594      * \r
595      * \r
596      * @param reader\r
597      * @return Object\r
598      */\r
599     public static java.lang.Object unmarshal(java.io.Reader reader)\r
600         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
601     {\r
602         return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);\r
603     } //-- java.lang.Object unmarshal(java.io.Reader) \r
604 \r
605     /**\r
606      * Method validate\r
607      * \r
608      */\r
609     public void validate()\r
610         throws org.exolab.castor.xml.ValidationException\r
611     {\r
612         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
613         validator.validate(this);\r
614     } //-- void validate() \r
615 \r
616 }\r