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;
51 * Field _sequenceSetList
53 private java.util.Vector _sequenceSetList;
63 _treeList = new Vector();
64 _sequenceSetList = new Vector();
65 } //-- org.vamsas.objects.core.VAMSAS()
73 * Method addSequenceSet
79 public void addSequenceSet(org.vamsas.objects.core.SequenceSet vSequenceSet)
80 throws java.lang.IndexOutOfBoundsException
82 _sequenceSetList.addElement(vSequenceSet);
83 } //-- void addSequenceSet(org.vamsas.objects.core.SequenceSet)
86 * Method addSequenceSet
93 public void addSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
94 throws java.lang.IndexOutOfBoundsException
96 _sequenceSetList.insertElementAt(vSequenceSet, index);
97 } //-- void addSequenceSet(int, org.vamsas.objects.core.SequenceSet)
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 enumerateSequenceSet
131 * @return Enumeration
133 public java.util.Enumeration enumerateSequenceSet()
135 return _sequenceSetList.elements();
136 } //-- java.util.Enumeration enumerateSequenceSet()
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._sequenceSetList != null) {
182 if (temp._sequenceSetList == null) return false;
183 else if (!(this._sequenceSetList.equals(temp._sequenceSetList)))
186 else if (temp._sequenceSetList != null)
191 } //-- boolean equals(java.lang.Object)
194 * Returns the value of field 'id'.
197 * @return the value of field 'id'.
199 public java.lang.String getId()
202 } //-- java.lang.String getId()
205 * Method getSequenceSet
210 * @return SequenceSet
212 public org.vamsas.objects.core.SequenceSet getSequenceSet(int index)
213 throws java.lang.IndexOutOfBoundsException
215 //-- check bounds for index
216 if ((index < 0) || (index > _sequenceSetList.size())) {
217 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
220 return (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
221 } //-- org.vamsas.objects.core.SequenceSet getSequenceSet(int)
224 * Method getSequenceSet
228 * @return SequenceSet
230 public org.vamsas.objects.core.SequenceSet[] getSequenceSet()
232 int size = _sequenceSetList.size();
233 org.vamsas.objects.core.SequenceSet[] mArray = new org.vamsas.objects.core.SequenceSet[size];
234 for (int index = 0; index < size; index++) {
235 mArray[index] = (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
238 } //-- org.vamsas.objects.core.SequenceSet[] getSequenceSet()
241 * Method getSequenceSetCount
247 public int getSequenceSetCount()
249 return _sequenceSetList.size();
250 } //-- int getSequenceSetCount()
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 removeAllSequenceSet
350 public void removeAllSequenceSet()
352 _sequenceSetList.removeAllElements();
353 } //-- void removeAllSequenceSet()
356 * Method removeAllTree
359 public void removeAllTree()
361 _treeList.removeAllElements();
362 } //-- void removeAllTree()
365 * Method removeSequenceSet
370 * @return SequenceSet
372 public org.vamsas.objects.core.SequenceSet removeSequenceSet(int index)
374 java.lang.Object obj = _sequenceSetList.elementAt(index);
375 _sequenceSetList.removeElementAt(index);
376 return (org.vamsas.objects.core.SequenceSet) obj;
377 } //-- org.vamsas.objects.core.SequenceSet removeSequenceSet(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)
395 * Sets the value of field 'id'.
397 * @param id the value of field 'id'.
399 public void setId(java.lang.String id)
402 } //-- void setId(java.lang.String)
405 * Method setSequenceSet
410 * @param vSequenceSet
412 public void setSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
413 throws java.lang.IndexOutOfBoundsException
415 //-- check bounds for index
416 if ((index < 0) || (index > _sequenceSetList.size())) {
417 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
419 _sequenceSetList.setElementAt(vSequenceSet, index);
420 } //-- void setSequenceSet(int, org.vamsas.objects.core.SequenceSet)
423 * Method setSequenceSet
427 * @param sequenceSetArray
429 public void setSequenceSet(org.vamsas.objects.core.SequenceSet[] sequenceSetArray)
432 _sequenceSetList.removeAllElements();
433 for (int i = 0; i < sequenceSetArray.length; i++) {
434 _sequenceSetList.addElement(sequenceSetArray[i]);
436 } //-- void setSequenceSet(org.vamsas.objects.core.SequenceSet)
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()