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