first attempt at object build.
[vamsas.git] / src / org / vamsas / client / objects / 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.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 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.client.objects.Provenance _provenance;
69
70
71       //----------------/
72      //- Constructors -/
73     //----------------/
74
75     public AlignmentAnnotations() 
76      {
77         super();
78         _annotationElementList = new Vector();
79     } //-- org.vamsas.client.objects.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.client.objects.AnnotationElement vAnnotationElement)
94         throws java.lang.IndexOutOfBoundsException
95     {
96         _annotationElementList.addElement(vAnnotationElement);
97     } //-- void addAnnotationElement(org.vamsas.client.objects.AnnotationElement) 
98
99     /**
100      * Method addAnnotationElement
101      * 
102      * 
103      * 
104      * @param index
105      * @param vAnnotationElement
106      */
107     public void addAnnotationElement(int index, org.vamsas.client.objects.AnnotationElement vAnnotationElement)
108         throws java.lang.IndexOutOfBoundsException
109     {
110         _annotationElementList.insertElementAt(vAnnotationElement, index);
111     } //-- void addAnnotationElement(int, org.vamsas.client.objects.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.client.objects.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.client.objects.AnnotationElement) _annotationElementList.elementAt(index);
205     } //-- org.vamsas.client.objects.AnnotationElement getAnnotationElement(int) 
206
207     /**
208      * Method getAnnotationElement
209      * 
210      * 
211      * 
212      * @return AnnotationElement
213      */
214     public org.vamsas.client.objects.AnnotationElement[] getAnnotationElement()
215     {
216         int size = _annotationElementList.size();
217         org.vamsas.client.objects.AnnotationElement[] mArray = new org.vamsas.client.objects.AnnotationElement[size];
218         for (int index = 0; index < size; index++) {
219             mArray[index] = (org.vamsas.client.objects.AnnotationElement) _annotationElementList.elementAt(index);
220         }
221         return mArray;
222     } //-- org.vamsas.client.objects.AnnotationElement[] getAnnotationElement() 
223
224     /**
225      * Method getAnnotationElementAsReference
226      * 
227      * Returns a reference to 'annotationElement'. No type checking
228      * is performed on any modications to the Vector.
229      * 
230      * @return Vector
231      * @return returns a reference to the Vector.
232      */
233     public java.util.Vector getAnnotationElementAsReference()
234     {
235         return _annotationElementList;
236     } //-- java.util.Vector getAnnotationElementAsReference() 
237
238     /**
239      * Method getAnnotationElementCount
240      * 
241      * 
242      * 
243      * @return int
244      */
245     public int getAnnotationElementCount()
246     {
247         return _annotationElementList.size();
248     } //-- int getAnnotationElementCount() 
249
250     /**
251      * Returns the value of field 'description'.
252      * 
253      * @return String
254      * @return the value of field 'description'.
255      */
256     public java.lang.String getDescription()
257     {
258         return this._description;
259     } //-- java.lang.String getDescription() 
260
261     /**
262      * Returns the value of field 'graph'.
263      * 
264      * @return boolean
265      * @return the value of field 'graph'.
266      */
267     public boolean getGraph()
268     {
269         return this._graph;
270     } //-- boolean getGraph() 
271
272     /**
273      * Returns the value of field 'label'.
274      * 
275      * @return String
276      * @return the value of field 'label'.
277      */
278     public java.lang.String getLabel()
279     {
280         return this._label;
281     } //-- java.lang.String getLabel() 
282
283     /**
284      * Returns the value of field 'provenance'.
285      * 
286      * @return Provenance
287      * @return the value of field 'provenance'.
288      */
289     public org.vamsas.client.objects.Provenance getProvenance()
290     {
291         return this._provenance;
292     } //-- org.vamsas.client.objects.Provenance getProvenance() 
293
294     /**
295      * Method hasGraph
296      * 
297      * 
298      * 
299      * @return boolean
300      */
301     public boolean hasGraph()
302     {
303         return this._has_graph;
304     } //-- boolean hasGraph() 
305
306     /**
307      * Method isValid
308      * 
309      * 
310      * 
311      * @return boolean
312      */
313     public boolean isValid()
314     {
315         try {
316             validate();
317         }
318         catch (org.exolab.castor.xml.ValidationException vex) {
319             return false;
320         }
321         return true;
322     } //-- boolean isValid() 
323
324     /**
325      * Method marshal
326      * 
327      * 
328      * 
329      * @param out
330      */
331     public void marshal(java.io.Writer out)
332         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
333     {
334         
335         Marshaller.marshal(this, out);
336     } //-- void marshal(java.io.Writer) 
337
338     /**
339      * Method marshal
340      * 
341      * 
342      * 
343      * @param handler
344      */
345     public void marshal(org.xml.sax.ContentHandler handler)
346         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
347     {
348         
349         Marshaller.marshal(this, handler);
350     } //-- void marshal(org.xml.sax.ContentHandler) 
351
352     /**
353      * Method removeAllAnnotationElement
354      * 
355      */
356     public void removeAllAnnotationElement()
357     {
358         _annotationElementList.removeAllElements();
359     } //-- void removeAllAnnotationElement() 
360
361     /**
362      * Method removeAnnotationElement
363      * 
364      * 
365      * 
366      * @param index
367      * @return AnnotationElement
368      */
369     public org.vamsas.client.objects.AnnotationElement removeAnnotationElement(int index)
370     {
371         java.lang.Object obj = _annotationElementList.elementAt(index);
372         _annotationElementList.removeElementAt(index);
373         return (org.vamsas.client.objects.AnnotationElement) obj;
374     } //-- org.vamsas.client.objects.AnnotationElement removeAnnotationElement(int) 
375
376     /**
377      * Method setAnnotationElement
378      * 
379      * 
380      * 
381      * @param index
382      * @param vAnnotationElement
383      */
384     public void setAnnotationElement(int index, org.vamsas.client.objects.AnnotationElement vAnnotationElement)
385         throws java.lang.IndexOutOfBoundsException
386     {
387         //-- check bounds for index
388         if ((index < 0) || (index > _annotationElementList.size())) {
389             throw new IndexOutOfBoundsException("setAnnotationElement: Index value '"+index+"' not in range [0.."+_annotationElementList.size()+ "]");
390         }
391         _annotationElementList.setElementAt(vAnnotationElement, index);
392     } //-- void setAnnotationElement(int, org.vamsas.client.objects.AnnotationElement) 
393
394     /**
395      * Method setAnnotationElement
396      * 
397      * 
398      * 
399      * @param annotationElementArray
400      */
401     public void setAnnotationElement(org.vamsas.client.objects.AnnotationElement[] annotationElementArray)
402     {
403         //-- copy array
404         _annotationElementList.removeAllElements();
405         for (int i = 0; i < annotationElementArray.length; i++) {
406             _annotationElementList.addElement(annotationElementArray[i]);
407         }
408     } //-- void setAnnotationElement(org.vamsas.client.objects.AnnotationElement) 
409
410     /**
411      * Method setAnnotationElement
412      * 
413      * Sets the value of 'annotationElement' by copying the given
414      * Vector.
415      * 
416      * @param annotationElementVector the Vector to copy.
417      */
418     public void setAnnotationElement(java.util.Vector annotationElementVector)
419     {
420         //-- copy vector
421         _annotationElementList.removeAllElements();
422         for (int i = 0; i < annotationElementVector.size(); i++) {
423             _annotationElementList.addElement((org.vamsas.client.objects.AnnotationElement)annotationElementVector.elementAt(i));
424         }
425     } //-- void setAnnotationElement(java.util.Vector) 
426
427     /**
428      * Method setAnnotationElementAsReference
429      * 
430      * Sets the value of 'annotationElement' by setting it to the
431      * given Vector. No type checking is performed.
432      * 
433      * @param annotationElementVector the Vector to copy.
434      */
435     public void setAnnotationElementAsReference(java.util.Vector annotationElementVector)
436     {
437         _annotationElementList = annotationElementVector;
438     } //-- void setAnnotationElementAsReference(java.util.Vector) 
439
440     /**
441      * Sets the value of field 'description'.
442      * 
443      * @param description the value of field 'description'.
444      */
445     public void setDescription(java.lang.String description)
446     {
447         this._description = description;
448     } //-- void setDescription(java.lang.String) 
449
450     /**
451      * Sets the value of field 'graph'.
452      * 
453      * @param graph the value of field 'graph'.
454      */
455     public void setGraph(boolean graph)
456     {
457         this._graph = graph;
458         this._has_graph = true;
459     } //-- void setGraph(boolean) 
460
461     /**
462      * Sets the value of field 'label'.
463      * 
464      * @param label the value of field 'label'.
465      */
466     public void setLabel(java.lang.String label)
467     {
468         this._label = label;
469     } //-- void setLabel(java.lang.String) 
470
471     /**
472      * Sets the value of field 'provenance'.
473      * 
474      * @param provenance the value of field 'provenance'.
475      */
476     public void setProvenance(org.vamsas.client.objects.Provenance provenance)
477     {
478         this._provenance = provenance;
479     } //-- void setProvenance(org.vamsas.client.objects.Provenance) 
480
481     /**
482      * Method unmarshal
483      * 
484      * 
485      * 
486      * @param reader
487      * @return AlignmentAnnotations
488      */
489     public static org.vamsas.client.objects.AlignmentAnnotations unmarshal(java.io.Reader reader)
490         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
491     {
492         return (org.vamsas.client.objects.AlignmentAnnotations) Unmarshaller.unmarshal(org.vamsas.client.objects.AlignmentAnnotations.class, reader);
493     } //-- org.vamsas.client.objects.AlignmentAnnotations unmarshal(java.io.Reader) 
494
495     /**
496      * Method validate
497      * 
498      */
499     public void validate()
500         throws org.exolab.castor.xml.ValidationException
501     {
502         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
503         validator.validate(this);
504     } //-- void validate() 
505
506 }