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