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