2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</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;
53 private java.lang.String _id;
56 * Field _annotationElementList
58 private java.util.Vector _annotationElementList;
63 private java.lang.String _label;
68 private java.lang.String _description;
73 private org.vamsas.objects.core.Provenance _provenance;
80 public AlignmentAnnotations()
83 _annotationElementList = new Vector();
84 } //-- org.vamsas.objects.core.AlignmentAnnotations()
92 * Method addAnnotationElement
96 * @param vAnnotationElement
98 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
99 throws java.lang.IndexOutOfBoundsException
101 _annotationElementList.addElement(vAnnotationElement);
102 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
105 * Method addAnnotationElement
110 * @param vAnnotationElement
112 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
113 throws java.lang.IndexOutOfBoundsException
115 _annotationElementList.insertElementAt(vAnnotationElement, index);
116 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
122 public void deleteGraph()
124 this._has_graph= false;
125 } //-- void deleteGraph()
128 * Method enumerateAnnotationElement
132 * @return Enumeration
134 public java.util.Enumeration enumerateAnnotationElement()
136 return _annotationElementList.elements();
137 } //-- java.util.Enumeration enumerateAnnotationElement()
140 * Note: hashCode() has not been overriden
145 public boolean equals(java.lang.Object obj)
150 if (super.equals(obj)==false)
153 if (obj instanceof AlignmentAnnotations) {
155 AlignmentAnnotations temp = (AlignmentAnnotations)obj;
156 if (this._graph != temp._graph)
158 if (this._has_graph != temp._has_graph)
160 if (this._id != null) {
161 if (temp._id == null) return false;
162 else if (!(this._id.equals(temp._id)))
165 else if (temp._id != null)
167 if (this._annotationElementList != null) {
168 if (temp._annotationElementList == null) return false;
169 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
172 else if (temp._annotationElementList != null)
174 if (this._label != null) {
175 if (temp._label == null) return false;
176 else if (!(this._label.equals(temp._label)))
179 else if (temp._label != null)
181 if (this._description != null) {
182 if (temp._description == null) return false;
183 else if (!(this._description.equals(temp._description)))
186 else if (temp._description != null)
188 if (this._provenance != null) {
189 if (temp._provenance == null) return false;
190 else if (!(this._provenance.equals(temp._provenance)))
193 else if (temp._provenance != null)
198 } //-- boolean equals(java.lang.Object)
201 * Method getAnnotationElement
206 * @return AnnotationElement
208 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
209 throws java.lang.IndexOutOfBoundsException
211 //-- check bounds for index
212 if ((index < 0) || (index > _annotationElementList.size())) {
213 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
216 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
217 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
220 * Method getAnnotationElement
224 * @return AnnotationElement
226 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
228 int size = _annotationElementList.size();
229 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
230 for (int index = 0; index < size; index++) {
231 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
234 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
237 * Method getAnnotationElementCount
243 public int getAnnotationElementCount()
245 return _annotationElementList.size();
246 } //-- int getAnnotationElementCount()
249 * Returns the value of field 'description'.
252 * @return the value of field 'description'.
254 public java.lang.String getDescription()
256 return this._description;
257 } //-- java.lang.String getDescription()
260 * Returns the value of field 'graph'.
263 * @return the value of field 'graph'.
265 public boolean getGraph()
268 } //-- boolean getGraph()
271 * Returns the value of field 'id'.
274 * @return the value of field 'id'.
276 public java.lang.String getId()
279 } //-- java.lang.String getId()
282 * Returns the value of field 'label'.
285 * @return the value of field 'label'.
287 public java.lang.String getLabel()
290 } //-- java.lang.String getLabel()
293 * Returns the value of field 'provenance'.
296 * @return the value of field 'provenance'.
298 public org.vamsas.objects.core.Provenance getProvenance()
300 return this._provenance;
301 } //-- org.vamsas.objects.core.Provenance getProvenance()
310 public boolean hasGraph()
312 return this._has_graph;
313 } //-- boolean hasGraph()
322 public boolean isValid()
327 catch (org.exolab.castor.xml.ValidationException vex) {
331 } //-- boolean isValid()
340 public void marshal(java.io.Writer out)
341 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
344 Marshaller.marshal(this, out);
345 } //-- void marshal(java.io.Writer)
354 public void marshal(org.xml.sax.ContentHandler handler)
355 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
358 Marshaller.marshal(this, handler);
359 } //-- void marshal(org.xml.sax.ContentHandler)
362 * Method removeAllAnnotationElement
365 public void removeAllAnnotationElement()
367 _annotationElementList.removeAllElements();
368 } //-- void removeAllAnnotationElement()
371 * Method removeAnnotationElement
376 * @return AnnotationElement
378 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
380 java.lang.Object obj = _annotationElementList.elementAt(index);
381 _annotationElementList.removeElementAt(index);
382 return (org.vamsas.objects.core.AnnotationElement) obj;
383 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
386 * Method setAnnotationElement
391 * @param vAnnotationElement
393 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
394 throws java.lang.IndexOutOfBoundsException
396 //-- check bounds for index
397 if ((index < 0) || (index > _annotationElementList.size())) {
398 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
400 _annotationElementList.setElementAt(vAnnotationElement, index);
401 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
404 * Method setAnnotationElement
408 * @param annotationElementArray
410 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
413 _annotationElementList.removeAllElements();
414 for (int i = 0; i < annotationElementArray.length; i++) {
415 _annotationElementList.addElement(annotationElementArray[i]);
417 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
420 * Sets the value of field 'description'.
422 * @param description the value of field 'description'.
424 public void setDescription(java.lang.String description)
426 this._description = description;
427 } //-- void setDescription(java.lang.String)
430 * Sets the value of field 'graph'.
432 * @param graph the value of field 'graph'.
434 public void setGraph(boolean graph)
437 this._has_graph = true;
438 } //-- void setGraph(boolean)
441 * Sets the value of field 'id'.
443 * @param id the value of field 'id'.
445 public void setId(java.lang.String id)
448 } //-- void setId(java.lang.String)
451 * Sets the value of field 'label'.
453 * @param label the value of field 'label'.
455 public void setLabel(java.lang.String label)
458 } //-- void setLabel(java.lang.String)
461 * Sets the value of field 'provenance'.
463 * @param provenance the value of field 'provenance'.
465 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
467 this._provenance = provenance;
468 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
476 * @return AlignmentAnnotations
478 public static org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader reader)
479 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
481 return (org.vamsas.objects.core.AlignmentAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentAnnotations.class, reader);
482 } //-- org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader)
488 public void validate()
489 throws org.exolab.castor.xml.ValidationException
491 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
492 validator.validate(this);
493 } //-- void validate()