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