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
78 public Annotation() {
\r
80 _annotationElementList = new Vector();
\r
81 } //-- jalview.schemabinding.version2.Annotation()
\r
89 * Method addAnnotationElement
\r
93 * @param vAnnotationElement
\r
95 public void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
96 throws java.lang.IndexOutOfBoundsException
\r
98 _annotationElementList.addElement(vAnnotationElement);
\r
99 } //-- void addAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
102 * Method addAnnotationElement
\r
107 * @param vAnnotationElement
\r
109 public void addAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
110 throws java.lang.IndexOutOfBoundsException
\r
112 _annotationElementList.insertElementAt(vAnnotationElement, index);
\r
113 } //-- void addAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
116 * Method deleteGraph
\r
119 public void deleteGraph()
\r
121 this._has_graph= false;
\r
122 } //-- void deleteGraph()
\r
125 * Method deleteGraphType
\r
128 public void deleteGraphType()
\r
130 this._has_graphType= false;
\r
131 } //-- void deleteGraphType()
\r
134 * Method enumerateAnnotationElement
\r
138 * @return Enumeration
\r
140 public java.util.Enumeration enumerateAnnotationElement()
\r
142 return _annotationElementList.elements();
\r
143 } //-- java.util.Enumeration enumerateAnnotationElement()
\r
146 * Method getAnnotationElement
\r
151 * @return AnnotationElement
\r
153 public jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int index)
\r
154 throws java.lang.IndexOutOfBoundsException
\r
156 //-- check bounds for index
\r
157 if ((index < 0) || (index > _annotationElementList.size())) {
\r
158 throw new IndexOutOfBoundsException();
\r
161 return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
162 } //-- jalview.schemabinding.version2.AnnotationElement getAnnotationElement(int)
\r
165 * Method getAnnotationElement
\r
169 * @return AnnotationElement
\r
171 public jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
173 int size = _annotationElementList.size();
\r
174 jalview.schemabinding.version2.AnnotationElement[] mArray = new jalview.schemabinding.version2.AnnotationElement[size];
\r
175 for (int index = 0; index < size; index++) {
\r
176 mArray[index] = (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.elementAt(index);
\r
179 } //-- jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement()
\r
182 * Method getAnnotationElementCount
\r
188 public int getAnnotationElementCount()
\r
190 return _annotationElementList.size();
\r
191 } //-- int getAnnotationElementCount()
\r
194 * Returns the value of field 'description'.
\r
197 * @return the value of field 'description'.
\r
199 public java.lang.String getDescription()
\r
201 return this._description;
\r
202 } //-- java.lang.String getDescription()
\r
205 * Returns the value of field 'graph'.
\r
208 * @return the value of field 'graph'.
\r
210 public boolean getGraph()
\r
212 return this._graph;
\r
213 } //-- boolean getGraph()
\r
216 * Returns the value of field 'graphType'.
\r
219 * @return the value of field 'graphType'.
\r
221 public int getGraphType()
\r
223 return this._graphType;
\r
224 } //-- int getGraphType()
\r
227 * Returns the value of field 'label'.
\r
230 * @return the value of field 'label'.
\r
232 public java.lang.String getLabel()
\r
234 return this._label;
\r
235 } //-- java.lang.String getLabel()
\r
244 public boolean hasGraph()
\r
246 return this._has_graph;
\r
247 } //-- boolean hasGraph()
\r
250 * Method hasGraphType
\r
256 public boolean hasGraphType()
\r
258 return this._has_graphType;
\r
259 } //-- boolean hasGraphType()
\r
268 public boolean isValid()
\r
273 catch (org.exolab.castor.xml.ValidationException vex) {
\r
277 } //-- boolean isValid()
\r
286 public void marshal(java.io.Writer out)
\r
287 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
290 Marshaller.marshal(this, out);
\r
291 } //-- void marshal(java.io.Writer)
\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
304 Marshaller.marshal(this, handler);
\r
305 } //-- void marshal(org.xml.sax.ContentHandler)
\r
308 * Method removeAllAnnotationElement
\r
311 public void removeAllAnnotationElement()
\r
313 _annotationElementList.removeAllElements();
\r
314 } //-- void removeAllAnnotationElement()
\r
317 * Method removeAnnotationElement
\r
322 * @return AnnotationElement
\r
324 public jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int index)
\r
326 java.lang.Object obj = _annotationElementList.elementAt(index);
\r
327 _annotationElementList.removeElementAt(index);
\r
328 return (jalview.schemabinding.version2.AnnotationElement) obj;
\r
329 } //-- jalview.schemabinding.version2.AnnotationElement removeAnnotationElement(int)
\r
332 * Method setAnnotationElement
\r
337 * @param vAnnotationElement
\r
339 public void setAnnotationElement(int index, jalview.schemabinding.version2.AnnotationElement vAnnotationElement)
\r
340 throws java.lang.IndexOutOfBoundsException
\r
342 //-- check bounds for index
\r
343 if ((index < 0) || (index > _annotationElementList.size())) {
\r
344 throw new IndexOutOfBoundsException();
\r
346 _annotationElementList.setElementAt(vAnnotationElement, index);
\r
347 } //-- void setAnnotationElement(int, jalview.schemabinding.version2.AnnotationElement)
\r
350 * Method setAnnotationElement
\r
354 * @param annotationElementArray
\r
356 public void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement[] annotationElementArray)
\r
359 _annotationElementList.removeAllElements();
\r
360 for (int i = 0; i < annotationElementArray.length; i++) {
\r
361 _annotationElementList.addElement(annotationElementArray[i]);
\r
363 } //-- void setAnnotationElement(jalview.schemabinding.version2.AnnotationElement)
\r
366 * Sets the value of field 'description'.
\r
368 * @param description the value of field 'description'.
\r
370 public void setDescription(java.lang.String description)
\r
372 this._description = description;
\r
373 } //-- void setDescription(java.lang.String)
\r
376 * Sets the value of field 'graph'.
\r
378 * @param graph the value of field 'graph'.
\r
380 public void setGraph(boolean graph)
\r
382 this._graph = graph;
\r
383 this._has_graph = true;
\r
384 } //-- void setGraph(boolean)
\r
387 * Sets the value of field 'graphType'.
\r
389 * @param graphType the value of field 'graphType'.
\r
391 public void setGraphType(int graphType)
\r
393 this._graphType = graphType;
\r
394 this._has_graphType = true;
\r
395 } //-- void setGraphType(int)
\r
398 * Sets the value of field 'label'.
\r
400 * @param label the value of field 'label'.
\r
402 public void setLabel(java.lang.String label)
\r
404 this._label = label;
\r
405 } //-- void setLabel(java.lang.String)
\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
418 return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader);
\r
419 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
425 public void validate()
\r
426 throws org.exolab.castor.xml.ValidationException
\r
428 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
429 validator.validate(this);
\r
430 } //-- void validate()
\r