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