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.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _type;
48 private java.lang.String _end;
53 private java.lang.String _begin;
58 private java.lang.Object _seqRef;
63 private java.lang.String _id;
68 private java.lang.String _description;
73 private java.lang.String _status;
76 * Field _annotationElementList
78 private java.util.Vector _annotationElementList;
81 * Field _provenanceList
83 private java.util.Vector _provenanceList;
90 public DataSetAnnotations()
93 _annotationElementList = new Vector();
94 _provenanceList = new Vector();
95 } //-- org.vamsas.objects.core.DataSetAnnotations()
103 * Method addAnnotationElement
107 * @param vAnnotationElement
109 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
110 throws java.lang.IndexOutOfBoundsException
112 _annotationElementList.addElement(vAnnotationElement);
113 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
116 * Method addAnnotationElement
121 * @param vAnnotationElement
123 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
124 throws java.lang.IndexOutOfBoundsException
126 _annotationElementList.insertElementAt(vAnnotationElement, index);
127 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
130 * Method addProvenance
136 public void addProvenance(org.vamsas.objects.core.Provenance vProvenance)
137 throws java.lang.IndexOutOfBoundsException
139 _provenanceList.addElement(vProvenance);
140 } //-- void addProvenance(org.vamsas.objects.core.Provenance)
143 * Method addProvenance
150 public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
151 throws java.lang.IndexOutOfBoundsException
153 _provenanceList.insertElementAt(vProvenance, index);
154 } //-- void addProvenance(int, org.vamsas.objects.core.Provenance)
157 * Method enumerateAnnotationElement
161 * @return Enumeration
163 public java.util.Enumeration enumerateAnnotationElement()
165 return _annotationElementList.elements();
166 } //-- java.util.Enumeration enumerateAnnotationElement()
169 * Method enumerateProvenance
173 * @return Enumeration
175 public java.util.Enumeration enumerateProvenance()
177 return _provenanceList.elements();
178 } //-- java.util.Enumeration enumerateProvenance()
181 * Note: hashCode() has not been overriden
186 public boolean equals(java.lang.Object obj)
191 if (super.equals(obj)==false)
194 if (obj instanceof DataSetAnnotations) {
196 DataSetAnnotations temp = (DataSetAnnotations)obj;
197 if (this._type != null) {
198 if (temp._type == null) return false;
199 else if (!(this._type.equals(temp._type)))
202 else if (temp._type != null)
204 if (this._end != null) {
205 if (temp._end == null) return false;
206 else if (!(this._end.equals(temp._end)))
209 else if (temp._end != null)
211 if (this._begin != null) {
212 if (temp._begin == null) return false;
213 else if (!(this._begin.equals(temp._begin)))
216 else if (temp._begin != null)
218 if (this._seqRef != null) {
219 if (temp._seqRef == null) return false;
220 else if (!(this._seqRef.equals(temp._seqRef)))
223 else if (temp._seqRef != null)
225 if (this._id != null) {
226 if (temp._id == null) return false;
227 else if (!(this._id.equals(temp._id)))
230 else if (temp._id != null)
232 if (this._description != null) {
233 if (temp._description == null) return false;
234 else if (!(this._description.equals(temp._description)))
237 else if (temp._description != null)
239 if (this._status != null) {
240 if (temp._status == null) return false;
241 else if (!(this._status.equals(temp._status)))
244 else if (temp._status != null)
246 if (this._annotationElementList != null) {
247 if (temp._annotationElementList == null) return false;
248 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
251 else if (temp._annotationElementList != null)
253 if (this._provenanceList != null) {
254 if (temp._provenanceList == null) return false;
255 else if (!(this._provenanceList.equals(temp._provenanceList)))
258 else if (temp._provenanceList != null)
263 } //-- boolean equals(java.lang.Object)
266 * Method getAnnotationElement
271 * @return AnnotationElement
273 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
274 throws java.lang.IndexOutOfBoundsException
276 //-- check bounds for index
277 if ((index < 0) || (index > _annotationElementList.size())) {
278 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
281 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
282 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
285 * Method getAnnotationElement
289 * @return AnnotationElement
291 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
293 int size = _annotationElementList.size();
294 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
295 for (int index = 0; index < size; index++) {
296 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
299 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
302 * Method getAnnotationElementCount
308 public int getAnnotationElementCount()
310 return _annotationElementList.size();
311 } //-- int getAnnotationElementCount()
314 * Returns the value of field 'begin'.
317 * @return the value of field 'begin'.
319 public java.lang.String getBegin()
322 } //-- java.lang.String getBegin()
325 * Returns the value of field 'description'.
328 * @return the value of field 'description'.
330 public java.lang.String getDescription()
332 return this._description;
333 } //-- java.lang.String getDescription()
336 * Returns the value of field 'end'.
339 * @return the value of field 'end'.
341 public java.lang.String getEnd()
344 } //-- java.lang.String getEnd()
347 * Returns the value of field 'id'.
350 * @return the value of field 'id'.
352 public java.lang.String getId()
355 } //-- java.lang.String getId()
358 * Method getProvenance
365 public org.vamsas.objects.core.Provenance getProvenance(int index)
366 throws java.lang.IndexOutOfBoundsException
368 //-- check bounds for index
369 if ((index < 0) || (index > _provenanceList.size())) {
370 throw new IndexOutOfBoundsException("getProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
373 return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
374 } //-- org.vamsas.objects.core.Provenance getProvenance(int)
377 * Method getProvenance
383 public org.vamsas.objects.core.Provenance[] getProvenance()
385 int size = _provenanceList.size();
386 org.vamsas.objects.core.Provenance[] mArray = new org.vamsas.objects.core.Provenance[size];
387 for (int index = 0; index < size; index++) {
388 mArray[index] = (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
391 } //-- org.vamsas.objects.core.Provenance[] getProvenance()
394 * Method getProvenanceCount
400 public int getProvenanceCount()
402 return _provenanceList.size();
403 } //-- int getProvenanceCount()
406 * Returns the value of field 'seqRef'.
409 * @return the value of field 'seqRef'.
411 public java.lang.Object getSeqRef()
414 } //-- java.lang.Object getSeqRef()
417 * Returns the value of field 'status'.
420 * @return the value of field 'status'.
422 public java.lang.String getStatus()
425 } //-- java.lang.String getStatus()
428 * Returns the value of field 'type'.
431 * @return the value of field 'type'.
433 public java.lang.String getType()
436 } //-- java.lang.String getType()
445 public boolean isValid()
450 catch (org.exolab.castor.xml.ValidationException vex) {
454 } //-- boolean isValid()
463 public void marshal(java.io.Writer out)
464 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
467 Marshaller.marshal(this, out);
468 } //-- void marshal(java.io.Writer)
477 public void marshal(org.xml.sax.ContentHandler handler)
478 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
481 Marshaller.marshal(this, handler);
482 } //-- void marshal(org.xml.sax.ContentHandler)
485 * Method removeAllAnnotationElement
488 public void removeAllAnnotationElement()
490 _annotationElementList.removeAllElements();
491 } //-- void removeAllAnnotationElement()
494 * Method removeAllProvenance
497 public void removeAllProvenance()
499 _provenanceList.removeAllElements();
500 } //-- void removeAllProvenance()
503 * Method removeAnnotationElement
508 * @return AnnotationElement
510 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
512 java.lang.Object obj = _annotationElementList.elementAt(index);
513 _annotationElementList.removeElementAt(index);
514 return (org.vamsas.objects.core.AnnotationElement) obj;
515 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
518 * Method removeProvenance
525 public org.vamsas.objects.core.Provenance removeProvenance(int index)
527 java.lang.Object obj = _provenanceList.elementAt(index);
528 _provenanceList.removeElementAt(index);
529 return (org.vamsas.objects.core.Provenance) obj;
530 } //-- org.vamsas.objects.core.Provenance removeProvenance(int)
533 * Method setAnnotationElement
538 * @param vAnnotationElement
540 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
541 throws java.lang.IndexOutOfBoundsException
543 //-- check bounds for index
544 if ((index < 0) || (index > _annotationElementList.size())) {
545 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
547 _annotationElementList.setElementAt(vAnnotationElement, index);
548 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
551 * Method setAnnotationElement
555 * @param annotationElementArray
557 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
560 _annotationElementList.removeAllElements();
561 for (int i = 0; i < annotationElementArray.length; i++) {
562 _annotationElementList.addElement(annotationElementArray[i]);
564 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
567 * Sets the value of field 'begin'.
569 * @param begin the value of field 'begin'.
571 public void setBegin(java.lang.String begin)
574 } //-- void setBegin(java.lang.String)
577 * Sets the value of field 'description'.
579 * @param description the value of field 'description'.
581 public void setDescription(java.lang.String description)
583 this._description = description;
584 } //-- void setDescription(java.lang.String)
587 * Sets the value of field 'end'.
589 * @param end the value of field 'end'.
591 public void setEnd(java.lang.String end)
594 } //-- void setEnd(java.lang.String)
597 * Sets the value of field 'id'.
599 * @param id the value of field 'id'.
601 public void setId(java.lang.String id)
604 } //-- void setId(java.lang.String)
607 * Method setProvenance
614 public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
615 throws java.lang.IndexOutOfBoundsException
617 //-- check bounds for index
618 if ((index < 0) || (index > _provenanceList.size())) {
619 throw new IndexOutOfBoundsException("setProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
621 _provenanceList.setElementAt(vProvenance, index);
622 } //-- void setProvenance(int, org.vamsas.objects.core.Provenance)
625 * Method setProvenance
629 * @param provenanceArray
631 public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray)
634 _provenanceList.removeAllElements();
635 for (int i = 0; i < provenanceArray.length; i++) {
636 _provenanceList.addElement(provenanceArray[i]);
638 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
641 * Sets the value of field 'seqRef'.
643 * @param seqRef the value of field 'seqRef'.
645 public void setSeqRef(java.lang.Object seqRef)
647 this._seqRef = seqRef;
648 } //-- void setSeqRef(java.lang.Object)
651 * Sets the value of field 'status'.
653 * @param status the value of field 'status'.
655 public void setStatus(java.lang.String status)
657 this._status = status;
658 } //-- void setStatus(java.lang.String)
661 * Sets the value of field 'type'.
663 * @param type the value of field 'type'.
665 public void setType(java.lang.String type)
668 } //-- void setType(java.lang.String)
676 * @return DataSetAnnotations
678 public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader)
679 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
681 return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader);
682 } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader)
688 public void validate()
689 throws org.exolab.castor.xml.ValidationException
691 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
692 validator.validate(this);
693 } //-- void validate()