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