2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML
8 package org.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
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;
29 * @version $Revision$ $Date$
31 public class VAMSAS extends org.vamsas.client.object
32 implements java.io.Serializable
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
43 private java.lang.String _id;
48 private java.util.Vector _treeList;
53 private java.util.Vector _dataSetList;
63 _treeList = new Vector();
64 _dataSetList = new Vector();
65 } //-- org.vamsas.objects.core.VAMSAS()
79 public void addDataSet(org.vamsas.objects.core.DataSet vDataSet)
80 throws java.lang.IndexOutOfBoundsException
82 _dataSetList.addElement(vDataSet);
83 } //-- void addDataSet(org.vamsas.objects.core.DataSet)
93 public void addDataSet(int index, org.vamsas.objects.core.DataSet vDataSet)
94 throws java.lang.IndexOutOfBoundsException
96 _dataSetList.insertElementAt(vDataSet, index);
97 } //-- void addDataSet(int, org.vamsas.objects.core.DataSet)
106 public void addTree(org.vamsas.objects.core.Tree vTree)
107 throws java.lang.IndexOutOfBoundsException
109 _treeList.addElement(vTree);
110 } //-- void addTree(org.vamsas.objects.core.Tree)
120 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
121 throws java.lang.IndexOutOfBoundsException
123 _treeList.insertElementAt(vTree, index);
124 } //-- void addTree(int, org.vamsas.objects.core.Tree)
127 * Method enumerateDataSet
131 * @return Enumeration
133 public java.util.Enumeration enumerateDataSet()
135 return _dataSetList.elements();
136 } //-- java.util.Enumeration enumerateDataSet()
139 * Method enumerateTree
143 * @return Enumeration
145 public java.util.Enumeration enumerateTree()
147 return _treeList.elements();
148 } //-- java.util.Enumeration enumerateTree()
151 * Note: hashCode() has not been overriden
156 public boolean equals(java.lang.Object obj)
161 if (super.equals(obj)==false)
164 if (obj instanceof VAMSAS) {
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)))
172 else if (temp._id != null)
174 if (this._treeList != null) {
175 if (temp._treeList == null) return false;
176 else if (!(this._treeList.equals(temp._treeList)))
179 else if (temp._treeList != null)
181 if (this._dataSetList != null) {
182 if (temp._dataSetList == null) return false;
183 else if (!(this._dataSetList.equals(temp._dataSetList)))
186 else if (temp._dataSetList != null)
191 } //-- boolean equals(java.lang.Object)
201 public org.vamsas.objects.core.DataSet getDataSet(int index)
202 throws java.lang.IndexOutOfBoundsException
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()+ "]");
209 return (org.vamsas.objects.core.DataSet) _dataSetList.elementAt(index);
210 } //-- org.vamsas.objects.core.DataSet getDataSet(int)
219 public org.vamsas.objects.core.DataSet[] getDataSet()
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);
227 } //-- org.vamsas.objects.core.DataSet[] getDataSet()
230 * Method getDataSetCount
236 public int getDataSetCount()
238 return _dataSetList.size();
239 } //-- int getDataSetCount()
242 * Returns the value of field 'id'.
245 * @return the value of field 'id'.
247 public java.lang.String getId()
250 } //-- java.lang.String getId()
260 public org.vamsas.objects.core.Tree getTree(int index)
261 throws java.lang.IndexOutOfBoundsException
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()+ "]");
268 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
269 } //-- org.vamsas.objects.core.Tree getTree(int)
278 public org.vamsas.objects.core.Tree[] getTree()
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);
286 } //-- org.vamsas.objects.core.Tree[] getTree()
289 * Method getTreeCount
295 public int getTreeCount()
297 return _treeList.size();
298 } //-- int getTreeCount()
307 public boolean isValid()
312 catch (org.exolab.castor.xml.ValidationException vex) {
316 } //-- boolean isValid()
325 public void marshal(java.io.Writer out)
326 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
329 Marshaller.marshal(this, out);
330 } //-- void marshal(java.io.Writer)
339 public void marshal(org.xml.sax.ContentHandler handler)
340 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
343 Marshaller.marshal(this, handler);
344 } //-- void marshal(org.xml.sax.ContentHandler)
347 * Method removeAllDataSet
350 public void removeAllDataSet()
352 _dataSetList.removeAllElements();
353 } //-- void removeAllDataSet()
356 * Method removeAllTree
359 public void removeAllTree()
361 _treeList.removeAllElements();
362 } //-- void removeAllTree()
365 * Method removeDataSet
372 public org.vamsas.objects.core.DataSet removeDataSet(int index)
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)
387 public org.vamsas.objects.core.Tree removeTree(int index)
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)
402 public void setDataSet(int index, org.vamsas.objects.core.DataSet vDataSet)
403 throws java.lang.IndexOutOfBoundsException
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()+ "]");
409 _dataSetList.setElementAt(vDataSet, index);
410 } //-- void setDataSet(int, org.vamsas.objects.core.DataSet)
417 * @param dataSetArray
419 public void setDataSet(org.vamsas.objects.core.DataSet[] dataSetArray)
422 _dataSetList.removeAllElements();
423 for (int i = 0; i < dataSetArray.length; i++) {
424 _dataSetList.addElement(dataSetArray[i]);
426 } //-- void setDataSet(org.vamsas.objects.core.DataSet)
429 * Sets the value of field 'id'.
431 * @param id the value of field 'id'.
433 public void setId(java.lang.String id)
436 } //-- void setId(java.lang.String)
446 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
447 throws java.lang.IndexOutOfBoundsException
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()+ "]");
453 _treeList.setElementAt(vTree, index);
454 } //-- void setTree(int, org.vamsas.objects.core.Tree)
463 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
466 _treeList.removeAllElements();
467 for (int i = 0; i < treeArray.length; i++) {
468 _treeList.addElement(treeArray[i]);
470 } //-- void setTree(org.vamsas.objects.core.Tree)
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
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)
490 public void validate()
491 throws org.exolab.castor.xml.ValidationException
493 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
494 validator.validate(this);
495 } //-- void validate()