first attempt at object build.
[vamsas.git] / src / org / vamsas / client / objects / VAMSAS.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 VAMSAS.
28  * 
29  * @version $Revision$ $Date$
30  */
31 public class VAMSAS extends org.vamsas.client.object 
32 implements java.io.Serializable
33 {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _treeList
42      */
43     private java.util.Vector _treeList;
44
45     /**
46      * Field _sequenceSetList
47      */
48     private java.util.Vector _sequenceSetList;
49
50
51       //----------------/
52      //- Constructors -/
53     //----------------/
54
55     public VAMSAS() 
56      {
57         super();
58         _treeList = new Vector();
59         _sequenceSetList = new Vector();
60     } //-- org.vamsas.client.objects.VAMSAS()
61
62
63       //-----------/
64      //- Methods -/
65     //-----------/
66
67     /**
68      * Method addSequenceSet
69      * 
70      * 
71      * 
72      * @param vSequenceSet
73      */
74     public void addSequenceSet(org.vamsas.client.objects.SequenceSet vSequenceSet)
75         throws java.lang.IndexOutOfBoundsException
76     {
77         _sequenceSetList.addElement(vSequenceSet);
78     } //-- void addSequenceSet(org.vamsas.client.objects.SequenceSet) 
79
80     /**
81      * Method addSequenceSet
82      * 
83      * 
84      * 
85      * @param index
86      * @param vSequenceSet
87      */
88     public void addSequenceSet(int index, org.vamsas.client.objects.SequenceSet vSequenceSet)
89         throws java.lang.IndexOutOfBoundsException
90     {
91         _sequenceSetList.insertElementAt(vSequenceSet, index);
92     } //-- void addSequenceSet(int, org.vamsas.client.objects.SequenceSet) 
93
94     /**
95      * Method addTree
96      * 
97      * 
98      * 
99      * @param vTree
100      */
101     public void addTree(java.lang.String vTree)
102         throws java.lang.IndexOutOfBoundsException
103     {
104         _treeList.addElement(vTree);
105     } //-- void addTree(java.lang.String) 
106
107     /**
108      * Method addTree
109      * 
110      * 
111      * 
112      * @param index
113      * @param vTree
114      */
115     public void addTree(int index, java.lang.String vTree)
116         throws java.lang.IndexOutOfBoundsException
117     {
118         _treeList.insertElementAt(vTree, index);
119     } //-- void addTree(int, java.lang.String) 
120
121     /**
122      * Method enumerateSequenceSet
123      * 
124      * 
125      * 
126      * @return Enumeration
127      */
128     public java.util.Enumeration enumerateSequenceSet()
129     {
130         return _sequenceSetList.elements();
131     } //-- java.util.Enumeration enumerateSequenceSet() 
132
133     /**
134      * Method enumerateTree
135      * 
136      * 
137      * 
138      * @return Enumeration
139      */
140     public java.util.Enumeration enumerateTree()
141     {
142         return _treeList.elements();
143     } //-- java.util.Enumeration enumerateTree() 
144
145     /**
146      * Note: hashCode() has not been overriden
147      * 
148      * @param obj
149      * @return boolean
150      */
151     public boolean equals(java.lang.Object obj)
152     {
153         if ( this == obj )
154             return true;
155         
156         if (super.equals(obj)==false)
157             return false;
158         
159         if (obj instanceof VAMSAS) {
160         
161             VAMSAS temp = (VAMSAS)obj;
162             if (this._treeList != null) {
163                 if (temp._treeList == null) return false;
164                 else if (!(this._treeList.equals(temp._treeList))) 
165                     return false;
166             }
167             else if (temp._treeList != null)
168                 return false;
169             if (this._sequenceSetList != null) {
170                 if (temp._sequenceSetList == null) return false;
171                 else if (!(this._sequenceSetList.equals(temp._sequenceSetList))) 
172                     return false;
173             }
174             else if (temp._sequenceSetList != null)
175                 return false;
176             return true;
177         }
178         return false;
179     } //-- boolean equals(java.lang.Object) 
180
181     /**
182      * Method getSequenceSet
183      * 
184      * 
185      * 
186      * @param index
187      * @return SequenceSet
188      */
189     public org.vamsas.client.objects.SequenceSet getSequenceSet(int index)
190         throws java.lang.IndexOutOfBoundsException
191     {
192         //-- check bounds for index
193         if ((index < 0) || (index > _sequenceSetList.size())) {
194             throw new IndexOutOfBoundsException("getSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
195         }
196         
197         return (org.vamsas.client.objects.SequenceSet) _sequenceSetList.elementAt(index);
198     } //-- org.vamsas.client.objects.SequenceSet getSequenceSet(int) 
199
200     /**
201      * Method getSequenceSet
202      * 
203      * 
204      * 
205      * @return SequenceSet
206      */
207     public org.vamsas.client.objects.SequenceSet[] getSequenceSet()
208     {
209         int size = _sequenceSetList.size();
210         org.vamsas.client.objects.SequenceSet[] mArray = new org.vamsas.client.objects.SequenceSet[size];
211         for (int index = 0; index < size; index++) {
212             mArray[index] = (org.vamsas.client.objects.SequenceSet) _sequenceSetList.elementAt(index);
213         }
214         return mArray;
215     } //-- org.vamsas.client.objects.SequenceSet[] getSequenceSet() 
216
217     /**
218      * Method getSequenceSetAsReference
219      * 
220      * Returns a reference to 'sequenceSet'. No type checking is
221      * performed on any modications to the Vector.
222      * 
223      * @return Vector
224      * @return returns a reference to the Vector.
225      */
226     public java.util.Vector getSequenceSetAsReference()
227     {
228         return _sequenceSetList;
229     } //-- java.util.Vector getSequenceSetAsReference() 
230
231     /**
232      * Method getSequenceSetCount
233      * 
234      * 
235      * 
236      * @return int
237      */
238     public int getSequenceSetCount()
239     {
240         return _sequenceSetList.size();
241     } //-- int getSequenceSetCount() 
242
243     /**
244      * Method getTree
245      * 
246      * 
247      * 
248      * @param index
249      * @return String
250      */
251     public java.lang.String getTree(int index)
252         throws java.lang.IndexOutOfBoundsException
253     {
254         //-- check bounds for index
255         if ((index < 0) || (index > _treeList.size())) {
256             throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
257         }
258         
259         return (String)_treeList.elementAt(index);
260     } //-- java.lang.String getTree(int) 
261
262     /**
263      * Method getTree
264      * 
265      * 
266      * 
267      * @return String
268      */
269     public java.lang.String[] getTree()
270     {
271         int size = _treeList.size();
272         java.lang.String[] mArray = new java.lang.String[size];
273         for (int index = 0; index < size; index++) {
274             mArray[index] = (String)_treeList.elementAt(index);
275         }
276         return mArray;
277     } //-- java.lang.String[] getTree() 
278
279     /**
280      * Method getTreeAsReference
281      * 
282      * Returns a reference to 'tree'. No type checking is performed
283      * on any modications to the Vector.
284      * 
285      * @return Vector
286      * @return returns a reference to the Vector.
287      */
288     public java.util.Vector getTreeAsReference()
289     {
290         return _treeList;
291     } //-- java.util.Vector getTreeAsReference() 
292
293     /**
294      * Method getTreeCount
295      * 
296      * 
297      * 
298      * @return int
299      */
300     public int getTreeCount()
301     {
302         return _treeList.size();
303     } //-- int getTreeCount() 
304
305     /**
306      * Method isValid
307      * 
308      * 
309      * 
310      * @return boolean
311      */
312     public boolean isValid()
313     {
314         try {
315             validate();
316         }
317         catch (org.exolab.castor.xml.ValidationException vex) {
318             return false;
319         }
320         return true;
321     } //-- boolean isValid() 
322
323     /**
324      * Method marshal
325      * 
326      * 
327      * 
328      * @param out
329      */
330     public void marshal(java.io.Writer out)
331         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
332     {
333         
334         Marshaller.marshal(this, out);
335     } //-- void marshal(java.io.Writer) 
336
337     /**
338      * Method marshal
339      * 
340      * 
341      * 
342      * @param handler
343      */
344     public void marshal(org.xml.sax.ContentHandler handler)
345         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
346     {
347         
348         Marshaller.marshal(this, handler);
349     } //-- void marshal(org.xml.sax.ContentHandler) 
350
351     /**
352      * Method removeAllSequenceSet
353      * 
354      */
355     public void removeAllSequenceSet()
356     {
357         _sequenceSetList.removeAllElements();
358     } //-- void removeAllSequenceSet() 
359
360     /**
361      * Method removeAllTree
362      * 
363      */
364     public void removeAllTree()
365     {
366         _treeList.removeAllElements();
367     } //-- void removeAllTree() 
368
369     /**
370      * Method removeSequenceSet
371      * 
372      * 
373      * 
374      * @param index
375      * @return SequenceSet
376      */
377     public org.vamsas.client.objects.SequenceSet removeSequenceSet(int index)
378     {
379         java.lang.Object obj = _sequenceSetList.elementAt(index);
380         _sequenceSetList.removeElementAt(index);
381         return (org.vamsas.client.objects.SequenceSet) obj;
382     } //-- org.vamsas.client.objects.SequenceSet removeSequenceSet(int) 
383
384     /**
385      * Method removeTree
386      * 
387      * 
388      * 
389      * @param index
390      * @return String
391      */
392     public java.lang.String removeTree(int index)
393     {
394         java.lang.Object obj = _treeList.elementAt(index);
395         _treeList.removeElementAt(index);
396         return (String)obj;
397     } //-- java.lang.String removeTree(int) 
398
399     /**
400      * Method setSequenceSet
401      * 
402      * 
403      * 
404      * @param index
405      * @param vSequenceSet
406      */
407     public void setSequenceSet(int index, org.vamsas.client.objects.SequenceSet vSequenceSet)
408         throws java.lang.IndexOutOfBoundsException
409     {
410         //-- check bounds for index
411         if ((index < 0) || (index > _sequenceSetList.size())) {
412             throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
413         }
414         _sequenceSetList.setElementAt(vSequenceSet, index);
415     } //-- void setSequenceSet(int, org.vamsas.client.objects.SequenceSet) 
416
417     /**
418      * Method setSequenceSet
419      * 
420      * 
421      * 
422      * @param sequenceSetArray
423      */
424     public void setSequenceSet(org.vamsas.client.objects.SequenceSet[] sequenceSetArray)
425     {
426         //-- copy array
427         _sequenceSetList.removeAllElements();
428         for (int i = 0; i < sequenceSetArray.length; i++) {
429             _sequenceSetList.addElement(sequenceSetArray[i]);
430         }
431     } //-- void setSequenceSet(org.vamsas.client.objects.SequenceSet) 
432
433     /**
434      * Method setSequenceSet
435      * 
436      * Sets the value of 'sequenceSet' by copying the given Vector.
437      * 
438      * @param sequenceSetVector the Vector to copy.
439      */
440     public void setSequenceSet(java.util.Vector sequenceSetVector)
441     {
442         //-- copy vector
443         _sequenceSetList.removeAllElements();
444         for (int i = 0; i < sequenceSetVector.size(); i++) {
445             _sequenceSetList.addElement((org.vamsas.client.objects.SequenceSet)sequenceSetVector.elementAt(i));
446         }
447     } //-- void setSequenceSet(java.util.Vector) 
448
449     /**
450      * Method setSequenceSetAsReference
451      * 
452      * Sets the value of 'sequenceSet' by setting it to the given
453      * Vector. No type checking is performed.
454      * 
455      * @param sequenceSetVector the Vector to copy.
456      */
457     public void setSequenceSetAsReference(java.util.Vector sequenceSetVector)
458     {
459         _sequenceSetList = sequenceSetVector;
460     } //-- void setSequenceSetAsReference(java.util.Vector) 
461
462     /**
463      * Method setTree
464      * 
465      * 
466      * 
467      * @param index
468      * @param vTree
469      */
470     public void setTree(int index, java.lang.String vTree)
471         throws java.lang.IndexOutOfBoundsException
472     {
473         //-- check bounds for index
474         if ((index < 0) || (index > _treeList.size())) {
475             throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
476         }
477         _treeList.setElementAt(vTree, index);
478     } //-- void setTree(int, java.lang.String) 
479
480     /**
481      * Method setTree
482      * 
483      * 
484      * 
485      * @param treeArray
486      */
487     public void setTree(java.lang.String[] treeArray)
488     {
489         //-- copy array
490         _treeList.removeAllElements();
491         for (int i = 0; i < treeArray.length; i++) {
492             _treeList.addElement(treeArray[i]);
493         }
494     } //-- void setTree(java.lang.String) 
495
496     /**
497      * Method setTree
498      * 
499      * Sets the value of 'tree' by copying the given Vector.
500      * 
501      * @param treeVector the Vector to copy.
502      */
503     public void setTree(java.util.Vector treeVector)
504     {
505         //-- copy vector
506         _treeList.removeAllElements();
507         for (int i = 0; i < treeVector.size(); i++) {
508             _treeList.addElement((java.lang.String)treeVector.elementAt(i));
509         }
510     } //-- void setTree(java.util.Vector) 
511
512     /**
513      * Method setTreeAsReference
514      * 
515      * Sets the value of 'tree' by setting it to the given Vector.
516      * No type checking is performed.
517      * 
518      * @param treeVector the Vector to copy.
519      */
520     public void setTreeAsReference(java.util.Vector treeVector)
521     {
522         _treeList = treeVector;
523     } //-- void setTreeAsReference(java.util.Vector) 
524
525     /**
526      * Method unmarshal
527      * 
528      * 
529      * 
530      * @param reader
531      * @return VAMSAS
532      */
533     public static org.vamsas.client.objects.VAMSAS unmarshal(java.io.Reader reader)
534         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
535     {
536         return (org.vamsas.client.objects.VAMSAS) Unmarshaller.unmarshal(org.vamsas.client.objects.VAMSAS.class, reader);
537     } //-- org.vamsas.client.objects.VAMSAS unmarshal(java.io.Reader) 
538
539     /**
540      * Method validate
541      * 
542      */
543     public void validate()
544         throws org.exolab.castor.xml.ValidationException
545     {
546         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
547         validator.validate(this);
548     } //-- void validate() 
549
550 }