changed sourcegenerator destination package
[vamsas.git] / src / org / vamsas / objects / core / 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.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 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.objects.core.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.objects.core.SequenceSet vSequenceSet)
75         throws java.lang.IndexOutOfBoundsException
76     {
77         _sequenceSetList.addElement(vSequenceSet);
78     } //-- void addSequenceSet(org.vamsas.objects.core.SequenceSet) 
79
80     /**
81      * Method addSequenceSet
82      * 
83      * 
84      * 
85      * @param index
86      * @param vSequenceSet
87      */
88     public void addSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
89         throws java.lang.IndexOutOfBoundsException
90     {
91         _sequenceSetList.insertElementAt(vSequenceSet, index);
92     } //-- void addSequenceSet(int, org.vamsas.objects.core.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.objects.core.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.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
198     } //-- org.vamsas.objects.core.SequenceSet getSequenceSet(int) 
199
200     /**
201      * Method getSequenceSet
202      * 
203      * 
204      * 
205      * @return SequenceSet
206      */
207     public org.vamsas.objects.core.SequenceSet[] getSequenceSet()
208     {
209         int size = _sequenceSetList.size();
210         org.vamsas.objects.core.SequenceSet[] mArray = new org.vamsas.objects.core.SequenceSet[size];
211         for (int index = 0; index < size; index++) {
212             mArray[index] = (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
213         }
214         return mArray;
215     } //-- org.vamsas.objects.core.SequenceSet[] getSequenceSet() 
216
217     /**
218      * Method getSequenceSetCount
219      * 
220      * 
221      * 
222      * @return int
223      */
224     public int getSequenceSetCount()
225     {
226         return _sequenceSetList.size();
227     } //-- int getSequenceSetCount() 
228
229     /**
230      * Method getTree
231      * 
232      * 
233      * 
234      * @param index
235      * @return String
236      */
237     public java.lang.String getTree(int index)
238         throws java.lang.IndexOutOfBoundsException
239     {
240         //-- check bounds for index
241         if ((index < 0) || (index > _treeList.size())) {
242             throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
243         }
244         
245         return (String)_treeList.elementAt(index);
246     } //-- java.lang.String getTree(int) 
247
248     /**
249      * Method getTree
250      * 
251      * 
252      * 
253      * @return String
254      */
255     public java.lang.String[] getTree()
256     {
257         int size = _treeList.size();
258         java.lang.String[] mArray = new java.lang.String[size];
259         for (int index = 0; index < size; index++) {
260             mArray[index] = (String)_treeList.elementAt(index);
261         }
262         return mArray;
263     } //-- java.lang.String[] getTree() 
264
265     /**
266      * Method getTreeCount
267      * 
268      * 
269      * 
270      * @return int
271      */
272     public int getTreeCount()
273     {
274         return _treeList.size();
275     } //-- int getTreeCount() 
276
277     /**
278      * Method isValid
279      * 
280      * 
281      * 
282      * @return boolean
283      */
284     public boolean isValid()
285     {
286         try {
287             validate();
288         }
289         catch (org.exolab.castor.xml.ValidationException vex) {
290             return false;
291         }
292         return true;
293     } //-- boolean isValid() 
294
295     /**
296      * Method marshal
297      * 
298      * 
299      * 
300      * @param out
301      */
302     public void marshal(java.io.Writer out)
303         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
304     {
305         
306         Marshaller.marshal(this, out);
307     } //-- void marshal(java.io.Writer) 
308
309     /**
310      * Method marshal
311      * 
312      * 
313      * 
314      * @param handler
315      */
316     public void marshal(org.xml.sax.ContentHandler handler)
317         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
318     {
319         
320         Marshaller.marshal(this, handler);
321     } //-- void marshal(org.xml.sax.ContentHandler) 
322
323     /**
324      * Method removeAllSequenceSet
325      * 
326      */
327     public void removeAllSequenceSet()
328     {
329         _sequenceSetList.removeAllElements();
330     } //-- void removeAllSequenceSet() 
331
332     /**
333      * Method removeAllTree
334      * 
335      */
336     public void removeAllTree()
337     {
338         _treeList.removeAllElements();
339     } //-- void removeAllTree() 
340
341     /**
342      * Method removeSequenceSet
343      * 
344      * 
345      * 
346      * @param index
347      * @return SequenceSet
348      */
349     public org.vamsas.objects.core.SequenceSet removeSequenceSet(int index)
350     {
351         java.lang.Object obj = _sequenceSetList.elementAt(index);
352         _sequenceSetList.removeElementAt(index);
353         return (org.vamsas.objects.core.SequenceSet) obj;
354     } //-- org.vamsas.objects.core.SequenceSet removeSequenceSet(int) 
355
356     /**
357      * Method removeTree
358      * 
359      * 
360      * 
361      * @param index
362      * @return String
363      */
364     public java.lang.String removeTree(int index)
365     {
366         java.lang.Object obj = _treeList.elementAt(index);
367         _treeList.removeElementAt(index);
368         return (String)obj;
369     } //-- java.lang.String removeTree(int) 
370
371     /**
372      * Method setSequenceSet
373      * 
374      * 
375      * 
376      * @param index
377      * @param vSequenceSet
378      */
379     public void setSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
380         throws java.lang.IndexOutOfBoundsException
381     {
382         //-- check bounds for index
383         if ((index < 0) || (index > _sequenceSetList.size())) {
384             throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
385         }
386         _sequenceSetList.setElementAt(vSequenceSet, index);
387     } //-- void setSequenceSet(int, org.vamsas.objects.core.SequenceSet) 
388
389     /**
390      * Method setSequenceSet
391      * 
392      * 
393      * 
394      * @param sequenceSetArray
395      */
396     public void setSequenceSet(org.vamsas.objects.core.SequenceSet[] sequenceSetArray)
397     {
398         //-- copy array
399         _sequenceSetList.removeAllElements();
400         for (int i = 0; i < sequenceSetArray.length; i++) {
401             _sequenceSetList.addElement(sequenceSetArray[i]);
402         }
403     } //-- void setSequenceSet(org.vamsas.objects.core.SequenceSet) 
404
405     /**
406      * Method setTree
407      * 
408      * 
409      * 
410      * @param index
411      * @param vTree
412      */
413     public void setTree(int index, java.lang.String vTree)
414         throws java.lang.IndexOutOfBoundsException
415     {
416         //-- check bounds for index
417         if ((index < 0) || (index > _treeList.size())) {
418             throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
419         }
420         _treeList.setElementAt(vTree, index);
421     } //-- void setTree(int, java.lang.String) 
422
423     /**
424      * Method setTree
425      * 
426      * 
427      * 
428      * @param treeArray
429      */
430     public void setTree(java.lang.String[] treeArray)
431     {
432         //-- copy array
433         _treeList.removeAllElements();
434         for (int i = 0; i < treeArray.length; i++) {
435             _treeList.addElement(treeArray[i]);
436         }
437     } //-- void setTree(java.lang.String) 
438
439     /**
440      * Method unmarshal
441      * 
442      * 
443      * 
444      * @param reader
445      * @return VAMSAS
446      */
447     public static org.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader reader)
448         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
449     {
450         return (org.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(org.vamsas.objects.core.VAMSAS.class, reader);
451     } //-- org.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader) 
452
453     /**
454      * Method validate
455      * 
456      */
457     public void validate()
458         throws org.exolab.castor.xml.ValidationException
459     {
460         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
461         validator.validate(this);
462     } //-- void validate() 
463
464 }