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 DataSetAnnotations.
29 * @version $Revision$ $Date$
31 public class DataSetAnnotations extends org.vamsas.client.Vobject
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _type;
51 * keeps track of state for field: _end
53 private boolean _has_end;
61 * keeps track of state for field: _begin
63 private boolean _has_begin;
68 private java.lang.Object _seqRef;
73 private java.lang.String _id;
78 private java.lang.String _description;
83 private java.lang.String _status;
86 * Field _annotationElementList
88 private java.util.Vector _annotationElementList;
93 private org.vamsas.objects.core.Provenance _provenance;
100 public DataSetAnnotations()
103 _annotationElementList = new Vector();
104 } //-- org.vamsas.objects.core.DataSetAnnotations()
112 * Method addAnnotationElement
116 * @param vAnnotationElement
118 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
119 throws java.lang.IndexOutOfBoundsException
121 _annotationElementList.addElement(vAnnotationElement);
122 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
125 * Method addAnnotationElement
130 * @param vAnnotationElement
132 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
133 throws java.lang.IndexOutOfBoundsException
135 _annotationElementList.insertElementAt(vAnnotationElement, index);
136 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
142 public void deleteBegin()
144 this._has_begin= false;
145 } //-- void deleteBegin()
151 public void deleteEnd()
153 this._has_end= false;
154 } //-- void deleteEnd()
157 * Method enumerateAnnotationElement
161 * @return Enumeration
163 public java.util.Enumeration enumerateAnnotationElement()
165 return _annotationElementList.elements();
166 } //-- java.util.Enumeration enumerateAnnotationElement()
169 * Note: hashCode() has not been overriden
174 public boolean equals(java.lang.Object obj)
179 if (super.equals(obj)==false)
182 if (obj instanceof DataSetAnnotations) {
184 DataSetAnnotations temp = (DataSetAnnotations)obj;
185 if (this._type != null) {
186 if (temp._type == null) return false;
187 else if (!(this._type.equals(temp._type)))
190 else if (temp._type != null)
192 if (this._end != temp._end)
194 if (this._has_end != temp._has_end)
196 if (this._begin != temp._begin)
198 if (this._has_begin != temp._has_begin)
200 if (this._seqRef != null) {
201 if (temp._seqRef == null) return false;
202 else if (!(this._seqRef.equals(temp._seqRef)))
205 else if (temp._seqRef != null)
207 if (this._id != null) {
208 if (temp._id == null) return false;
209 else if (!(this._id.equals(temp._id)))
212 else if (temp._id != null)
214 if (this._description != null) {
215 if (temp._description == null) return false;
216 else if (!(this._description.equals(temp._description)))
219 else if (temp._description != null)
221 if (this._status != null) {
222 if (temp._status == null) return false;
223 else if (!(this._status.equals(temp._status)))
226 else if (temp._status != null)
228 if (this._annotationElementList != null) {
229 if (temp._annotationElementList == null) return false;
230 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
233 else if (temp._annotationElementList != null)
235 if (this._provenance != null) {
236 if (temp._provenance == null) return false;
237 else if (!(this._provenance.equals(temp._provenance)))
240 else if (temp._provenance != null)
245 } //-- boolean equals(java.lang.Object)
248 * Method getAnnotationElement
253 * @return AnnotationElement
255 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
256 throws java.lang.IndexOutOfBoundsException
258 //-- check bounds for index
259 if ((index < 0) || (index > _annotationElementList.size())) {
260 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
263 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
264 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
267 * Method getAnnotationElement
271 * @return AnnotationElement
273 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
275 int size = _annotationElementList.size();
276 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
277 for (int index = 0; index < size; index++) {
278 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
281 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
284 * Method getAnnotationElementCount
290 public int getAnnotationElementCount()
292 return _annotationElementList.size();
293 } //-- int getAnnotationElementCount()
296 * Returns the value of field 'begin'.
299 * @return the value of field 'begin'.
301 public int getBegin()
304 } //-- int getBegin()
307 * Returns the value of field 'description'.
310 * @return the value of field 'description'.
312 public java.lang.String getDescription()
314 return this._description;
315 } //-- java.lang.String getDescription()
318 * Returns the value of field 'end'.
321 * @return the value of field 'end'.
329 * Returns the value of field 'id'.
332 * @return the value of field 'id'.
334 public java.lang.String getId()
337 } //-- java.lang.String getId()
340 * Returns the value of field 'provenance'.
343 * @return the value of field 'provenance'.
345 public org.vamsas.objects.core.Provenance getProvenance()
347 return this._provenance;
348 } //-- org.vamsas.objects.core.Provenance getProvenance()
351 * Returns the value of field 'seqRef'.
354 * @return the value of field 'seqRef'.
356 public java.lang.Object getSeqRef()
359 } //-- java.lang.Object getSeqRef()
362 * Returns the value of field 'status'.
365 * @return the value of field 'status'.
367 public java.lang.String getStatus()
370 } //-- java.lang.String getStatus()
373 * Returns the value of field 'type'.
376 * @return the value of field 'type'.
378 public java.lang.String getType()
381 } //-- java.lang.String getType()
390 public boolean hasBegin()
392 return this._has_begin;
393 } //-- boolean hasBegin()
402 public boolean hasEnd()
404 return this._has_end;
405 } //-- boolean hasEnd()
414 public boolean isValid()
419 catch (org.exolab.castor.xml.ValidationException vex) {
423 } //-- boolean isValid()
432 public void marshal(java.io.Writer out)
433 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
436 Marshaller.marshal(this, out);
437 } //-- void marshal(java.io.Writer)
446 public void marshal(org.xml.sax.ContentHandler handler)
447 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
450 Marshaller.marshal(this, handler);
451 } //-- void marshal(org.xml.sax.ContentHandler)
454 * Method removeAllAnnotationElement
457 public void removeAllAnnotationElement()
459 _annotationElementList.removeAllElements();
460 } //-- void removeAllAnnotationElement()
463 * Method removeAnnotationElement
468 * @return AnnotationElement
470 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
472 java.lang.Object obj = _annotationElementList.elementAt(index);
473 _annotationElementList.removeElementAt(index);
474 return (org.vamsas.objects.core.AnnotationElement) obj;
475 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
478 * Method setAnnotationElement
483 * @param vAnnotationElement
485 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
486 throws java.lang.IndexOutOfBoundsException
488 //-- check bounds for index
489 if ((index < 0) || (index > _annotationElementList.size())) {
490 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
492 _annotationElementList.setElementAt(vAnnotationElement, index);
493 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
496 * Method setAnnotationElement
500 * @param annotationElementArray
502 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
505 _annotationElementList.removeAllElements();
506 for (int i = 0; i < annotationElementArray.length; i++) {
507 _annotationElementList.addElement(annotationElementArray[i]);
509 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
512 * Sets the value of field 'begin'.
514 * @param begin the value of field 'begin'.
516 public void setBegin(int begin)
519 this._has_begin = true;
520 } //-- void setBegin(int)
523 * Sets the value of field 'description'.
525 * @param description the value of field 'description'.
527 public void setDescription(java.lang.String description)
529 this._description = description;
530 } //-- void setDescription(java.lang.String)
533 * Sets the value of field 'end'.
535 * @param end the value of field 'end'.
537 public void setEnd(int end)
540 this._has_end = true;
541 } //-- void setEnd(int)
544 * Sets the value of field 'id'.
546 * @param id the value of field 'id'.
548 public void setId(java.lang.String id)
551 } //-- void setId(java.lang.String)
554 * Sets the value of field 'provenance'.
556 * @param provenance the value of field 'provenance'.
558 public void setProvenance(org.vamsas.objects.core.Provenance provenance)
560 this._provenance = provenance;
561 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
564 * Sets the value of field 'seqRef'.
566 * @param seqRef the value of field 'seqRef'.
568 public void setSeqRef(java.lang.Object seqRef)
570 this._seqRef = seqRef;
571 } //-- void setSeqRef(java.lang.Object)
574 * Sets the value of field 'status'.
576 * @param status the value of field 'status'.
578 public void setStatus(java.lang.String status)
580 this._status = status;
581 } //-- void setStatus(java.lang.String)
584 * Sets the value of field 'type'.
586 * @param type the value of field 'type'.
588 public void setType(java.lang.String type)
591 } //-- void setType(java.lang.String)
599 * @return DataSetAnnotations
601 public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader)
602 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
604 return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader);
605 } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader)
611 public void validate()
612 throws org.exolab.castor.xml.ValidationException
614 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
615 validator.validate(this);
616 } //-- void validate()