2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 0.9.9M1</a>, using an XML
8 package org.vamsas.client.objects;
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.util.Vector _treeList;
46 * Field _sequenceSetList
48 private java.util.Vector _sequenceSetList;
58 _treeList = new Vector();
59 _sequenceSetList = new Vector();
60 } //-- org.vamsas.client.objects.VAMSAS()
68 * Method addSequenceSet
74 public void addSequenceSet(org.vamsas.client.objects.SequenceSet vSequenceSet)
75 throws java.lang.IndexOutOfBoundsException
77 _sequenceSetList.addElement(vSequenceSet);
78 } //-- void addSequenceSet(org.vamsas.client.objects.SequenceSet)
81 * Method addSequenceSet
88 public void addSequenceSet(int index, org.vamsas.client.objects.SequenceSet vSequenceSet)
89 throws java.lang.IndexOutOfBoundsException
91 _sequenceSetList.insertElementAt(vSequenceSet, index);
92 } //-- void addSequenceSet(int, org.vamsas.client.objects.SequenceSet)
101 public void addTree(java.lang.String vTree)
102 throws java.lang.IndexOutOfBoundsException
104 _treeList.addElement(vTree);
105 } //-- void addTree(java.lang.String)
115 public void addTree(int index, java.lang.String vTree)
116 throws java.lang.IndexOutOfBoundsException
118 _treeList.insertElementAt(vTree, index);
119 } //-- void addTree(int, java.lang.String)
122 * Method enumerateSequenceSet
126 * @return Enumeration
128 public java.util.Enumeration enumerateSequenceSet()
130 return _sequenceSetList.elements();
131 } //-- java.util.Enumeration enumerateSequenceSet()
134 * Method enumerateTree
138 * @return Enumeration
140 public java.util.Enumeration enumerateTree()
142 return _treeList.elements();
143 } //-- java.util.Enumeration enumerateTree()
146 * Note: hashCode() has not been overriden
151 public boolean equals(java.lang.Object obj)
156 if (super.equals(obj)==false)
159 if (obj instanceof VAMSAS) {
161 VAMSAS temp = (VAMSAS)obj;
162 if (this._treeList != null) {
163 if (temp._treeList == null) return false;
164 else if (!(this._treeList.equals(temp._treeList)))
167 else if (temp._treeList != null)
169 if (this._sequenceSetList != null) {
170 if (temp._sequenceSetList == null) return false;
171 else if (!(this._sequenceSetList.equals(temp._sequenceSetList)))
174 else if (temp._sequenceSetList != null)
179 } //-- boolean equals(java.lang.Object)
182 * Method getSequenceSet
187 * @return SequenceSet
189 public org.vamsas.client.objects.SequenceSet getSequenceSet(int index)
190 throws java.lang.IndexOutOfBoundsException
192 //-- check bounds for index
193 if ((index < 0) || (index > _sequenceSetList.size())) {
194 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
197 return (org.vamsas.client.objects.SequenceSet) _sequenceSetList.elementAt(index);
198 } //-- org.vamsas.client.objects.SequenceSet getSequenceSet(int)
201 * Method getSequenceSet
205 * @return SequenceSet
207 public org.vamsas.client.objects.SequenceSet[] getSequenceSet()
209 int size = _sequenceSetList.size();
210 org.vamsas.client.objects.SequenceSet[] mArray = new org.vamsas.client.objects.SequenceSet[size];
211 for (int index = 0; index < size; index++) {
212 mArray[index] = (org.vamsas.client.objects.SequenceSet) _sequenceSetList.elementAt(index);
215 } //-- org.vamsas.client.objects.SequenceSet[] getSequenceSet()
218 * Method getSequenceSetAsReference
220 * Returns a reference to 'sequenceSet'. No type checking is
221 * performed on any modications to the Vector.
224 * @return returns a reference to the Vector.
226 public java.util.Vector getSequenceSetAsReference()
228 return _sequenceSetList;
229 } //-- java.util.Vector getSequenceSetAsReference()
232 * Method getSequenceSetCount
238 public int getSequenceSetCount()
240 return _sequenceSetList.size();
241 } //-- int getSequenceSetCount()
251 public java.lang.String getTree(int index)
252 throws java.lang.IndexOutOfBoundsException
254 //-- check bounds for index
255 if ((index < 0) || (index > _treeList.size())) {
256 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
259 return (String)_treeList.elementAt(index);
260 } //-- java.lang.String getTree(int)
269 public java.lang.String[] getTree()
271 int size = _treeList.size();
272 java.lang.String[] mArray = new java.lang.String[size];
273 for (int index = 0; index < size; index++) {
274 mArray[index] = (String)_treeList.elementAt(index);
277 } //-- java.lang.String[] getTree()
280 * Method getTreeAsReference
282 * Returns a reference to 'tree'. No type checking is performed
283 * on any modications to the Vector.
286 * @return returns a reference to the Vector.
288 public java.util.Vector getTreeAsReference()
291 } //-- java.util.Vector getTreeAsReference()
294 * Method getTreeCount
300 public int getTreeCount()
302 return _treeList.size();
303 } //-- int getTreeCount()
312 public boolean isValid()
317 catch (org.exolab.castor.xml.ValidationException vex) {
321 } //-- boolean isValid()
330 public void marshal(java.io.Writer out)
331 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
334 Marshaller.marshal(this, out);
335 } //-- void marshal(java.io.Writer)
344 public void marshal(org.xml.sax.ContentHandler handler)
345 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
348 Marshaller.marshal(this, handler);
349 } //-- void marshal(org.xml.sax.ContentHandler)
352 * Method removeAllSequenceSet
355 public void removeAllSequenceSet()
357 _sequenceSetList.removeAllElements();
358 } //-- void removeAllSequenceSet()
361 * Method removeAllTree
364 public void removeAllTree()
366 _treeList.removeAllElements();
367 } //-- void removeAllTree()
370 * Method removeSequenceSet
375 * @return SequenceSet
377 public org.vamsas.client.objects.SequenceSet removeSequenceSet(int index)
379 java.lang.Object obj = _sequenceSetList.elementAt(index);
380 _sequenceSetList.removeElementAt(index);
381 return (org.vamsas.client.objects.SequenceSet) obj;
382 } //-- org.vamsas.client.objects.SequenceSet removeSequenceSet(int)
392 public java.lang.String removeTree(int index)
394 java.lang.Object obj = _treeList.elementAt(index);
395 _treeList.removeElementAt(index);
397 } //-- java.lang.String removeTree(int)
400 * Method setSequenceSet
405 * @param vSequenceSet
407 public void setSequenceSet(int index, org.vamsas.client.objects.SequenceSet vSequenceSet)
408 throws java.lang.IndexOutOfBoundsException
410 //-- check bounds for index
411 if ((index < 0) || (index > _sequenceSetList.size())) {
412 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
414 _sequenceSetList.setElementAt(vSequenceSet, index);
415 } //-- void setSequenceSet(int, org.vamsas.client.objects.SequenceSet)
418 * Method setSequenceSet
422 * @param sequenceSetArray
424 public void setSequenceSet(org.vamsas.client.objects.SequenceSet[] sequenceSetArray)
427 _sequenceSetList.removeAllElements();
428 for (int i = 0; i < sequenceSetArray.length; i++) {
429 _sequenceSetList.addElement(sequenceSetArray[i]);
431 } //-- void setSequenceSet(org.vamsas.client.objects.SequenceSet)
434 * Method setSequenceSet
436 * Sets the value of 'sequenceSet' by copying the given Vector.
438 * @param sequenceSetVector the Vector to copy.
440 public void setSequenceSet(java.util.Vector sequenceSetVector)
443 _sequenceSetList.removeAllElements();
444 for (int i = 0; i < sequenceSetVector.size(); i++) {
445 _sequenceSetList.addElement((org.vamsas.client.objects.SequenceSet)sequenceSetVector.elementAt(i));
447 } //-- void setSequenceSet(java.util.Vector)
450 * Method setSequenceSetAsReference
452 * Sets the value of 'sequenceSet' by setting it to the given
453 * Vector. No type checking is performed.
455 * @param sequenceSetVector the Vector to copy.
457 public void setSequenceSetAsReference(java.util.Vector sequenceSetVector)
459 _sequenceSetList = sequenceSetVector;
460 } //-- void setSequenceSetAsReference(java.util.Vector)
470 public void setTree(int index, java.lang.String vTree)
471 throws java.lang.IndexOutOfBoundsException
473 //-- check bounds for index
474 if ((index < 0) || (index > _treeList.size())) {
475 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
477 _treeList.setElementAt(vTree, index);
478 } //-- void setTree(int, java.lang.String)
487 public void setTree(java.lang.String[] treeArray)
490 _treeList.removeAllElements();
491 for (int i = 0; i < treeArray.length; i++) {
492 _treeList.addElement(treeArray[i]);
494 } //-- void setTree(java.lang.String)
499 * Sets the value of 'tree' by copying the given Vector.
501 * @param treeVector the Vector to copy.
503 public void setTree(java.util.Vector treeVector)
506 _treeList.removeAllElements();
507 for (int i = 0; i < treeVector.size(); i++) {
508 _treeList.addElement((java.lang.String)treeVector.elementAt(i));
510 } //-- void setTree(java.util.Vector)
513 * Method setTreeAsReference
515 * Sets the value of 'tree' by setting it to the given Vector.
516 * No type checking is performed.
518 * @param treeVector the Vector to copy.
520 public void setTreeAsReference(java.util.Vector treeVector)
522 _treeList = treeVector;
523 } //-- void setTreeAsReference(java.util.Vector)
533 public static org.vamsas.client.objects.VAMSAS unmarshal(java.io.Reader reader)
534 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
536 return (org.vamsas.client.objects.VAMSAS) Unmarshaller.unmarshal(org.vamsas.client.objects.VAMSAS.class, reader);
537 } //-- org.vamsas.client.objects.VAMSAS unmarshal(java.io.Reader)
543 public void validate()
544 throws org.exolab.castor.xml.ValidationException
546 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
547 validator.validate(this);
548 } //-- void validate()