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.binding;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
16 import org.exolab.castor.xml.*;
\r
21 * @version $Revision$ $Date$
\r
23 public class Annotation
\r
24 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
34 private boolean _graph;
\r
37 * keeps track of state for field: _graph
\r
39 private boolean _has_graph;
\r
42 * Field _annotationElementList
\r
44 private java.util.Vector _annotationElementList;
\r
49 private java.lang.String _label;
\r
52 * Field _description
\r
54 private java.lang.String _description;
\r
63 _annotationElementList = new Vector();
\r
64 } //-- jalview.binding.Annotation()
\r
71 * Method addAnnotationElement
\r
75 * @param vAnnotationElement
\r
77 public void addAnnotationElement(jalview.binding.AnnotationElement
\r
79 throws java.lang.IndexOutOfBoundsException
\r
81 _annotationElementList.addElement(vAnnotationElement);
\r
82 } //-- void addAnnotationElement(jalview.binding.AnnotationElement)
\r
85 * Method addAnnotationElement
\r
90 * @param vAnnotationElement
\r
92 public void addAnnotationElement(int index,
\r
93 jalview.binding.AnnotationElement
\r
95 throws java.lang.IndexOutOfBoundsException
\r
97 _annotationElementList.insertElementAt(vAnnotationElement, index);
\r
98 } //-- void addAnnotationElement(int, jalview.binding.AnnotationElement)
\r
101 * Method deleteGraph
\r
104 public void deleteGraph()
\r
106 this._has_graph = false;
\r
107 } //-- void deleteGraph()
\r
110 * Method enumerateAnnotationElement
\r
114 * @return Enumeration
\r
116 public java.util.Enumeration enumerateAnnotationElement()
\r
118 return _annotationElementList.elements();
\r
119 } //-- java.util.Enumeration enumerateAnnotationElement()
\r
122 * Method getAnnotationElement
\r
127 * @return AnnotationElement
\r
129 public jalview.binding.AnnotationElement getAnnotationElement(int index)
\r
130 throws java.lang.IndexOutOfBoundsException
\r
132 //-- check bounds for index
\r
133 if ( (index < 0) || (index > _annotationElementList.size()))
\r
135 throw new IndexOutOfBoundsException();
\r
138 return (jalview.binding.AnnotationElement) _annotationElementList.elementAt(
\r
140 } //-- jalview.binding.AnnotationElement getAnnotationElement(int)
\r
143 * Method getAnnotationElement
\r
147 * @return AnnotationElement
\r
149 public jalview.binding.AnnotationElement[] getAnnotationElement()
\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
156 mArray[index] = (jalview.binding.AnnotationElement)
\r
157 _annotationElementList.elementAt(index);
\r
160 } //-- jalview.binding.AnnotationElement[] getAnnotationElement()
\r
163 * Method getAnnotationElementCount
\r
169 public int getAnnotationElementCount()
\r
171 return _annotationElementList.size();
\r
172 } //-- int getAnnotationElementCount()
\r
175 * Returns the value of field 'description'.
\r
178 * @return the value of field 'description'.
\r
180 public java.lang.String getDescription()
\r
182 return this._description;
\r
183 } //-- java.lang.String getDescription()
\r
186 * Returns the value of field 'graph'.
\r
189 * @return the value of field 'graph'.
\r
191 public boolean getGraph()
\r
193 return this._graph;
\r
194 } //-- boolean getGraph()
\r
197 * Returns the value of field 'label'.
\r
200 * @return the value of field 'label'.
\r
202 public java.lang.String getLabel()
\r
204 return this._label;
\r
205 } //-- java.lang.String getLabel()
\r
214 public boolean hasGraph()
\r
216 return this._has_graph;
\r
217 } //-- boolean hasGraph()
\r
226 public boolean isValid()
\r
232 catch (org.exolab.castor.xml.ValidationException vex)
\r
237 } //-- boolean isValid()
\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
251 Marshaller.marshal(this, out);
\r
252 } //-- void marshal(java.io.Writer)
\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
266 Marshaller.marshal(this, handler);
\r
267 } //-- void marshal(org.xml.sax.ContentHandler)
\r
270 * Method removeAllAnnotationElement
\r
273 public void removeAllAnnotationElement()
\r
275 _annotationElementList.removeAllElements();
\r
276 } //-- void removeAllAnnotationElement()
\r
279 * Method removeAnnotationElement
\r
284 * @return AnnotationElement
\r
286 public jalview.binding.AnnotationElement removeAnnotationElement(int index)
\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
294 * Method setAnnotationElement
\r
299 * @param vAnnotationElement
\r
301 public void setAnnotationElement(int index,
\r
302 jalview.binding.AnnotationElement
\r
303 vAnnotationElement)
\r
304 throws java.lang.IndexOutOfBoundsException
\r
306 //-- check bounds for index
\r
307 if ( (index < 0) || (index > _annotationElementList.size()))
\r
309 throw new IndexOutOfBoundsException();
\r
311 _annotationElementList.setElementAt(vAnnotationElement, index);
\r
312 } //-- void setAnnotationElement(int, jalview.binding.AnnotationElement)
\r
315 * Method setAnnotationElement
\r
319 * @param annotationElementArray
\r
321 public void setAnnotationElement(jalview.binding.AnnotationElement[]
\r
322 annotationElementArray)
\r
325 _annotationElementList.removeAllElements();
\r
326 for (int i = 0; i < annotationElementArray.length; i++)
\r
328 _annotationElementList.addElement(annotationElementArray[i]);
\r
330 } //-- void setAnnotationElement(jalview.binding.AnnotationElement)
\r
333 * Sets the value of field 'description'.
\r
335 * @param description the value of field 'description'.
\r
337 public void setDescription(java.lang.String description)
\r
339 this._description = description;
\r
340 } //-- void setDescription(java.lang.String)
\r
343 * Sets the value of field 'graph'.
\r
345 * @param graph the value of field 'graph'.
\r
347 public void setGraph(boolean graph)
\r
349 this._graph = graph;
\r
350 this._has_graph = true;
\r
351 } //-- void setGraph(boolean)
\r
354 * Sets the value of field 'label'.
\r
356 * @param label the value of field 'label'.
\r
358 public void setLabel(java.lang.String label)
\r
360 this._label = label;
\r
361 } //-- void setLabel(java.lang.String)
\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
375 return (jalview.binding.Annotation) Unmarshaller.unmarshal(jalview.binding.
\r
376 Annotation.class, reader);
\r
377 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
383 public void validate()
\r
384 throws org.exolab.castor.xml.ValidationException
\r
386 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.
\r
388 validator.validate(this);
\r
389 } //-- void validate()
\r