d67201c37618424dea940f052613b4d71f8432d0
[vamsas.git] / src / org / vamsas / objects / core / DataSetAnnotations.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package org.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
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;
25
26 /**
27  * Class DataSetAnnotations.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class DataSetAnnotations extends org.vamsas.client.Vobject 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _type
42      */
43     private java.lang.String _type;
44
45     /**
46      * Field _end
47      */
48     private int _end;
49
50     /**
51      * keeps track of state for field: _end
52      */
53     private boolean _has_end;
54
55     /**
56      * Field _begin
57      */
58     private int _begin;
59
60     /**
61      * keeps track of state for field: _begin
62      */
63     private boolean _has_begin;
64
65     /**
66      * Field _seqRef
67      */
68     private java.lang.Object _seqRef;
69
70     /**
71      * Field _id
72      */
73     private java.lang.String _id;
74
75     /**
76      * Field _description
77      */
78     private java.lang.String _description;
79
80     /**
81      * Field _status
82      */
83     private java.lang.String _status;
84
85     /**
86      * Field _annotationElementList
87      */
88     private java.util.Vector _annotationElementList;
89
90     /**
91      * Field _provenanceList
92      */
93     private java.util.Vector _provenanceList;
94
95
96       //----------------/
97      //- Constructors -/
98     //----------------/
99
100     public DataSetAnnotations() 
101      {
102         super();
103         _annotationElementList = new Vector();
104         _provenanceList = new Vector();
105     } //-- org.vamsas.objects.core.DataSetAnnotations()
106
107
108       //-----------/
109      //- Methods -/
110     //-----------/
111
112     /**
113      * Method addAnnotationElement
114      * 
115      * 
116      * 
117      * @param vAnnotationElement
118      */
119     public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
120         throws java.lang.IndexOutOfBoundsException
121     {
122         _annotationElementList.addElement(vAnnotationElement);
123     } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
124
125     /**
126      * Method addAnnotationElement
127      * 
128      * 
129      * 
130      * @param index
131      * @param vAnnotationElement
132      */
133     public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
134         throws java.lang.IndexOutOfBoundsException
135     {
136         _annotationElementList.insertElementAt(vAnnotationElement, index);
137     } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
138
139     /**
140      * Method addProvenance
141      * 
142      * 
143      * 
144      * @param vProvenance
145      */
146     public void addProvenance(org.vamsas.objects.core.Provenance vProvenance)
147         throws java.lang.IndexOutOfBoundsException
148     {
149         _provenanceList.addElement(vProvenance);
150     } //-- void addProvenance(org.vamsas.objects.core.Provenance) 
151
152     /**
153      * Method addProvenance
154      * 
155      * 
156      * 
157      * @param index
158      * @param vProvenance
159      */
160     public void addProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
161         throws java.lang.IndexOutOfBoundsException
162     {
163         _provenanceList.insertElementAt(vProvenance, index);
164     } //-- void addProvenance(int, org.vamsas.objects.core.Provenance) 
165
166     /**
167      * Method deleteBegin
168      * 
169      */
170     public void deleteBegin()
171     {
172         this._has_begin= false;
173     } //-- void deleteBegin() 
174
175     /**
176      * Method deleteEnd
177      * 
178      */
179     public void deleteEnd()
180     {
181         this._has_end= false;
182     } //-- void deleteEnd() 
183
184     /**
185      * Method enumerateAnnotationElement
186      * 
187      * 
188      * 
189      * @return Enumeration
190      */
191     public java.util.Enumeration enumerateAnnotationElement()
192     {
193         return _annotationElementList.elements();
194     } //-- java.util.Enumeration enumerateAnnotationElement() 
195
196     /**
197      * Method enumerateProvenance
198      * 
199      * 
200      * 
201      * @return Enumeration
202      */
203     public java.util.Enumeration enumerateProvenance()
204     {
205         return _provenanceList.elements();
206     } //-- java.util.Enumeration enumerateProvenance() 
207
208     /**
209      * Note: hashCode() has not been overriden
210      * 
211      * @param obj
212      * @return boolean
213      */
214     public boolean equals(java.lang.Object obj)
215     {
216         if ( this == obj )
217             return true;
218         
219         if (super.equals(obj)==false)
220             return false;
221         
222         if (obj instanceof DataSetAnnotations) {
223         
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))) 
228                     return false;
229             }
230             else if (temp._type != null)
231                 return false;
232             if (this._end != temp._end)
233                 return false;
234             if (this._has_end != temp._has_end)
235                 return false;
236             if (this._begin != temp._begin)
237                 return false;
238             if (this._has_begin != temp._has_begin)
239                 return false;
240             if (this._seqRef != null) {
241                 if (temp._seqRef == null) return false;
242                 else if (!(this._seqRef.equals(temp._seqRef))) 
243                     return false;
244             }
245             else if (temp._seqRef != null)
246                 return false;
247             if (this._id != null) {
248                 if (temp._id == null) return false;
249                 else if (!(this._id.equals(temp._id))) 
250                     return false;
251             }
252             else if (temp._id != null)
253                 return false;
254             if (this._description != null) {
255                 if (temp._description == null) return false;
256                 else if (!(this._description.equals(temp._description))) 
257                     return false;
258             }
259             else if (temp._description != null)
260                 return false;
261             if (this._status != null) {
262                 if (temp._status == null) return false;
263                 else if (!(this._status.equals(temp._status))) 
264                     return false;
265             }
266             else if (temp._status != null)
267                 return false;
268             if (this._annotationElementList != null) {
269                 if (temp._annotationElementList == null) return false;
270                 else if (!(this._annotationElementList.equals(temp._annotationElementList))) 
271                     return false;
272             }
273             else if (temp._annotationElementList != null)
274                 return false;
275             if (this._provenanceList != null) {
276                 if (temp._provenanceList == null) return false;
277                 else if (!(this._provenanceList.equals(temp._provenanceList))) 
278                     return false;
279             }
280             else if (temp._provenanceList != null)
281                 return false;
282             return true;
283         }
284         return false;
285     } //-- boolean equals(java.lang.Object) 
286
287     /**
288      * Method getAnnotationElement
289      * 
290      * 
291      * 
292      * @param index
293      * @return AnnotationElement
294      */
295     public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
296         throws java.lang.IndexOutOfBoundsException
297     {
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()+ "]");
301         }
302         
303         return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
304     } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) 
305
306     /**
307      * Method getAnnotationElement
308      * 
309      * 
310      * 
311      * @return AnnotationElement
312      */
313     public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
314     {
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);
319         }
320         return mArray;
321     } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() 
322
323     /**
324      * Method getAnnotationElementCount
325      * 
326      * 
327      * 
328      * @return int
329      */
330     public int getAnnotationElementCount()
331     {
332         return _annotationElementList.size();
333     } //-- int getAnnotationElementCount() 
334
335     /**
336      * Returns the value of field 'begin'.
337      * 
338      * @return int
339      * @return the value of field 'begin'.
340      */
341     public int getBegin()
342     {
343         return this._begin;
344     } //-- int getBegin() 
345
346     /**
347      * Returns the value of field 'description'.
348      * 
349      * @return String
350      * @return the value of field 'description'.
351      */
352     public java.lang.String getDescription()
353     {
354         return this._description;
355     } //-- java.lang.String getDescription() 
356
357     /**
358      * Returns the value of field 'end'.
359      * 
360      * @return int
361      * @return the value of field 'end'.
362      */
363     public int getEnd()
364     {
365         return this._end;
366     } //-- int getEnd() 
367
368     /**
369      * Returns the value of field 'id'.
370      * 
371      * @return String
372      * @return the value of field 'id'.
373      */
374     public java.lang.String getId()
375     {
376         return this._id;
377     } //-- java.lang.String getId() 
378
379     /**
380      * Method getProvenance
381      * 
382      * 
383      * 
384      * @param index
385      * @return Provenance
386      */
387     public org.vamsas.objects.core.Provenance getProvenance(int index)
388         throws java.lang.IndexOutOfBoundsException
389     {
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()+ "]");
393         }
394         
395         return (org.vamsas.objects.core.Provenance) _provenanceList.elementAt(index);
396     } //-- org.vamsas.objects.core.Provenance getProvenance(int) 
397
398     /**
399      * Method getProvenance
400      * 
401      * 
402      * 
403      * @return Provenance
404      */
405     public org.vamsas.objects.core.Provenance[] getProvenance()
406     {
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);
411         }
412         return mArray;
413     } //-- org.vamsas.objects.core.Provenance[] getProvenance() 
414
415     /**
416      * Method getProvenanceCount
417      * 
418      * 
419      * 
420      * @return int
421      */
422     public int getProvenanceCount()
423     {
424         return _provenanceList.size();
425     } //-- int getProvenanceCount() 
426
427     /**
428      * Returns the value of field 'seqRef'.
429      * 
430      * @return Object
431      * @return the value of field 'seqRef'.
432      */
433     public java.lang.Object getSeqRef()
434     {
435         return this._seqRef;
436     } //-- java.lang.Object getSeqRef() 
437
438     /**
439      * Returns the value of field 'status'.
440      * 
441      * @return String
442      * @return the value of field 'status'.
443      */
444     public java.lang.String getStatus()
445     {
446         return this._status;
447     } //-- java.lang.String getStatus() 
448
449     /**
450      * Returns the value of field 'type'.
451      * 
452      * @return String
453      * @return the value of field 'type'.
454      */
455     public java.lang.String getType()
456     {
457         return this._type;
458     } //-- java.lang.String getType() 
459
460     /**
461      * Method hasBegin
462      * 
463      * 
464      * 
465      * @return boolean
466      */
467     public boolean hasBegin()
468     {
469         return this._has_begin;
470     } //-- boolean hasBegin() 
471
472     /**
473      * Method hasEnd
474      * 
475      * 
476      * 
477      * @return boolean
478      */
479     public boolean hasEnd()
480     {
481         return this._has_end;
482     } //-- boolean hasEnd() 
483
484     /**
485      * Method isValid
486      * 
487      * 
488      * 
489      * @return boolean
490      */
491     public boolean isValid()
492     {
493         try {
494             validate();
495         }
496         catch (org.exolab.castor.xml.ValidationException vex) {
497             return false;
498         }
499         return true;
500     } //-- boolean isValid() 
501
502     /**
503      * Method marshal
504      * 
505      * 
506      * 
507      * @param out
508      */
509     public void marshal(java.io.Writer out)
510         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
511     {
512         
513         Marshaller.marshal(this, out);
514     } //-- void marshal(java.io.Writer) 
515
516     /**
517      * Method marshal
518      * 
519      * 
520      * 
521      * @param handler
522      */
523     public void marshal(org.xml.sax.ContentHandler handler)
524         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
525     {
526         
527         Marshaller.marshal(this, handler);
528     } //-- void marshal(org.xml.sax.ContentHandler) 
529
530     /**
531      * Method removeAllAnnotationElement
532      * 
533      */
534     public void removeAllAnnotationElement()
535     {
536         _annotationElementList.removeAllElements();
537     } //-- void removeAllAnnotationElement() 
538
539     /**
540      * Method removeAllProvenance
541      * 
542      */
543     public void removeAllProvenance()
544     {
545         _provenanceList.removeAllElements();
546     } //-- void removeAllProvenance() 
547
548     /**
549      * Method removeAnnotationElement
550      * 
551      * 
552      * 
553      * @param index
554      * @return AnnotationElement
555      */
556     public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
557     {
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) 
562
563     /**
564      * Method removeProvenance
565      * 
566      * 
567      * 
568      * @param index
569      * @return Provenance
570      */
571     public org.vamsas.objects.core.Provenance removeProvenance(int index)
572     {
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) 
577
578     /**
579      * Method setAnnotationElement
580      * 
581      * 
582      * 
583      * @param index
584      * @param vAnnotationElement
585      */
586     public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
587         throws java.lang.IndexOutOfBoundsException
588     {
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()+ "]");
592         }
593         _annotationElementList.setElementAt(vAnnotationElement, index);
594     } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
595
596     /**
597      * Method setAnnotationElement
598      * 
599      * 
600      * 
601      * @param annotationElementArray
602      */
603     public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
604     {
605         //-- copy array
606         _annotationElementList.removeAllElements();
607         for (int i = 0; i < annotationElementArray.length; i++) {
608             _annotationElementList.addElement(annotationElementArray[i]);
609         }
610     } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
611
612     /**
613      * Sets the value of field 'begin'.
614      * 
615      * @param begin the value of field 'begin'.
616      */
617     public void setBegin(int begin)
618     {
619         this._begin = begin;
620         this._has_begin = true;
621     } //-- void setBegin(int) 
622
623     /**
624      * Sets the value of field 'description'.
625      * 
626      * @param description the value of field 'description'.
627      */
628     public void setDescription(java.lang.String description)
629     {
630         this._description = description;
631     } //-- void setDescription(java.lang.String) 
632
633     /**
634      * Sets the value of field 'end'.
635      * 
636      * @param end the value of field 'end'.
637      */
638     public void setEnd(int end)
639     {
640         this._end = end;
641         this._has_end = true;
642     } //-- void setEnd(int) 
643
644     /**
645      * Sets the value of field 'id'.
646      * 
647      * @param id the value of field 'id'.
648      */
649     public void setId(java.lang.String id)
650     {
651         this._id = id;
652     } //-- void setId(java.lang.String) 
653
654     /**
655      * Method setProvenance
656      * 
657      * 
658      * 
659      * @param index
660      * @param vProvenance
661      */
662     public void setProvenance(int index, org.vamsas.objects.core.Provenance vProvenance)
663         throws java.lang.IndexOutOfBoundsException
664     {
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()+ "]");
668         }
669         _provenanceList.setElementAt(vProvenance, index);
670     } //-- void setProvenance(int, org.vamsas.objects.core.Provenance) 
671
672     /**
673      * Method setProvenance
674      * 
675      * 
676      * 
677      * @param provenanceArray
678      */
679     public void setProvenance(org.vamsas.objects.core.Provenance[] provenanceArray)
680     {
681         //-- copy array
682         _provenanceList.removeAllElements();
683         for (int i = 0; i < provenanceArray.length; i++) {
684             _provenanceList.addElement(provenanceArray[i]);
685         }
686     } //-- void setProvenance(org.vamsas.objects.core.Provenance) 
687
688     /**
689      * Sets the value of field 'seqRef'.
690      * 
691      * @param seqRef the value of field 'seqRef'.
692      */
693     public void setSeqRef(java.lang.Object seqRef)
694     {
695         this._seqRef = seqRef;
696     } //-- void setSeqRef(java.lang.Object) 
697
698     /**
699      * Sets the value of field 'status'.
700      * 
701      * @param status the value of field 'status'.
702      */
703     public void setStatus(java.lang.String status)
704     {
705         this._status = status;
706     } //-- void setStatus(java.lang.String) 
707
708     /**
709      * Sets the value of field 'type'.
710      * 
711      * @param type the value of field 'type'.
712      */
713     public void setType(java.lang.String type)
714     {
715         this._type = type;
716     } //-- void setType(java.lang.String) 
717
718     /**
719      * Method unmarshal
720      * 
721      * 
722      * 
723      * @param reader
724      * @return DataSetAnnotations
725      */
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
728     {
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) 
731
732     /**
733      * Method validate
734      * 
735      */
736     public void validate()
737         throws org.exolab.castor.xml.ValidationException
738     {
739         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
740         validator.validate(this);
741     } //-- void validate() 
742
743 }