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