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;
27 * contains unassociated trees and a number of analysis
31 * @version $Revision$ $Date$
33 public class VAMSAS extends org.vamsas.client.Vobject
34 implements java.io.Serializable
38 //--------------------------/
39 //- Class/Member Variables -/
40 //--------------------------/
43 * Primary Key for vamsas object referencing
46 private java.lang.String _id;
49 * objects with modifiable=false will not be
50 * modified by a vamsas client update
53 private boolean _modifiable = true;
56 * keeps track of state for field: _modifiable
58 private boolean _has_modifiable;
63 private java.util.Vector _treeList;
68 private java.util.Vector _dataSetList;
78 _treeList = new Vector();
79 _dataSetList = new Vector();
80 } //-- org.vamsas.objects.core.VAMSAS()
94 public void addDataSet(org.vamsas.objects.core.DataSet vDataSet)
95 throws java.lang.IndexOutOfBoundsException
97 _dataSetList.addElement(vDataSet);
98 } //-- void addDataSet(org.vamsas.objects.core.DataSet)
108 public void addDataSet(int index, org.vamsas.objects.core.DataSet vDataSet)
109 throws java.lang.IndexOutOfBoundsException
111 _dataSetList.insertElementAt(vDataSet, index);
112 } //-- void addDataSet(int, org.vamsas.objects.core.DataSet)
121 public void addTree(org.vamsas.objects.core.Tree vTree)
122 throws java.lang.IndexOutOfBoundsException
124 _treeList.addElement(vTree);
125 } //-- void addTree(org.vamsas.objects.core.Tree)
135 public void addTree(int index, org.vamsas.objects.core.Tree vTree)
136 throws java.lang.IndexOutOfBoundsException
138 _treeList.insertElementAt(vTree, index);
139 } //-- void addTree(int, org.vamsas.objects.core.Tree)
142 * Method deleteModifiable
145 public void deleteModifiable()
147 this._has_modifiable= false;
148 } //-- void deleteModifiable()
151 * Method enumerateDataSet
155 * @return Enumeration
157 public java.util.Enumeration enumerateDataSet()
159 return _dataSetList.elements();
160 } //-- java.util.Enumeration enumerateDataSet()
163 * Method enumerateTree
167 * @return Enumeration
169 public java.util.Enumeration enumerateTree()
171 return _treeList.elements();
172 } //-- java.util.Enumeration enumerateTree()
175 * Note: hashCode() has not been overriden
180 public boolean equals(java.lang.Object obj)
185 if (super.equals(obj)==false)
188 if (obj instanceof VAMSAS) {
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)))
196 else if (temp._id != null)
198 if (this._modifiable != temp._modifiable)
200 if (this._has_modifiable != temp._has_modifiable)
202 if (this._treeList != null) {
203 if (temp._treeList == null) return false;
204 else if (!(this._treeList.equals(temp._treeList)))
207 else if (temp._treeList != null)
209 if (this._dataSetList != null) {
210 if (temp._dataSetList == null) return false;
211 else if (!(this._dataSetList.equals(temp._dataSetList)))
214 else if (temp._dataSetList != null)
219 } //-- boolean equals(java.lang.Object)
229 public org.vamsas.objects.core.DataSet getDataSet(int index)
230 throws java.lang.IndexOutOfBoundsException
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()+ "]");
237 return (org.vamsas.objects.core.DataSet) _dataSetList.elementAt(index);
238 } //-- org.vamsas.objects.core.DataSet getDataSet(int)
247 public org.vamsas.objects.core.DataSet[] getDataSet()
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);
255 } //-- org.vamsas.objects.core.DataSet[] getDataSet()
258 * Method getDataSetCount
264 public int getDataSetCount()
266 return _dataSetList.size();
267 } //-- int getDataSetCount()
270 * Returns the value of field 'id'. The field 'id' has the
271 * following description: Primary Key for vamsas object
276 * @return the value of field 'id'.
278 public java.lang.String getId()
281 } //-- java.lang.String getId()
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
291 * @return the value of field 'modifiable'.
293 public boolean getModifiable()
295 return this._modifiable;
296 } //-- boolean getModifiable()
306 public org.vamsas.objects.core.Tree getTree(int index)
307 throws java.lang.IndexOutOfBoundsException
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()+ "]");
314 return (org.vamsas.objects.core.Tree) _treeList.elementAt(index);
315 } //-- org.vamsas.objects.core.Tree getTree(int)
324 public org.vamsas.objects.core.Tree[] getTree()
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);
332 } //-- org.vamsas.objects.core.Tree[] getTree()
335 * Method getTreeCount
341 public int getTreeCount()
343 return _treeList.size();
344 } //-- int getTreeCount()
347 * Method hasModifiable
353 public boolean hasModifiable()
355 return this._has_modifiable;
356 } //-- boolean hasModifiable()
365 public boolean isValid()
370 catch (org.exolab.castor.xml.ValidationException vex) {
374 } //-- boolean isValid()
383 public void marshal(java.io.Writer out)
384 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
387 Marshaller.marshal(this, out);
388 } //-- void marshal(java.io.Writer)
397 public void marshal(org.xml.sax.ContentHandler handler)
398 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
401 Marshaller.marshal(this, handler);
402 } //-- void marshal(org.xml.sax.ContentHandler)
405 * Method removeAllDataSet
408 public void removeAllDataSet()
410 _dataSetList.removeAllElements();
411 } //-- void removeAllDataSet()
414 * Method removeAllTree
417 public void removeAllTree()
419 _treeList.removeAllElements();
420 } //-- void removeAllTree()
423 * Method removeDataSet
430 public org.vamsas.objects.core.DataSet removeDataSet(int index)
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)
445 public org.vamsas.objects.core.Tree removeTree(int index)
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)
460 public void setDataSet(int index, org.vamsas.objects.core.DataSet vDataSet)
461 throws java.lang.IndexOutOfBoundsException
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()+ "]");
467 _dataSetList.setElementAt(vDataSet, index);
468 } //-- void setDataSet(int, org.vamsas.objects.core.DataSet)
475 * @param dataSetArray
477 public void setDataSet(org.vamsas.objects.core.DataSet[] dataSetArray)
480 _dataSetList.removeAllElements();
481 for (int i = 0; i < dataSetArray.length; i++) {
482 _dataSetList.addElement(dataSetArray[i]);
484 } //-- void setDataSet(org.vamsas.objects.core.DataSet)
487 * Sets the value of field 'id'. The field 'id' has the
488 * following description: Primary Key for vamsas object
492 * @param id the value of field 'id'.
494 public void setId(java.lang.String id)
497 } //-- void setId(java.lang.String)
500 * Sets the value of field 'modifiable'. The field 'modifiable'
501 * has the following description: objects with modifiable=false
503 * modified by a vamsas client update
506 * @param modifiable the value of field 'modifiable'.
508 public void setModifiable(boolean modifiable)
510 this._modifiable = modifiable;
511 this._has_modifiable = true;
512 } //-- void setModifiable(boolean)
522 public void setTree(int index, org.vamsas.objects.core.Tree vTree)
523 throws java.lang.IndexOutOfBoundsException
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()+ "]");
529 _treeList.setElementAt(vTree, index);
530 } //-- void setTree(int, org.vamsas.objects.core.Tree)
539 public void setTree(org.vamsas.objects.core.Tree[] treeArray)
542 _treeList.removeAllElements();
543 for (int i = 0; i < treeArray.length; i++) {
544 _treeList.addElement(treeArray[i]);
546 } //-- void setTree(org.vamsas.objects.core.Tree)
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
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)
566 public void validate()
567 throws org.exolab.castor.xml.ValidationException
569 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
570 validator.validate(this);
571 } //-- void validate()