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