2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import java.io.IOException;
15 import java.io.Reader;
16 import java.io.Serializable;
17 import java.io.Writer;
18 import java.util.Enumeration;
19 import java.util.Vector;
20 import org.exolab.castor.xml.MarshalException;
21 import org.exolab.castor.xml.Marshaller;
22 import org.exolab.castor.xml.Unmarshaller;
23 import org.exolab.castor.xml.ValidationException;
24 import org.xml.sax.ContentHandler;
27 * Class AlignmentAnnotations.
29 * @version $Revision$ $Date$
31 public class AlignmentAnnotations extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private boolean _graph;
46 * keeps track of state for field: _graph
48 private boolean _has_graph;
51 * Field _annotationElementList
53 private java.util.Vector _annotationElementList;
58 private java.lang.String _label;
63 private java.lang.String _description;
68 private org.vamsas.objects.core.Provenance _provenance;
75 public AlignmentAnnotations()
78 _annotationElementList = new Vector();
79 } //-- org.vamsas.objects.core.AlignmentAnnotations()
87 * Method addAnnotationElement
91 * @param vAnnotationElement
93 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
94 throws java.lang.IndexOutOfBoundsException
96 _annotationElementList.addElement(vAnnotationElement);
97 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
100 * Method addAnnotationElement
105 * @param vAnnotationElement
107 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
108 throws java.lang.IndexOutOfBoundsException
110 _annotationElementList.insertElementAt(vAnnotationElement, index);
111 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
117 public void deleteGraph()
119 this._has_graph= false;
120 } //-- void deleteGraph()
123 * Method enumerateAnnotationElement
127 * @return Enumeration
129 public java.util.Enumeration enumerateAnnotationElement()
131 return _annotationElementList.elements();
132 } //-- java.util.Enumeration enumerateAnnotationElement()
135 * Note: hashCode() has not been overriden
140 public boolean equals(java.lang.Object obj)
145 if (super.equals(obj)==false)
148 if (obj instanceof AlignmentAnnotations) {
150 AlignmentAnnotations temp = (AlignmentAnnotations)obj;
151 if (this._graph != temp._graph)
153 if (this._has_graph != temp._has_graph)
155 if (this._annotationElementList != null) {
156 if (temp._annotationElementList == null) return false;
157 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
160 else if (temp._annotationElementList != null)
162 if (this._label != null) {
163 if (temp._label == null) return false;
164 else if (!(this._label.equals(temp._label)))
167 else if (temp._label != null)
169 if (this._description != null) {
170 if (temp._description == null) return false;
171 else if (!(this._description.equals(temp._description)))
174 else if (temp._description != null)
176 if (this._provenance != null) {
177 if (temp._provenance == null) return false;
178 else if (!(this._provenance.equals(temp._provenance)))
181 else if (temp._provenance != null)
186 } //-- boolean equals(java.lang.Object)
189 * Method getAnnotationElement
194 * @return AnnotationElement
196 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
197 throws java.lang.IndexOutOfBoundsException
199 //-- check bounds for index
200 if ((index < 0) || (index > _annotationElementList.size())) {
201 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
204 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
205 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
208 * Method getAnnotationElement
212 * @return AnnotationElement
214 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
216 int size = _annotationElementList.size();
217 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
218 for (int index = 0; index < size; index++) {
219 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
222 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
225 * Method getAnnotationElementCount
231 public int getAnnotationElementCount()
233 return _annotationElementList.size();
234 } //-- int getAnnotationElementCount()
237 * Returns the value of field 'description'.
240 * @return the value of field 'description'.
242 public java.lang.String getDescription()
244 return this._description;
245 } //-- java.lang.String getDescription()
248 * Returns the value of field 'graph'.
251 * @return the value of field 'graph'.
253 public boolean getGraph()
256 } //-- boolean getGraph()
259 * Returns the value of field 'label'.
262 * @return the value of field 'label'.
264 public java.lang.String getLabel()
267 } //-- java.lang.String getLabel()
270 * Returns the value of field 'provenance'.
273 * @return the value of field 'provenance'.
275 public org.vamsas.objects.core.Provenance getProvenance()
277 return this._provenance;
278 } //-- org.vamsas.objects.core.Provenance getProvenance()
287 public boolean hasGraph()
289 return this._has_graph;
290 } //-- boolean hasGraph()
299 public boolean isValid()
304 catch (org.exolab.castor.xml.ValidationException vex) {
308 } //-- boolean isValid()
317 public void marshal(java.io.Writer out)
318 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
321 Marshaller.marshal(this, out);
322 } //-- void marshal(java.io.Writer)
331 public void marshal(org.xml.sax.ContentHandler handler)
332 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
335 Marshaller.marshal(this, handler);
336 } //-- void marshal(org.xml.sax.ContentHandler)
339 * Method removeAllAnnotationElement
342 public void removeAllAnnotationElement()
344 _annotationElementList.removeAllElements();
345 } //-- void removeAllAnnotationElement()
348 * Method removeAnnotationElement
353 * @return AnnotationElement
355 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
357 java.lang.Object obj = _annotationElementList.elementAt(index);
358 _annotationElementList.removeElementAt(index);
359 return (org.vamsas.objects.core.AnnotationElement) obj;
360 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
363 * Method setAnnotationElement
368 * @param vAnnotationElement
370 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
371 throws java.lang.IndexOutOfBoundsException
373 //-- check bounds for index
374 if ((index < 0) || (index > _annotationElementList.size())) {
375 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
377 _annotationElementList.setElementAt(vAnnotationElement, index);
378 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
381 * Method setAnnotationElement
385 * @param annotationElementArray
387 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
390 _annotationElementList.removeAllElements();
391 for (int i = 0; i < annotationElementArray.length; i++) {
392 _annotationElementList.addElement(annotationElementArray[i]);
394 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
397 * Sets the value of field 'description'.
399 * @param description the value of field 'description'.
401 public void setDescription(java.lang.String description)
403 this._description = description;
404 } //-- void setDescription(java.lang.String)
407 * Sets the value of field 'graph'.
409 * @param graph the value of field 'graph'.
411 public void setGraph(boolean graph)
414 this._has_graph = true;
415 } //-- void setGraph(boolean)
418 * Sets the value of field 'label'.
420 * @param label the value of field 'label'.
422 public void setLabel(java.lang.String label)
425 } //-- void setLabel(java.lang.String)
428 * Sets the value of field 'provenance'.
430 * @param provenance the value of field 'provenance'.
432 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
434 this._provenance = provenance;
435 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
443 * @return AlignmentAnnotations
445 public static org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader reader)
446 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
448 return (org.vamsas.objects.core.AlignmentAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentAnnotations.class, reader);
449 } //-- org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader)
455 public void validate()
456 throws org.exolab.castor.xml.ValidationException
458 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
459 validator.validate(this);
460 } //-- void validate()