2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\r
8 package jalview.schemabinding.version2;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\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
29 * @version $Revision$ $Date$
\r
31 public class Annotation implements java.io.Serializable {
\r
34 //--------------------------/
\r
35 //- Class/Member Variables -/
\r
36 //--------------------------/
\r
41 private boolean _graph;
\r
44 * keeps track of state for field: _graph
\r
46 private boolean _has_graph;
\r
51 private int _graphType;
\r
54 * keeps track of state for field: _graphType
\r
56 private boolean _has_graphType;
\r
59 * Field _annotationElementList
\r
61 private java.util.Vector _annotationElementList;
\r
66 private java.lang.String _label;
\r
69 * Field _description
\r
71 private java.lang.String _description;
\r
74 * Field _thresholdLine
\r
76 private jalview.schemabinding.version2.ThresholdLine _thresholdLine;
\r
83 public Annotation() {
\r
85 _annotationElementList = new Vector();
\r
86 } //-- jalview.schemabinding.version2.Annotation()
\r
94 * Method addAnnotationElement
\r
98 * @param vAnnotationElement
\r
100 public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
101 throws java.lang.IndexOutOfBoundsException
\r
103 _annotationElementList.addElement(vAnnotationElement);
\r
104 } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
107 * Method addAnnotationElement
\r
112 * @param vAnnotationElement
\r
114 public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
115 throws java.lang.IndexOutOfBoundsException
\r
117 _annotationElementList.insertElementAt(vAnnotationElement, index);
\r
118 } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
121 * Method deleteGraph
\r
124 public void deleteGraph()
\r
126 this._has_graph= false;
\r
127 } //-- void deleteGraph()
\r
130 * Method deleteGraphType
\r
133 public void deleteGraphType()
\r
135 this._has_graphType= false;
\r
136 } //-- void deleteGraphType()
\r
139 * Method enumerateAnnotationElement
\r
143 * @return Enumeration
\r
145 public java.util.Enumeration enumerateAnnotationElement()
\r
147 return _annotationElementList.elements();
\r
148 } //-- java.util.Enumeration enumerateAnnotationElement()
\r
151 * Method getAnnotationElement
\r
156 * @return AnnotationElement
\r
158 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)
\r
159 throws java.lang.IndexOutOfBoundsException
\r
161 //-- check bounds for index
\r
162 if ((index < 0) || (index > _annotationElementList.size())) {
\r
163 throw new IndexOutOfBoundsException();
\r
166 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
167 } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int)
\r
170 * Method getAnnotationElement
\r
174 * @return AnnotationElement
\r
176 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
178 int size = _annotationElementList.size();
\r
179 jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];
\r
180 for (int index = 0; index < size; index++) {
\r
181 mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
184 } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
187 * Method getAnnotationElementCount
\r
193 public int getAnnotationElementCount()
\r
195 return _annotationElementList.size();
\r
196 } //-- int getAnnotationElementCount()
\r
199 * Returns the value of field 'description'.
\r
202 * @return the value of field 'description'.
\r
204 public java.lang.String getDescription()
\r
206 return this._description;
\r
207 } //-- java.lang.String getDescription()
\r
210 * Returns the value of field 'graph'.
\r
213 * @return the value of field 'graph'.
\r
215 public boolean getGraph()
\r
217 return this._graph;
\r
218 } //-- boolean getGraph()
\r
221 * Returns the value of field 'graphType'.
\r
224 * @return the value of field 'graphType'.
\r
226 public int getGraphType()
\r
228 return this._graphType;
\r
229 } //-- int getGraphType()
\r
232 * Returns the value of field 'label'.
\r
235 * @return the value of field 'label'.
\r
237 public java.lang.String getLabel()
\r
239 return this._label;
\r
240 } //-- java.lang.String getLabel()
\r
243 * Returns the value of field 'thresholdLine'.
\r
245 * @return ThresholdLine
\r
246 * @return the value of field 'thresholdLine'.
\r
248 public jalview.schemabinding.version2.ThresholdLine getThresholdLine()
\r
250 return this._thresholdLine;
\r
251 } //-- jalview.schemabinding.version2.ThresholdLine getThresholdLine()
\r
260 public boolean hasGraph()
\r
262 return this._has_graph;
\r
263 } //-- boolean hasGraph()
\r
266 * Method hasGraphType
\r
272 public boolean hasGraphType()
\r
274 return this._has_graphType;
\r
275 } //-- boolean hasGraphType()
\r
284 public boolean isValid()
\r
289 catch (org.exolab.castor.xml.ValidationException vex) {
\r
293 } //-- boolean isValid()
\r
302 public void marshal(java.io.Writer out)
\r
303 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
306 Marshaller.marshal(this, out);
\r
307 } //-- void marshal(java.io.Writer)
\r
316 public void marshal(org.xml.sax.ContentHandler handler)
\r
317 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
320 Marshaller.marshal(this, handler);
\r
321 } //-- void marshal(org.xml.sax.ContentHandler)
\r
324 * Method removeAllAnnotationElement
\r
327 public void removeAllAnnotationElement()
\r
329 _annotationElementList.removeAllElements();
\r
330 } //-- void removeAllAnnotationElement()
\r
333 * Method removeAnnotationElement
\r
338 * @return AnnotationElement
\r
340 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)
\r
342 java.lang.Object obj = _annotationElementList.elementAt(index);
\r
343 _annotationElementList.removeElementAt(index);
\r
344 return (jalview.schemabinding.version2.AnnotationElement) obj;
\r
345 } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int)
\r
348 * Method setAnnotationElement
\r
353 * @param vAnnotationElement
\r
355 public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
356 throws java.lang.IndexOutOfBoundsException
\r
358 //-- check bounds for index
\r
359 if ((index < 0) || (index > _annotationElementList.size())) {
\r
360 throw new IndexOutOfBoundsException();
\r
362 _annotationElementList.setElementAt(vAnnotationElement, index);
\r
363 } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
366 * Method setAnnotationElement
\r
370 * @param annotationElementArray
\r
372 public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)
\r
375 _annotationElementList.removeAllElements();
\r
376 for (int i = 0; i < annotationElementArray.length; i++) {
\r
377 _annotationElementList.addElement(annotationElementArray[i]);
\r
379 } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
382 * Sets the value of field 'description'.
\r
384 * @param description the value of field 'description'.
\r
386 public void setDescription(java.lang.String description)
\r
388 this._description = description;
\r
389 } //-- void setDescription(java.lang.String)
\r
392 * Sets the value of field 'graph'.
\r
394 * @param graph the value of field 'graph'.
\r
396 public void setGraph(boolean graph)
\r
398 this._graph = graph;
\r
399 this._has_graph = true;
\r
400 } //-- void setGraph(boolean)
\r
403 * Sets the value of field 'graphType'.
\r
405 * @param graphType the value of field 'graphType'.
\r
407 public void setGraphType(int graphType)
\r
409 this._graphType = graphType;
\r
410 this._has_graphType = true;
\r
411 } //-- void setGraphType(int)
\r
414 * Sets the value of field 'label'.
\r
416 * @param label the value of field 'label'.
\r
418 public void setLabel(java.lang.String label)
\r
420 this._label = label;
\r
421 } //-- void setLabel(java.lang.String)
\r
424 * Sets the value of field 'thresholdLine'.
\r
426 * @param thresholdLine the value of field 'thresholdLine'.
\r
428 public void setThresholdLine(jalview.schemabinding.version2.ThresholdLine thresholdLine)
\r
430 this._thresholdLine = thresholdLine;
\r
431 } //-- void setThresholdLine(jalview.schemabinding.version2.ThresholdLine)
\r
441 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
442 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
444 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
\r
445 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
451 public void validate()
\r
452 throws org.exolab.castor.xml.ValidationException
\r
454 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
455 validator.validate(this);
\r
456 } //-- void validate()
\r