52c56e72a02cd311a700fa6a757d8be1e6a29a65
[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 _provenance
92      */
93     private org.vamsas.objects.core.Provenance _provenance;
94
95
96       //----------------/
97      //- Constructors -/
98     //----------------/
99
100     public DataSetAnnotations() 
101      {
102         super();
103         _annotationElementList = new Vector();
104     } //-- org.vamsas.objects.core.DataSetAnnotations()
105
106
107       //-----------/
108      //- Methods -/
109     //-----------/
110
111     /**
112      * Method addAnnotationElement
113      * 
114      * 
115      * 
116      * @param vAnnotationElement
117      */
118     public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
119         throws java.lang.IndexOutOfBoundsException
120     {
121         _annotationElementList.addElement(vAnnotationElement);
122     } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
123
124     /**
125      * Method addAnnotationElement
126      * 
127      * 
128      * 
129      * @param index
130      * @param vAnnotationElement
131      */
132     public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
133         throws java.lang.IndexOutOfBoundsException
134     {
135         _annotationElementList.insertElementAt(vAnnotationElement, index);
136     } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
137
138     /**
139      * Method deleteBegin
140      * 
141      */
142     public void deleteBegin()
143     {
144         this._has_begin= false;
145     } //-- void deleteBegin() 
146
147     /**
148      * Method deleteEnd
149      * 
150      */
151     public void deleteEnd()
152     {
153         this._has_end= false;
154     } //-- void deleteEnd() 
155
156     /**
157      * Method enumerateAnnotationElement
158      * 
159      * 
160      * 
161      * @return Enumeration
162      */
163     public java.util.Enumeration enumerateAnnotationElement()
164     {
165         return _annotationElementList.elements();
166     } //-- java.util.Enumeration enumerateAnnotationElement() 
167
168     /**
169      * Note: hashCode() has not been overriden
170      * 
171      * @param obj
172      * @return boolean
173      */
174     public boolean equals(java.lang.Object obj)
175     {
176         if ( this == obj )
177             return true;
178         
179         if (super.equals(obj)==false)
180             return false;
181         
182         if (obj instanceof DataSetAnnotations) {
183         
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))) 
188                     return false;
189             }
190             else if (temp._type != null)
191                 return false;
192             if (this._end != temp._end)
193                 return false;
194             if (this._has_end != temp._has_end)
195                 return false;
196             if (this._begin != temp._begin)
197                 return false;
198             if (this._has_begin != temp._has_begin)
199                 return false;
200             if (this._seqRef != null) {
201                 if (temp._seqRef == null) return false;
202                 else if (!(this._seqRef.equals(temp._seqRef))) 
203                     return false;
204             }
205             else if (temp._seqRef != null)
206                 return false;
207             if (this._id != null) {
208                 if (temp._id == null) return false;
209                 else if (!(this._id.equals(temp._id))) 
210                     return false;
211             }
212             else if (temp._id != null)
213                 return false;
214             if (this._description != null) {
215                 if (temp._description == null) return false;
216                 else if (!(this._description.equals(temp._description))) 
217                     return false;
218             }
219             else if (temp._description != null)
220                 return false;
221             if (this._status != null) {
222                 if (temp._status == null) return false;
223                 else if (!(this._status.equals(temp._status))) 
224                     return false;
225             }
226             else if (temp._status != null)
227                 return false;
228             if (this._annotationElementList != null) {
229                 if (temp._annotationElementList == null) return false;
230                 else if (!(this._annotationElementList.equals(temp._annotationElementList))) 
231                     return false;
232             }
233             else if (temp._annotationElementList != null)
234                 return false;
235             if (this._provenance != null) {
236                 if (temp._provenance == null) return false;
237                 else if (!(this._provenance.equals(temp._provenance))) 
238                     return false;
239             }
240             else if (temp._provenance != null)
241                 return false;
242             return true;
243         }
244         return false;
245     } //-- boolean equals(java.lang.Object) 
246
247     /**
248      * Method getAnnotationElement
249      * 
250      * 
251      * 
252      * @param index
253      * @return AnnotationElement
254      */
255     public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
256         throws java.lang.IndexOutOfBoundsException
257     {
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()+ "]");
261         }
262         
263         return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
264     } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) 
265
266     /**
267      * Method getAnnotationElement
268      * 
269      * 
270      * 
271      * @return AnnotationElement
272      */
273     public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
274     {
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);
279         }
280         return mArray;
281     } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() 
282
283     /**
284      * Method getAnnotationElementCount
285      * 
286      * 
287      * 
288      * @return int
289      */
290     public int getAnnotationElementCount()
291     {
292         return _annotationElementList.size();
293     } //-- int getAnnotationElementCount() 
294
295     /**
296      * Returns the value of field 'begin'.
297      * 
298      * @return int
299      * @return the value of field 'begin'.
300      */
301     public int getBegin()
302     {
303         return this._begin;
304     } //-- int getBegin() 
305
306     /**
307      * Returns the value of field 'description'.
308      * 
309      * @return String
310      * @return the value of field 'description'.
311      */
312     public java.lang.String getDescription()
313     {
314         return this._description;
315     } //-- java.lang.String getDescription() 
316
317     /**
318      * Returns the value of field 'end'.
319      * 
320      * @return int
321      * @return the value of field 'end'.
322      */
323     public int getEnd()
324     {
325         return this._end;
326     } //-- int getEnd() 
327
328     /**
329      * Returns the value of field 'id'.
330      * 
331      * @return String
332      * @return the value of field 'id'.
333      */
334     public java.lang.String getId()
335     {
336         return this._id;
337     } //-- java.lang.String getId() 
338
339     /**
340      * Returns the value of field 'provenance'.
341      * 
342      * @return Provenance
343      * @return the value of field 'provenance'.
344      */
345     public org.vamsas.objects.core.Provenance getProvenance()
346     {
347         return this._provenance;
348     } //-- org.vamsas.objects.core.Provenance getProvenance() 
349
350     /**
351      * Returns the value of field 'seqRef'.
352      * 
353      * @return Object
354      * @return the value of field 'seqRef'.
355      */
356     public java.lang.Object getSeqRef()
357     {
358         return this._seqRef;
359     } //-- java.lang.Object getSeqRef() 
360
361     /**
362      * Returns the value of field 'status'.
363      * 
364      * @return String
365      * @return the value of field 'status'.
366      */
367     public java.lang.String getStatus()
368     {
369         return this._status;
370     } //-- java.lang.String getStatus() 
371
372     /**
373      * Returns the value of field 'type'.
374      * 
375      * @return String
376      * @return the value of field 'type'.
377      */
378     public java.lang.String getType()
379     {
380         return this._type;
381     } //-- java.lang.String getType() 
382
383     /**
384      * Method hasBegin
385      * 
386      * 
387      * 
388      * @return boolean
389      */
390     public boolean hasBegin()
391     {
392         return this._has_begin;
393     } //-- boolean hasBegin() 
394
395     /**
396      * Method hasEnd
397      * 
398      * 
399      * 
400      * @return boolean
401      */
402     public boolean hasEnd()
403     {
404         return this._has_end;
405     } //-- boolean hasEnd() 
406
407     /**
408      * Method isValid
409      * 
410      * 
411      * 
412      * @return boolean
413      */
414     public boolean isValid()
415     {
416         try {
417             validate();
418         }
419         catch (org.exolab.castor.xml.ValidationException vex) {
420             return false;
421         }
422         return true;
423     } //-- boolean isValid() 
424
425     /**
426      * Method marshal
427      * 
428      * 
429      * 
430      * @param out
431      */
432     public void marshal(java.io.Writer out)
433         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
434     {
435         
436         Marshaller.marshal(this, out);
437     } //-- void marshal(java.io.Writer) 
438
439     /**
440      * Method marshal
441      * 
442      * 
443      * 
444      * @param handler
445      */
446     public void marshal(org.xml.sax.ContentHandler handler)
447         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
448     {
449         
450         Marshaller.marshal(this, handler);
451     } //-- void marshal(org.xml.sax.ContentHandler) 
452
453     /**
454      * Method removeAllAnnotationElement
455      * 
456      */
457     public void removeAllAnnotationElement()
458     {
459         _annotationElementList.removeAllElements();
460     } //-- void removeAllAnnotationElement() 
461
462     /**
463      * Method removeAnnotationElement
464      * 
465      * 
466      * 
467      * @param index
468      * @return AnnotationElement
469      */
470     public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
471     {
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) 
476
477     /**
478      * Method setAnnotationElement
479      * 
480      * 
481      * 
482      * @param index
483      * @param vAnnotationElement
484      */
485     public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
486         throws java.lang.IndexOutOfBoundsException
487     {
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()+ "]");
491         }
492         _annotationElementList.setElementAt(vAnnotationElement, index);
493     } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
494
495     /**
496      * Method setAnnotationElement
497      * 
498      * 
499      * 
500      * @param annotationElementArray
501      */
502     public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
503     {
504         //-- copy array
505         _annotationElementList.removeAllElements();
506         for (int i = 0; i < annotationElementArray.length; i++) {
507             _annotationElementList.addElement(annotationElementArray[i]);
508         }
509     } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
510
511     /**
512      * Sets the value of field 'begin'.
513      * 
514      * @param begin the value of field 'begin'.
515      */
516     public void setBegin(int begin)
517     {
518         this._begin = begin;
519         this._has_begin = true;
520     } //-- void setBegin(int) 
521
522     /**
523      * Sets the value of field 'description'.
524      * 
525      * @param description the value of field 'description'.
526      */
527     public void setDescription(java.lang.String description)
528     {
529         this._description = description;
530     } //-- void setDescription(java.lang.String) 
531
532     /**
533      * Sets the value of field 'end'.
534      * 
535      * @param end the value of field 'end'.
536      */
537     public void setEnd(int end)
538     {
539         this._end = end;
540         this._has_end = true;
541     } //-- void setEnd(int) 
542
543     /**
544      * Sets the value of field 'id'.
545      * 
546      * @param id the value of field 'id'.
547      */
548     public void setId(java.lang.String id)
549     {
550         this._id = id;
551     } //-- void setId(java.lang.String) 
552
553     /**
554      * Sets the value of field 'provenance'.
555      * 
556      * @param provenance the value of field 'provenance'.
557      */
558     public void setProvenance(org.vamsas.objects.core.Provenance provenance)
559     {
560         this._provenance = provenance;
561     } //-- void setProvenance(org.vamsas.objects.core.Provenance) 
562
563     /**
564      * Sets the value of field 'seqRef'.
565      * 
566      * @param seqRef the value of field 'seqRef'.
567      */
568     public void setSeqRef(java.lang.Object seqRef)
569     {
570         this._seqRef = seqRef;
571     } //-- void setSeqRef(java.lang.Object) 
572
573     /**
574      * Sets the value of field 'status'.
575      * 
576      * @param status the value of field 'status'.
577      */
578     public void setStatus(java.lang.String status)
579     {
580         this._status = status;
581     } //-- void setStatus(java.lang.String) 
582
583     /**
584      * Sets the value of field 'type'.
585      * 
586      * @param type the value of field 'type'.
587      */
588     public void setType(java.lang.String type)
589     {
590         this._type = type;
591     } //-- void setType(java.lang.String) 
592
593     /**
594      * Method unmarshal
595      * 
596      * 
597      * 
598      * @param reader
599      * @return DataSetAnnotations
600      */
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
603     {
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) 
606
607     /**
608      * Method validate
609      * 
610      */
611     public void validate()
612         throws org.exolab.castor.xml.ValidationException
613     {
614         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
615         validator.validate(this);
616     } //-- void validate() 
617
618 }