2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class VAMSAS implements java.io.Serializable
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
32 private java.util.Vector _treeList;
35 * Field _sequenceSetList.
37 private java.util.Vector _sequenceSetList;
46 this._treeList = new java.util.Vector();
47 this._sequenceSetList = new java.util.Vector();
58 * @throws java.lang.IndexOutOfBoundsException
59 * if the index given is outside the bounds of the collection
61 public void addSequenceSet(
62 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
63 throws java.lang.IndexOutOfBoundsException
65 this._sequenceSetList.addElement(vSequenceSet);
73 * @throws java.lang.IndexOutOfBoundsException
74 * if the index given is outside the bounds of the collection
76 public void addSequenceSet(final int index,
77 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
78 throws java.lang.IndexOutOfBoundsException
80 this._sequenceSetList.add(index, vSequenceSet);
87 * @throws java.lang.IndexOutOfBoundsException
88 * if the index given is outside the bounds of the collection
90 public void addTree(final java.lang.String vTree)
91 throws java.lang.IndexOutOfBoundsException
93 this._treeList.addElement(vTree);
101 * @throws java.lang.IndexOutOfBoundsException
102 * if the index given is outside the bounds of the collection
104 public void addTree(final int index, final java.lang.String vTree)
105 throws java.lang.IndexOutOfBoundsException
107 this._treeList.add(index, vTree);
111 * Method enumerateSequenceSet.
113 * @return an Enumeration over all jalview.schemabinding.version2.SequenceSet
116 public java.util.Enumeration enumerateSequenceSet()
118 return this._sequenceSetList.elements();
122 * Method enumerateTree.
124 * @return an Enumeration over all java.lang.String elements
126 public java.util.Enumeration enumerateTree()
128 return this._treeList.elements();
132 * Method getSequenceSet.
135 * @throws java.lang.IndexOutOfBoundsException
136 * if the index given is outside the bounds of the collection
137 * @return the value of the jalview.schemabinding.version2.SequenceSet at the
140 public jalview.schemabinding.version2.SequenceSet getSequenceSet(
141 final int index) throws java.lang.IndexOutOfBoundsException
143 // check bounds for index
144 if (index < 0 || index >= this._sequenceSetList.size())
146 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"
147 + index + "' not in range [0.."
148 + (this._sequenceSetList.size() - 1) + "]");
151 return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList
156 * Method getSequenceSet.Returns the contents of the collection in an Array.
158 * Note: Just in case the collection contents are changing in another thread,
159 * we pass a 0-length Array of the correct type into the API call. This way we
160 * <i>know</i> that the Array returned is of exactly the correct length.
162 * @return this collection as an Array
164 public jalview.schemabinding.version2.SequenceSet[] getSequenceSet()
166 jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0];
167 return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList
172 * Method getSequenceSetCount.
174 * @return the size of this collection
176 public int getSequenceSetCount()
178 return this._sequenceSetList.size();
185 * @throws java.lang.IndexOutOfBoundsException
186 * if the index given is outside the bounds of the collection
187 * @return the value of the java.lang.String at the given index
189 public java.lang.String getTree(final int index)
190 throws java.lang.IndexOutOfBoundsException
192 // check bounds for index
193 if (index < 0 || index >= this._treeList.size())
195 throw new IndexOutOfBoundsException("getTree: Index value '" + index
196 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
199 return (java.lang.String) _treeList.get(index);
203 * Method getTree.Returns the contents of the collection in an Array.
205 * Note: Just in case the collection contents are changing in another thread,
206 * we pass a 0-length Array of the correct type into the API call. This way we
207 * <i>know</i> that the Array returned is of exactly the correct length.
209 * @return this collection as an Array
211 public java.lang.String[] getTree()
213 java.lang.String[] array = new java.lang.String[0];
214 return (java.lang.String[]) this._treeList.toArray(array);
218 * Method getTreeCount.
220 * @return the size of this collection
222 public int getTreeCount()
224 return this._treeList.size();
230 * @return true if this object is valid according to the schema
232 public boolean isValid()
237 } catch (org.exolab.castor.xml.ValidationException vex)
248 * @throws org.exolab.castor.xml.MarshalException
249 * if object is null or if any SAXException is thrown during
251 * @throws org.exolab.castor.xml.ValidationException
252 * if this object is an invalid instance according to the schema
254 public void marshal(final java.io.Writer out)
255 throws org.exolab.castor.xml.MarshalException,
256 org.exolab.castor.xml.ValidationException
258 Marshaller.marshal(this, out);
265 * @throws java.io.IOException
266 * if an IOException occurs during marshaling
267 * @throws org.exolab.castor.xml.ValidationException
268 * if this object is an invalid instance according to the schema
269 * @throws org.exolab.castor.xml.MarshalException
270 * if object is null or if any SAXException is thrown during
273 public void marshal(final org.xml.sax.ContentHandler handler)
274 throws java.io.IOException,
275 org.exolab.castor.xml.MarshalException,
276 org.exolab.castor.xml.ValidationException
278 Marshaller.marshal(this, handler);
283 public void removeAllSequenceSet()
285 this._sequenceSetList.clear();
290 public void removeAllTree()
292 this._treeList.clear();
296 * Method removeSequenceSet.
298 * @param vSequenceSet
299 * @return true if the object was removed from the collection.
301 public boolean removeSequenceSet(
302 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
304 boolean removed = _sequenceSetList.remove(vSequenceSet);
309 * Method removeSequenceSetAt.
312 * @return the element removed from the collection
314 public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt(
317 java.lang.Object obj = this._sequenceSetList.remove(index);
318 return (jalview.schemabinding.version2.SequenceSet) obj;
325 * @return true if the object was removed from the collection.
327 public boolean removeTree(final java.lang.String vTree)
329 boolean removed = _treeList.remove(vTree);
334 * Method removeTreeAt.
337 * @return the element removed from the collection
339 public java.lang.String removeTreeAt(final int index)
341 java.lang.Object obj = this._treeList.remove(index);
342 return (java.lang.String) obj;
349 * @param vSequenceSet
350 * @throws java.lang.IndexOutOfBoundsException
351 * if the index given is outside the bounds of the collection
353 public void setSequenceSet(final int index,
354 final jalview.schemabinding.version2.SequenceSet vSequenceSet)
355 throws java.lang.IndexOutOfBoundsException
357 // check bounds for index
358 if (index < 0 || index >= this._sequenceSetList.size())
360 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"
361 + index + "' not in range [0.."
362 + (this._sequenceSetList.size() - 1) + "]");
365 this._sequenceSetList.set(index, vSequenceSet);
371 * @param vSequenceSetArray
373 public void setSequenceSet(
374 final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray)
377 _sequenceSetList.clear();
379 for (int i = 0; i < vSequenceSetArray.length; i++)
381 this._sequenceSetList.add(vSequenceSetArray[i]);
390 * @throws java.lang.IndexOutOfBoundsException
391 * if the index given is outside the bounds of the collection
393 public void setTree(final int index, final java.lang.String vTree)
394 throws java.lang.IndexOutOfBoundsException
396 // check bounds for index
397 if (index < 0 || index >= this._treeList.size())
399 throw new IndexOutOfBoundsException("setTree: Index value '" + index
400 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
403 this._treeList.set(index, vTree);
411 public void setTree(final java.lang.String[] vTreeArray)
416 for (int i = 0; i < vTreeArray.length; i++)
418 this._treeList.add(vTreeArray[i]);
426 * @throws org.exolab.castor.xml.MarshalException
427 * if object is null or if any SAXException is thrown during
429 * @throws org.exolab.castor.xml.ValidationException
430 * if this object is an invalid instance according to the schema
431 * @return the unmarshaled jalview.schemabinding.version2.VAMSAS
433 public static jalview.schemabinding.version2.VAMSAS unmarshal(
434 final java.io.Reader reader)
435 throws org.exolab.castor.xml.MarshalException,
436 org.exolab.castor.xml.ValidationException
438 return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(
439 jalview.schemabinding.version2.VAMSAS.class, reader);
445 * @throws org.exolab.castor.xml.ValidationException
446 * if this object is an invalid instance according to the schema
448 public void validate() throws org.exolab.castor.xml.ValidationException
450 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
451 validator.validate(this);