Save seqref with annotations
[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 _annotationElementList\r
65      */\r
66     private java.util.Vector _annotationElementList;\r
67 \r
68     /**\r
69      * Field _label\r
70      */\r
71     private java.lang.String _label;\r
72 \r
73     /**\r
74      * Field _description\r
75      */\r
76     private java.lang.String _description;\r
77 \r
78     /**\r
79      * Field _thresholdLine\r
80      */\r
81     private jalview.schemabinding.version2.ThresholdLine _thresholdLine;\r
82 \r
83 \r
84       //----------------/\r
85      //- Constructors -/\r
86     //----------------/\r
87 \r
88     public Annotation() {\r
89         super();\r
90         _annotationElementList = new Vector();\r
91     } //-- jalview.schemabinding.version2.Annotation()\r
92 \r
93 \r
94       //-----------/\r
95      //- Methods -/\r
96     //-----------/\r
97 \r
98     /**\r
99      * Method addAnnotationElement\r
100      * \r
101      * \r
102      * \r
103      * @param vAnnotationElement\r
104      */\r
105     public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
106         throws java.lang.IndexOutOfBoundsException\r
107     {\r
108         _annotationElementList.addElement(vAnnotationElement);\r
109     } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
110 \r
111     /**\r
112      * Method addAnnotationElement\r
113      * \r
114      * \r
115      * \r
116      * @param index\r
117      * @param vAnnotationElement\r
118      */\r
119     public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
120         throws java.lang.IndexOutOfBoundsException\r
121     {\r
122         _annotationElementList.insertElementAt(vAnnotationElement, index);\r
123     } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
124 \r
125     /**\r
126      * Method deleteGraph\r
127      * \r
128      */\r
129     public void deleteGraph()\r
130     {\r
131         this._has_graph= false;\r
132     } //-- void deleteGraph() \r
133 \r
134     /**\r
135      * Method deleteGraphType\r
136      * \r
137      */\r
138     public void deleteGraphType()\r
139     {\r
140         this._has_graphType= false;\r
141     } //-- void deleteGraphType() \r
142 \r
143     /**\r
144      * Method enumerateAnnotationElement\r
145      * \r
146      * \r
147      * \r
148      * @return Enumeration\r
149      */\r
150     public java.util.Enumeration enumerateAnnotationElement()\r
151     {\r
152         return _annotationElementList.elements();\r
153     } //-- java.util.Enumeration enumerateAnnotationElement() \r
154 \r
155     /**\r
156      * Method getAnnotationElement\r
157      * \r
158      * \r
159      * \r
160      * @param index\r
161      * @return AnnotationElement\r
162      */\r
163     public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)\r
164         throws java.lang.IndexOutOfBoundsException\r
165     {\r
166         //-- check bounds for index\r
167         if ((index < 0) || (index > _annotationElementList.size())) {\r
168             throw new IndexOutOfBoundsException();\r
169         }\r
170         \r
171         return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
172     } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int) \r
173 \r
174     /**\r
175      * Method getAnnotationElement\r
176      * \r
177      * \r
178      * \r
179      * @return AnnotationElement\r
180      */\r
181     public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()\r
182     {\r
183         int size = _annotationElementList.size();\r
184         jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];\r
185         for (int index = 0; index < size; index++) {\r
186             mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);\r
187         }\r
188         return mArray;\r
189     } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() \r
190 \r
191     /**\r
192      * Method getAnnotationElementCount\r
193      * \r
194      * \r
195      * \r
196      * @return int\r
197      */\r
198     public int getAnnotationElementCount()\r
199     {\r
200         return _annotationElementList.size();\r
201     } //-- int getAnnotationElementCount() \r
202 \r
203     /**\r
204      * Returns the value of field 'description'.\r
205      * \r
206      * @return String\r
207      * @return the value of field 'description'.\r
208      */\r
209     public java.lang.String getDescription()\r
210     {\r
211         return this._description;\r
212     } //-- java.lang.String getDescription() \r
213 \r
214     /**\r
215      * Returns the value of field 'graph'.\r
216      * \r
217      * @return boolean\r
218      * @return the value of field 'graph'.\r
219      */\r
220     public boolean getGraph()\r
221     {\r
222         return this._graph;\r
223     } //-- boolean getGraph() \r
224 \r
225     /**\r
226      * Returns the value of field 'graphType'.\r
227      * \r
228      * @return int\r
229      * @return the value of field 'graphType'.\r
230      */\r
231     public int getGraphType()\r
232     {\r
233         return this._graphType;\r
234     } //-- int getGraphType() \r
235 \r
236     /**\r
237      * Returns the value of field 'label'.\r
238      * \r
239      * @return String\r
240      * @return the value of field 'label'.\r
241      */\r
242     public java.lang.String getLabel()\r
243     {\r
244         return this._label;\r
245     } //-- java.lang.String getLabel() \r
246 \r
247     /**\r
248      * Returns the value of field 'sequenceRef'.\r
249      * \r
250      * @return String\r
251      * @return the value of field 'sequenceRef'.\r
252      */\r
253     public java.lang.String getSequenceRef()\r
254     {\r
255         return this._sequenceRef;\r
256     } //-- java.lang.String getSequenceRef() \r
257 \r
258     /**\r
259      * Returns the value of field 'thresholdLine'.\r
260      * \r
261      * @return ThresholdLine\r
262      * @return the value of field 'thresholdLine'.\r
263      */\r
264     public jalview.schemabinding.version2.ThresholdLine getThresholdLine()\r
265     {\r
266         return this._thresholdLine;\r
267     } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine() \r
268 \r
269     /**\r
270      * Method hasGraph\r
271      * \r
272      * \r
273      * \r
274      * @return boolean\r
275      */\r
276     public boolean hasGraph()\r
277     {\r
278         return this._has_graph;\r
279     } //-- boolean hasGraph() \r
280 \r
281     /**\r
282      * Method hasGraphType\r
283      * \r
284      * \r
285      * \r
286      * @return boolean\r
287      */\r
288     public boolean hasGraphType()\r
289     {\r
290         return this._has_graphType;\r
291     } //-- boolean hasGraphType() \r
292 \r
293     /**\r
294      * Method isValid\r
295      * \r
296      * \r
297      * \r
298      * @return boolean\r
299      */\r
300     public boolean isValid()\r
301     {\r
302         try {\r
303             validate();\r
304         }\r
305         catch (org.exolab.castor.xml.ValidationException vex) {\r
306             return false;\r
307         }\r
308         return true;\r
309     } //-- boolean isValid() \r
310 \r
311     /**\r
312      * Method marshal\r
313      * \r
314      * \r
315      * \r
316      * @param out\r
317      */\r
318     public void marshal(java.io.Writer out)\r
319         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
320     {\r
321         \r
322         Marshaller.marshal(this, out);\r
323     } //-- void marshal(java.io.Writer) \r
324 \r
325     /**\r
326      * Method marshal\r
327      * \r
328      * \r
329      * \r
330      * @param handler\r
331      */\r
332     public void marshal(org.xml.sax.ContentHandler handler)\r
333         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
334     {\r
335         \r
336         Marshaller.marshal(this, handler);\r
337     } //-- void marshal(org.xml.sax.ContentHandler) \r
338 \r
339     /**\r
340      * Method removeAllAnnotationElement\r
341      * \r
342      */\r
343     public void removeAllAnnotationElement()\r
344     {\r
345         _annotationElementList.removeAllElements();\r
346     } //-- void removeAllAnnotationElement() \r
347 \r
348     /**\r
349      * Method removeAnnotationElement\r
350      * \r
351      * \r
352      * \r
353      * @param index\r
354      * @return AnnotationElement\r
355      */\r
356     public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)\r
357     {\r
358         java.lang.Object obj = _annotationElementList.elementAt(index);\r
359         _annotationElementList.removeElementAt(index);\r
360         return (jalview.schemabinding.version2.AnnotationElement) obj;\r
361     } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int) \r
362 \r
363     /**\r
364      * Method setAnnotationElement\r
365      * \r
366      * \r
367      * \r
368      * @param index\r
369      * @param vAnnotationElement\r
370      */\r
371     public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)\r
372         throws java.lang.IndexOutOfBoundsException\r
373     {\r
374         //-- check bounds for index\r
375         if ((index < 0) || (index > _annotationElementList.size())) {\r
376             throw new IndexOutOfBoundsException();\r
377         }\r
378         _annotationElementList.setElementAt(vAnnotationElement, index);\r
379     } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement) \r
380 \r
381     /**\r
382      * Method setAnnotationElement\r
383      * \r
384      * \r
385      * \r
386      * @param annotationElementArray\r
387      */\r
388     public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)\r
389     {\r
390         //-- copy array\r
391         _annotationElementList.removeAllElements();\r
392         for (int i = 0; i < annotationElementArray.length; i++) {\r
393             _annotationElementList.addElement(annotationElementArray[i]);\r
394         }\r
395     } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement) \r
396 \r
397     /**\r
398      * Sets the value of field 'description'.\r
399      * \r
400      * @param description the value of field 'description'.\r
401      */\r
402     public void setDescription(java.lang.String description)\r
403     {\r
404         this._description = description;\r
405     } //-- void setDescription(java.lang.String) \r
406 \r
407     /**\r
408      * Sets the value of field 'graph'.\r
409      * \r
410      * @param graph the value of field 'graph'.\r
411      */\r
412     public void setGraph(boolean graph)\r
413     {\r
414         this._graph = graph;\r
415         this._has_graph = true;\r
416     } //-- void setGraph(boolean) \r
417 \r
418     /**\r
419      * Sets the value of field 'graphType'.\r
420      * \r
421      * @param graphType the value of field 'graphType'.\r
422      */\r
423     public void setGraphType(int graphType)\r
424     {\r
425         this._graphType = graphType;\r
426         this._has_graphType = true;\r
427     } //-- void setGraphType(int) \r
428 \r
429     /**\r
430      * Sets the value of field 'label'.\r
431      * \r
432      * @param label the value of field 'label'.\r
433      */\r
434     public void setLabel(java.lang.String label)\r
435     {\r
436         this._label = label;\r
437     } //-- void setLabel(java.lang.String) \r
438 \r
439     /**\r
440      * Sets the value of field 'sequenceRef'.\r
441      * \r
442      * @param sequenceRef the value of field 'sequenceRef'.\r
443      */\r
444     public void setSequenceRef(java.lang.String sequenceRef)\r
445     {\r
446         this._sequenceRef = sequenceRef;\r
447     } //-- void setSequenceRef(java.lang.String) \r
448 \r
449     /**\r
450      * Sets the value of field 'thresholdLine'.\r
451      * \r
452      * @param thresholdLine the value of field 'thresholdLine'.\r
453      */\r
454     public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)\r
455     {\r
456         this._thresholdLine = thresholdLine;\r
457     } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine) \r
458 \r
459     /**\r
460      * Method unmarshal\r
461      * \r
462      * \r
463      * \r
464      * @param reader\r
465      * @return Object\r
466      */\r
467     public static java.lang.Object unmarshal(java.io.Reader reader)\r
468         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
469     {\r
470         return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);\r
471     } //-- java.lang.Object unmarshal(java.io.Reader) \r
472 \r
473     /**\r
474      * Method validate\r
475      * \r
476      */\r
477     public void validate()\r
478         throws org.exolab.castor.xml.ValidationException\r
479     {\r
480         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
481         validator.validate(this);\r
482     } //-- void validate() \r
483 \r
484 }\r