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