changed sourcegenerator destination package
[vamsas.git] / src / org / vamsas / objects / core / AlignmentAnnotations.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.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 AlignmentAnnotations.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class AlignmentAnnotations extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _graph
42      */
43     private boolean _graph;
44
45     /**
46      * keeps track of state for field: _graph
47      */
48     private boolean _has_graph;
49
50     /**
51      * Field _annotationElementList
52      */
53     private java.util.Vector _annotationElementList;
54
55     /**
56      * Field _label
57      */
58     private java.lang.String _label;
59
60     /**
61      * Field _description
62      */
63     private java.lang.String _description;
64
65     /**
66      * Field _provenance
67      */
68     private org.vamsas.objects.core.Provenance _provenance;
69
70
71       //----------------/
72      //- Constructors -/
73     //----------------/
74
75     public AlignmentAnnotations() 
76      {
77         super();
78         _annotationElementList = new Vector();
79     } //-- org.vamsas.objects.core.AlignmentAnnotations()
80
81
82       //-----------/
83      //- Methods -/
84     //-----------/
85
86     /**
87      * Method addAnnotationElement
88      * 
89      * 
90      * 
91      * @param vAnnotationElement
92      */
93     public void addAnnotationElement(org.vamsas.objects.core.AnnotationElement vAnnotationElement)
94         throws java.lang.IndexOutOfBoundsException
95     {
96         _annotationElementList.addElement(vAnnotationElement);
97     } //-- void addAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
98
99     /**
100      * Method addAnnotationElement
101      * 
102      * 
103      * 
104      * @param index
105      * @param vAnnotationElement
106      */
107     public void addAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
108         throws java.lang.IndexOutOfBoundsException
109     {
110         _annotationElementList.insertElementAt(vAnnotationElement, index);
111     } //-- void addAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
112
113     /**
114      * Method deleteGraph
115      * 
116      */
117     public void deleteGraph()
118     {
119         this._has_graph= false;
120     } //-- void deleteGraph() 
121
122     /**
123      * Method enumerateAnnotationElement
124      * 
125      * 
126      * 
127      * @return Enumeration
128      */
129     public java.util.Enumeration enumerateAnnotationElement()
130     {
131         return _annotationElementList.elements();
132     } //-- java.util.Enumeration enumerateAnnotationElement() 
133
134     /**
135      * Note: hashCode() has not been overriden
136      * 
137      * @param obj
138      * @return boolean
139      */
140     public boolean equals(java.lang.Object obj)
141     {
142         if ( this == obj )
143             return true;
144         
145         if (super.equals(obj)==false)
146             return false;
147         
148         if (obj instanceof AlignmentAnnotations) {
149         
150             AlignmentAnnotations temp = (AlignmentAnnotations)obj;
151             if (this._graph != temp._graph)
152                 return false;
153             if (this._has_graph != temp._has_graph)
154                 return false;
155             if (this._annotationElementList != null) {
156                 if (temp._annotationElementList == null) return false;
157                 else if (!(this._annotationElementList.equals(temp._annotationElementList))) 
158                     return false;
159             }
160             else if (temp._annotationElementList != null)
161                 return false;
162             if (this._label != null) {
163                 if (temp._label == null) return false;
164                 else if (!(this._label.equals(temp._label))) 
165                     return false;
166             }
167             else if (temp._label != null)
168                 return false;
169             if (this._description != null) {
170                 if (temp._description == null) return false;
171                 else if (!(this._description.equals(temp._description))) 
172                     return false;
173             }
174             else if (temp._description != null)
175                 return false;
176             if (this._provenance != null) {
177                 if (temp._provenance == null) return false;
178                 else if (!(this._provenance.equals(temp._provenance))) 
179                     return false;
180             }
181             else if (temp._provenance != null)
182                 return false;
183             return true;
184         }
185         return false;
186     } //-- boolean equals(java.lang.Object) 
187
188     /**
189      * Method getAnnotationElement
190      * 
191      * 
192      * 
193      * @param index
194      * @return AnnotationElement
195      */
196     public org.vamsas.objects.core.AnnotationElement getAnnotationElement(int index)
197         throws java.lang.IndexOutOfBoundsException
198     {
199         //-- check bounds for index
200         if ((index < 0) || (index > _annotationElementList.size())) {
201             throw new IndexOutOfBoundsException("getAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
202         }
203         
204         return (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
205     } //-- org.vamsas.objects.core.AnnotationElement getAnnotationElement(int) 
206
207     /**
208      * Method getAnnotationElement
209      * 
210      * 
211      * 
212      * @return AnnotationElement
213      */
214     public org.vamsas.objects.core.AnnotationElement[] getAnnotationElement()
215     {
216         int size = _annotationElementList.size();
217         org.vamsas.objects.core.AnnotationElement[] mArray = new org.vamsas.objects.core.AnnotationElement[size];
218         for (int index = 0; index < size; index++) {
219             mArray[index] = (org.vamsas.objects.core.AnnotationElement) _annotationElementList.elementAt(index);
220         }
221         return mArray;
222     } //-- org.vamsas.objects.core.AnnotationElement[] getAnnotationElement() 
223
224     /**
225      * Method getAnnotationElementCount
226      * 
227      * 
228      * 
229      * @return int
230      */
231     public int getAnnotationElementCount()
232     {
233         return _annotationElementList.size();
234     } //-- int getAnnotationElementCount() 
235
236     /**
237      * Returns the value of field 'description'.
238      * 
239      * @return String
240      * @return the value of field 'description'.
241      */
242     public java.lang.String getDescription()
243     {
244         return this._description;
245     } //-- java.lang.String getDescription() 
246
247     /**
248      * Returns the value of field 'graph'.
249      * 
250      * @return boolean
251      * @return the value of field 'graph'.
252      */
253     public boolean getGraph()
254     {
255         return this._graph;
256     } //-- boolean getGraph() 
257
258     /**
259      * Returns the value of field 'label'.
260      * 
261      * @return String
262      * @return the value of field 'label'.
263      */
264     public java.lang.String getLabel()
265     {
266         return this._label;
267     } //-- java.lang.String getLabel() 
268
269     /**
270      * Returns the value of field 'provenance'.
271      * 
272      * @return Provenance
273      * @return the value of field 'provenance'.
274      */
275     public org.vamsas.objects.core.Provenance getProvenance()
276     {
277         return this._provenance;
278     } //-- org.vamsas.objects.core.Provenance getProvenance() 
279
280     /**
281      * Method hasGraph
282      * 
283      * 
284      * 
285      * @return boolean
286      */
287     public boolean hasGraph()
288     {
289         return this._has_graph;
290     } //-- boolean hasGraph() 
291
292     /**
293      * Method isValid
294      * 
295      * 
296      * 
297      * @return boolean
298      */
299     public boolean isValid()
300     {
301         try {
302             validate();
303         }
304         catch (org.exolab.castor.xml.ValidationException vex) {
305             return false;
306         }
307         return true;
308     } //-- boolean isValid() 
309
310     /**
311      * Method marshal
312      * 
313      * 
314      * 
315      * @param out
316      */
317     public void marshal(java.io.Writer out)
318         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
319     {
320         
321         Marshaller.marshal(this, out);
322     } //-- void marshal(java.io.Writer) 
323
324     /**
325      * Method marshal
326      * 
327      * 
328      * 
329      * @param handler
330      */
331     public void marshal(org.xml.sax.ContentHandler handler)
332         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
333     {
334         
335         Marshaller.marshal(this, handler);
336     } //-- void marshal(org.xml.sax.ContentHandler) 
337
338     /**
339      * Method removeAllAnnotationElement
340      * 
341      */
342     public void removeAllAnnotationElement()
343     {
344         _annotationElementList.removeAllElements();
345     } //-- void removeAllAnnotationElement() 
346
347     /**
348      * Method removeAnnotationElement
349      * 
350      * 
351      * 
352      * @param index
353      * @return AnnotationElement
354      */
355     public org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int index)
356     {
357         java.lang.Object obj = _annotationElementList.elementAt(index);
358         _annotationElementList.removeElementAt(index);
359         return (org.vamsas.objects.core.AnnotationElement) obj;
360     } //-- org.vamsas.objects.core.AnnotationElement removeAnnotationElement(int) 
361
362     /**
363      * Method setAnnotationElement
364      * 
365      * 
366      * 
367      * @param index
368      * @param vAnnotationElement
369      */
370     public void setAnnotationElement(int index, org.vamsas.objects.core.AnnotationElement vAnnotationElement)
371         throws java.lang.IndexOutOfBoundsException
372     {
373         //-- check bounds for index
374         if ((index < 0) || (index > _annotationElementList.size())) {
375             throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
376         }
377         _annotationElementList.setElementAt(vAnnotationElement, index);
378     } //-- void setAnnotationElement(int, org.vamsas.objects.core.AnnotationElement) 
379
380     /**
381      * Method setAnnotationElement
382      * 
383      * 
384      * 
385      * @param annotationElementArray
386      */
387     public void setAnnotationElement(org.vamsas.objects.core.AnnotationElement[] annotationElementArray)
388     {
389         //-- copy array
390         _annotationElementList.removeAllElements();
391         for (int i = 0; i < annotationElementArray.length; i++) {
392             _annotationElementList.addElement(annotationElementArray[i]);
393         }
394     } //-- void setAnnotationElement(org.vamsas.objects.core.AnnotationElement) 
395
396     /**
397      * Sets the value of field 'description'.
398      * 
399      * @param description the value of field 'description'.
400      */
401     public void setDescription(java.lang.String description)
402     {
403         this._description = description;
404     } //-- void setDescription(java.lang.String) 
405
406     /**
407      * Sets the value of field 'graph'.
408      * 
409      * @param graph the value of field 'graph'.
410      */
411     public void setGraph(boolean graph)
412     {
413         this._graph = graph;
414         this._has_graph = true;
415     } //-- void setGraph(boolean) 
416
417     /**
418      * Sets the value of field 'label'.
419      * 
420      * @param label the value of field 'label'.
421      */
422     public void setLabel(java.lang.String label)
423     {
424         this._label = label;
425     } //-- void setLabel(java.lang.String) 
426
427     /**
428      * Sets the value of field 'provenance'.
429      * 
430      * @param provenance the value of field 'provenance'.
431      */
432     public void setProvenance(org.vamsas.objects.core.Provenance provenance)
433     {
434         this._provenance = provenance;
435     } //-- void setProvenance(org.vamsas.objects.core.Provenance) 
436
437     /**
438      * Method unmarshal
439      * 
440      * 
441      * 
442      * @param reader
443      * @return AlignmentAnnotations
444      */
445     public static org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader reader)
446         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
447     {
448         return (org.vamsas.objects.core.AlignmentAnnotations) Unmarshaller.unmarshal(org.vamsas.objects.core.AlignmentAnnotations.class, reader);
449     } //-- org.vamsas.objects.core.AlignmentAnnotations unmarshal(java.io.Reader) 
450
451     /**
452      * Method validate
453      * 
454      */
455     public void validate()
456         throws org.exolab.castor.xml.ValidationException
457     {
458         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
459         validator.validate(this);
460     } //-- void validate() 
461
462 }