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