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.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.util.Vector _treeList;
46 * Field _sequenceSetList
48 private java.util.Vector _sequenceSetList;
58 _treeList = new Vector();
59 _sequenceSetList = new Vector();
60 } //-- org.vamsas.objects.core.VAMSAS()
68 * Method addSequenceSet
74 public void addSequenceSet(org.vamsas.objects.core.SequenceSet vSequenceSet)
75 throws java.lang.IndexOutOfBoundsException
77 _sequenceSetList.addElement(vSequenceSet);
78 } //-- void addSequenceSet(org.vamsas.objects.core.SequenceSet)
81 * Method addSequenceSet
88 public void addSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
89 throws java.lang.IndexOutOfBoundsException
91 _sequenceSetList.insertElementAt(vSequenceSet, index);
92 } //-- void addSequenceSet(int, org.vamsas.objects.core.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.objects.core.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.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
198 } //-- org.vamsas.objects.core.SequenceSet getSequenceSet(int)
201 * Method getSequenceSet
205 * @return SequenceSet
207 public org.vamsas.objects.core.SequenceSet[] getSequenceSet()
209 int size = _sequenceSetList.size();
210 org.vamsas.objects.core.SequenceSet[] mArray = new org.vamsas.objects.core.SequenceSet[size];
211 for (int index = 0; index < size; index++) {
212 mArray[index] = (org.vamsas.objects.core.SequenceSet) _sequenceSetList.elementAt(index);
215 } //-- org.vamsas.objects.core.SequenceSet[] getSequenceSet()
218 * Method getSequenceSetCount
224 public int getSequenceSetCount()
226 return _sequenceSetList.size();
227 } //-- int getSequenceSetCount()
237 public java.lang.String getTree(int index)
238 throws java.lang.IndexOutOfBoundsException
240 //-- check bounds for index
241 if ((index < 0) || (index > _treeList.size())) {
242 throw new IndexOutOfBoundsException("getTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
245 return (String)_treeList.elementAt(index);
246 } //-- java.lang.String getTree(int)
255 public java.lang.String[] getTree()
257 int size = _treeList.size();
258 java.lang.String[] mArray = new java.lang.String[size];
259 for (int index = 0; index < size; index++) {
260 mArray[index] = (String)_treeList.elementAt(index);
263 } //-- java.lang.String[] getTree()
266 * Method getTreeCount
272 public int getTreeCount()
274 return _treeList.size();
275 } //-- int getTreeCount()
284 public boolean isValid()
289 catch (org.exolab.castor.xml.ValidationException vex) {
293 } //-- boolean isValid()
302 public void marshal(java.io.Writer out)
303 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
306 Marshaller.marshal(this, out);
307 } //-- void marshal(java.io.Writer)
316 public void marshal(org.xml.sax.ContentHandler handler)
317 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
320 Marshaller.marshal(this, handler);
321 } //-- void marshal(org.xml.sax.ContentHandler)
324 * Method removeAllSequenceSet
327 public void removeAllSequenceSet()
329 _sequenceSetList.removeAllElements();
330 } //-- void removeAllSequenceSet()
333 * Method removeAllTree
336 public void removeAllTree()
338 _treeList.removeAllElements();
339 } //-- void removeAllTree()
342 * Method removeSequenceSet
347 * @return SequenceSet
349 public org.vamsas.objects.core.SequenceSet removeSequenceSet(int index)
351 java.lang.Object obj = _sequenceSetList.elementAt(index);
352 _sequenceSetList.removeElementAt(index);
353 return (org.vamsas.objects.core.SequenceSet) obj;
354 } //-- org.vamsas.objects.core.SequenceSet removeSequenceSet(int)
364 public java.lang.String removeTree(int index)
366 java.lang.Object obj = _treeList.elementAt(index);
367 _treeList.removeElementAt(index);
369 } //-- java.lang.String removeTree(int)
372 * Method setSequenceSet
377 * @param vSequenceSet
379 public void setSequenceSet(int index, org.vamsas.objects.core.SequenceSet vSequenceSet)
380 throws java.lang.IndexOutOfBoundsException
382 //-- check bounds for index
383 if ((index < 0) || (index > _sequenceSetList.size())) {
384 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"+index+"' not in range [0.."+_sequenceSetList.size()+ "]");
386 _sequenceSetList.setElementAt(vSequenceSet, index);
387 } //-- void setSequenceSet(int, org.vamsas.objects.core.SequenceSet)
390 * Method setSequenceSet
394 * @param sequenceSetArray
396 public void setSequenceSet(org.vamsas.objects.core.SequenceSet[] sequenceSetArray)
399 _sequenceSetList.removeAllElements();
400 for (int i = 0; i < sequenceSetArray.length; i++) {
401 _sequenceSetList.addElement(sequenceSetArray[i]);
403 } //-- void setSequenceSet(org.vamsas.objects.core.SequenceSet)
413 public void setTree(int index, java.lang.String vTree)
414 throws java.lang.IndexOutOfBoundsException
416 //-- check bounds for index
417 if ((index < 0) || (index > _treeList.size())) {
418 throw new IndexOutOfBoundsException("setTree: Index value '"+index+"' not in range [0.."+_treeList.size()+ "]");
420 _treeList.setElementAt(vTree, index);
421 } //-- void setTree(int, java.lang.String)
430 public void setTree(java.lang.String[] treeArray)
433 _treeList.removeAllElements();
434 for (int i = 0; i < treeArray.length; i++) {
435 _treeList.addElement(treeArray[i]);
437 } //-- void setTree(java.lang.String)
447 public static org.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader reader)
448 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
450 return (org.vamsas.objects.core.VAMSAS) Unmarshaller.unmarshal(org.vamsas.objects.core.VAMSAS.class, reader);
451 } //-- org.vamsas.objects.core.VAMSAS unmarshal(java.io.Reader)
457 public void validate()
458 throws org.exolab.castor.xml.ValidationException
460 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
461 validator.validate(this);
462 } //-- void validate()