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
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
49 * Field _annotationElementList
\r
51 private java.util.Vector _annotationElementList;
\r
56 private java.lang.String _label;
\r
59 * Field _description
\r
61 private java.lang.String _description;
\r
68 public Annotation() {
\r
70 _annotationElementList = new Vector();
\r
71 } //-- jalview.binding.Annotation()
\r
79 * Method addAnnotationElement
\r
83 * @param vAnnotationElement
\r
85 public void addAnnotationElement(jalview.binding.AnnotationElement vAnnotationElement)
\r
86 throws java.lang.IndexOutOfBoundsException
\r
88 _annotationElementList.addElement(vAnnotationElement);
\r
89 } //-- void addAnnotationElement(jalview.binding.AnnotationElement)
\r
92 * Method addAnnotationElement
\r
97 * @param vAnnotationElement
\r
99 public void addAnnotationElement(int index, jalview.binding.AnnotationElement vAnnotationElement)
\r
100 throws java.lang.IndexOutOfBoundsException
\r
102 _annotationElementList.insertElementAt(vAnnotationElement, index);
\r
103 } //-- void addAnnotationElement(int, jalview.binding.AnnotationElement)
\r
106 * Method deleteGraph
\r
109 public void deleteGraph()
\r
111 this._has_graph= false;
\r
112 } //-- void deleteGraph()
\r
115 * Method enumerateAnnotationElement
\r
119 * @return Enumeration
\r
121 public java.util.Enumeration enumerateAnnotationElement()
\r
123 return _annotationElementList.elements();
\r
124 } //-- java.util.Enumeration enumerateAnnotationElement()
\r
127 * Method getAnnotationElement
\r
132 * @return AnnotationElement
\r
134 public jalview.binding.AnnotationElement getAnnotationElement(int index)
\r
135 throws java.lang.IndexOutOfBoundsException
\r
137 //-- check bounds for index
\r
138 if ((index < 0) || (index > _annotationElementList.size())) {
\r
139 throw new IndexOutOfBoundsException();
\r
142 return (jalview.binding.AnnotationElement) _annotationElementList.elementAt(index);
\r
143 } //-- jalview.binding.AnnotationElement getAnnotationElement(int)
\r
146 * Method getAnnotationElement
\r
150 * @return AnnotationElement
\r
152 public jalview.binding.AnnotationElement[] getAnnotationElement()
\r
154 int size = _annotationElementList.size();
\r
155 jalview.binding.AnnotationElement[] mArray = new jalview.binding.AnnotationElement[size];
\r
156 for (int index = 0; index < size; index++) {
\r
157 mArray[index] = (jalview.binding.AnnotationElement) _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
231 catch (org.exolab.castor.xml.ValidationException vex) {
\r
235 } //-- boolean isValid()
\r
244 public void marshal(java.io.Writer out)
\r
245 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
248 Marshaller.marshal(this, out);
\r
249 } //-- void marshal(java.io.Writer)
\r
258 public void marshal(org.xml.sax.ContentHandler handler)
\r
259 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
262 Marshaller.marshal(this, handler);
\r
263 } //-- void marshal(org.xml.sax.ContentHandler)
\r
266 * Method removeAllAnnotationElement
\r
269 public void removeAllAnnotationElement()
\r
271 _annotationElementList.removeAllElements();
\r
272 } //-- void removeAllAnnotationElement()
\r
275 * Method removeAnnotationElement
\r
280 * @return AnnotationElement
\r
282 public jalview.binding.AnnotationElement removeAnnotationElement(int index)
\r
284 java.lang.Object obj = _annotationElementList.elementAt(index);
\r
285 _annotationElementList.removeElementAt(index);
\r
286 return (jalview.binding.AnnotationElement) obj;
\r
287 } //-- jalview.binding.AnnotationElement removeAnnotationElement(int)
\r
290 * Method setAnnotationElement
\r
295 * @param vAnnotationElement
\r
297 public void setAnnotationElement(int index, jalview.binding.AnnotationElement vAnnotationElement)
\r
298 throws java.lang.IndexOutOfBoundsException
\r
300 //-- check bounds for index
\r
301 if ((index < 0) || (index > _annotationElementList.size())) {
\r
302 throw new IndexOutOfBoundsException();
\r
304 _annotationElementList.setElementAt(vAnnotationElement, index);
\r
305 } //-- void setAnnotationElement(int, jalview.binding.AnnotationElement)
\r
308 * Method setAnnotationElement
\r
312 * @param annotationElementArray
\r
314 public void setAnnotationElement(jalview.binding.AnnotationElement[] annotationElementArray)
\r
317 _annotationElementList.removeAllElements();
\r
318 for (int i = 0; i < annotationElementArray.length; i++) {
\r
319 _annotationElementList.addElement(annotationElementArray[i]);
\r
321 } //-- void setAnnotationElement(jalview.binding.AnnotationElement)
\r
324 * Sets the value of field 'description'.
\r
326 * @param description the value of field 'description'.
\r
328 public void setDescription(java.lang.String description)
\r
330 this._description = description;
\r
331 } //-- void setDescription(java.lang.String)
\r
334 * Sets the value of field 'graph'.
\r
336 * @param graph the value of field 'graph'.
\r
338 public void setGraph(boolean graph)
\r
340 this._graph = graph;
\r
341 this._has_graph = true;
\r
342 } //-- void setGraph(boolean)
\r
345 * Sets the value of field 'label'.
\r
347 * @param label the value of field 'label'.
\r
349 public void setLabel(java.lang.String label)
\r
351 this._label = label;
\r
352 } //-- void setLabel(java.lang.String)
\r
362 public static java.lang.Object unmarshal(java.io.Reader reader)
\r
363 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
365 return (jalview.binding.Annotation) Unmarshaller.unmarshal(jalview.binding.Annotation.class, reader);
\r
366 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
372 public void validate()
\r
373 throws org.exolab.castor.xml.ValidationException
\r
375 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
376 validator.validate(this);
\r
377 } //-- void validate()
\r