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;
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;
91 * Field _provenanceList
93 private java.util.Vector _provenanceList;
100 public DataSetAnnotations()
103 _annotationElementList = new Vector();
104 _provenanceList = new Vector();
105 } //-- org.vamsas.objects.core.DataSetAnnotations()
113 * Method addAnnotationElement
117 * @param vAnnotationElement
119 public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
120 throws java.lang.IndexOutOfBoundsException
122 _annotationElementList.addElement(vAnnotationElement);
123 } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement)
126 * Method addAnnotationElement
131 * @param vAnnotationElement
133 public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
134 throws java.lang.IndexOutOfBoundsException
136 _annotationElementList.insertElementAt(vAnnotationElement, index);
137 } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
140 * Method addProvenance
146 public void addProvenance(org.vamsas.objects.core.Provenance vProvenance)
147 throws java.lang.IndexOutOfBoundsException
149 _provenanceList.addElement(vProvenance);
150 } //-- void addProvenance(org.vamsas.objects.core.Provenance)
153 * Method addProvenance
160 public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
161 throws java.lang.IndexOutOfBoundsException
163 _provenanceList.insertElementAt(vProvenance, index);
164 } //-- void addProvenance(int, org.vamsas.objects.core.Provenance)
170 public void deleteBegin()
172 this._has_begin= false;
173 } //-- void deleteBegin()
179 public void deleteEnd()
181 this._has_end= false;
182 } //-- void deleteEnd()
185 * Method enumerateAnnotationElement
189 * @return Enumeration
191 public java.util.Enumeration enumerateAnnotationElement()
193 return _annotationElementList.elements();
194 } //-- java.util.Enumeration enumerateAnnotationElement()
197 * Method enumerateProvenance
201 * @return Enumeration
203 public java.util.Enumeration enumerateProvenance()
205 return _provenanceList.elements();
206 } //-- java.util.Enumeration enumerateProvenance()
209 * Note: hashCode() has not been overriden
214 public boolean equals(java.lang.Object obj)
219 if (super.equals(obj)==false)
222 if (obj instanceof DataSetAnnotations) {
224 DataSetAnnotations temp = (DataSetAnnotations)obj;
225 if (this._type != null) {
226 if (temp._type == null) return false;
227 else if (!(this._type.equals(temp._type)))
230 else if (temp._type != null)
232 if (this._end != temp._end)
234 if (this._has_end != temp._has_end)
236 if (this._begin != temp._begin)
238 if (this._has_begin != temp._has_begin)
240 if (this._seqRef != null) {
241 if (temp._seqRef == null) return false;
242 else if (!(this._seqRef.equals(temp._seqRef)))
245 else if (temp._seqRef != null)
247 if (this._id != null) {
248 if (temp._id == null) return false;
249 else if (!(this._id.equals(temp._id)))
252 else if (temp._id != null)
254 if (this._description != null) {
255 if (temp._description == null) return false;
256 else if (!(this._description.equals(temp._description)))
259 else if (temp._description != null)
261 if (this._status != null) {
262 if (temp._status == null) return false;
263 else if (!(this._status.equals(temp._status)))
266 else if (temp._status != null)
268 if (this._annotationElementList != null) {
269 if (temp._annotationElementList == null) return false;
270 else if (!(this._annotationElementList.equals(temp._annotationElementList)))
273 else if (temp._annotationElementList != null)
275 if (this._provenanceList != null) {
276 if (temp._provenanceList == null) return false;
277 else if (!(this._provenanceList.equals(temp._provenanceList)))
280 else if (temp._provenanceList != null)
285 } //-- boolean equals(java.lang.Object)
288 * Method getAnnotationElement
293 * @return AnnotationElement
295 public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
296 throws java.lang.IndexOutOfBoundsException
298 //-- check bounds for index
299 if ((index < 0) || (index > _annotationElementList.size())) {
300 throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
303 return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
304 } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int)
307 * Method getAnnotationElement
311 * @return AnnotationElement
313 public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
315 int size = _annotationElementList.size();
316 org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
317 for (int index = 0; index < size; index++) {
318 mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
321 } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
324 * Method getAnnotationElementCount
330 public int getAnnotationElementCount()
332 return _annotationElementList.size();
333 } //-- int getAnnotationElementCount()
336 * Returns the value of field 'begin'.
339 * @return the value of field 'begin'.
341 public int getBegin()
344 } //-- int getBegin()
347 * Returns the value of field 'description'.
350 * @return the value of field 'description'.
352 public java.lang.String getDescription()
354 return this._description;
355 } //-- java.lang.String getDescription()
358 * Returns the value of field 'end'.
361 * @return the value of field 'end'.
369 * Returns the value of field 'id'.
372 * @return the value of field 'id'.
374 public java.lang.String getId()
377 } //-- java.lang.String getId()
380 * Method getProvenance
387 public org.vamsas.objects.core.Provenance getProvenance(int index)
388 throws java.lang.IndexOutOfBoundsException
390 //-- check bounds for index
391 if ((index < 0) || (index > _provenanceList.size())) {
392 throw new IndexOutOfBoundsException("getProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
395 return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
396 } //-- org.vamsas.objects.core.Provenance getProvenance(int)
399 * Method getProvenance
405 public org.vamsas.objects.core.Provenance[] getProvenance()
407 int size = _provenanceList.size();
408 org.vamsas.objects.core.Provenance[] mArray = new org.vamsas.objects.core.Provenance[size];
409 for (int index = 0; index < size; index++) {
410 mArray[index] = (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
413 } //-- org.vamsas.objects.core.Provenance[] getProvenance()
416 * Method getProvenanceCount
422 public int getProvenanceCount()
424 return _provenanceList.size();
425 } //-- int getProvenanceCount()
428 * Returns the value of field 'seqRef'.
431 * @return the value of field 'seqRef'.
433 public java.lang.Object getSeqRef()
436 } //-- java.lang.Object getSeqRef()
439 * Returns the value of field 'status'.
442 * @return the value of field 'status'.
444 public java.lang.String getStatus()
447 } //-- java.lang.String getStatus()
450 * Returns the value of field 'type'.
453 * @return the value of field 'type'.
455 public java.lang.String getType()
458 } //-- java.lang.String getType()
467 public boolean hasBegin()
469 return this._has_begin;
470 } //-- boolean hasBegin()
479 public boolean hasEnd()
481 return this._has_end;
482 } //-- boolean hasEnd()
491 public boolean isValid()
496 catch (org.exolab.castor.xml.ValidationException vex) {
500 } //-- boolean isValid()
509 public void marshal(java.io.Writer out)
510 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
513 Marshaller.marshal(this, out);
514 } //-- void marshal(java.io.Writer)
523 public void marshal(org.xml.sax.ContentHandler handler)
524 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
527 Marshaller.marshal(this, handler);
528 } //-- void marshal(org.xml.sax.ContentHandler)
531 * Method removeAllAnnotationElement
534 public void removeAllAnnotationElement()
536 _annotationElementList.removeAllElements();
537 } //-- void removeAllAnnotationElement()
540 * Method removeAllProvenance
543 public void removeAllProvenance()
545 _provenanceList.removeAllElements();
546 } //-- void removeAllProvenance()
549 * Method removeAnnotationElement
554 * @return AnnotationElement
556 public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
558 java.lang.Object obj = _annotationElementList.elementAt(index);
559 _annotationElementList.removeElementAt(index);
560 return (org.vamsas.objects.core.AnnotationElement) obj;
561 } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int)
564 * Method removeProvenance
571 public org.vamsas.objects.core.Provenance removeProvenance(int index)
573 java.lang.Object obj = _provenanceList.elementAt(index);
574 _provenanceList.removeElementAt(index);
575 return (org.vamsas.objects.core.Provenance) obj;
576 } //-- org.vamsas.objects.core.Provenance removeProvenance(int)
579 * Method setAnnotationElement
584 * @param vAnnotationElement
586 public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
587 throws java.lang.IndexOutOfBoundsException
589 //-- check bounds for index
590 if ((index < 0) || (index > _annotationElementList.size())) {
591 throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
593 _annotationElementList.setElementAt(vAnnotationElement, index);
594 } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement)
597 * Method setAnnotationElement
601 * @param annotationElementArray
603 public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
606 _annotationElementList.removeAllElements();
607 for (int i = 0; i < annotationElementArray.length; i++) {
608 _annotationElementList.addElement(annotationElementArray[i]);
610 } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement)
613 * Sets the value of field 'begin'.
615 * @param begin the value of field 'begin'.
617 public void setBegin(int begin)
620 this._has_begin = true;
621 } //-- void setBegin(int)
624 * Sets the value of field 'description'.
626 * @param description the value of field 'description'.
628 public void setDescription(java.lang.String description)
630 this._description = description;
631 } //-- void setDescription(java.lang.String)
634 * Sets the value of field 'end'.
636 * @param end the value of field 'end'.
638 public void setEnd(int end)
641 this._has_end = true;
642 } //-- void setEnd(int)
645 * Sets the value of field 'id'.
647 * @param id the value of field 'id'.
649 public void setId(java.lang.String id)
652 } //-- void setId(java.lang.String)
655 * Method setProvenance
662 public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
663 throws java.lang.IndexOutOfBoundsException
665 //-- check bounds for index
666 if ((index < 0) || (index > _provenanceList.size())) {
667 throw new IndexOutOfBoundsException("setProvenance: Index value '"+index+"' not in range [0.."+_provenanceList.size()+ "]");
669 _provenanceList.setElementAt(vProvenance, index);
670 } //-- void setProvenance(int, org.vamsas.objects.core.Provenance)
673 * Method setProvenance
677 * @param provenanceArray
679 public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray)
682 _provenanceList.removeAllElements();
683 for (int i = 0; i < provenanceArray.length; i++) {
684 _provenanceList.addElement(provenanceArray[i]);
686 } //-- void setProvenance(org.vamsas.objects.core.Provenance)
689 * Sets the value of field 'seqRef'.
691 * @param seqRef the value of field 'seqRef'.
693 public void setSeqRef(java.lang.Object seqRef)
695 this._seqRef = seqRef;
696 } //-- void setSeqRef(java.lang.Object)
699 * Sets the value of field 'status'.
701 * @param status the value of field 'status'.
703 public void setStatus(java.lang.String status)
705 this._status = status;
706 } //-- void setStatus(java.lang.String)
709 * Sets the value of field 'type'.
711 * @param type the value of field 'type'.
713 public void setType(java.lang.String type)
716 } //-- void setType(java.lang.String)
724 * @return DataSetAnnotations
726 public static org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader reader)
727 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
729 return (org.vamsas.objects.core.DataSetAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.DataSetAnnotations.class, reader);
730 } //-- org.vamsas.objects.core.DataSetAnnotations unmarshal(java.io.Reader)
736 public void validate()
737 throws org.exolab.castor.xml.ValidationException
739 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
740 validator.validate(this);
741 } //-- void validate()