2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.binding;
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 // --------------------------/
30 * Field _alignmentList.
32 private java.util.Vector _alignmentList;
37 private java.util.Vector _treeList;
40 * Field _sequenceSetList.
42 private java.util.Vector _sequenceSetList;
51 this._alignmentList = new java.util.Vector();
52 this._treeList = new java.util.Vector();
53 this._sequenceSetList = new java.util.Vector();
64 * @throws java.lang.IndexOutOfBoundsException
65 * if the index given is outside the bounds of the collection
67 public void addAlignment(final Alignment vAlignment)
68 throws java.lang.IndexOutOfBoundsException
70 this._alignmentList.addElement(vAlignment);
78 * @throws java.lang.IndexOutOfBoundsException
79 * if the index given is outside the bounds of the collection
81 public void addAlignment(final int index, final Alignment vAlignment)
82 throws java.lang.IndexOutOfBoundsException
84 this._alignmentList.add(index, vAlignment);
91 * @throws java.lang.IndexOutOfBoundsException
92 * if the index given is outside the bounds of the collection
94 public void addSequenceSet(final SequenceSet vSequenceSet)
95 throws java.lang.IndexOutOfBoundsException
97 this._sequenceSetList.addElement(vSequenceSet);
104 * @param vSequenceSet
105 * @throws java.lang.IndexOutOfBoundsException
106 * if the index given is outside the bounds of the collection
108 public void addSequenceSet(final int index,
109 final SequenceSet vSequenceSet)
110 throws java.lang.IndexOutOfBoundsException
112 this._sequenceSetList.add(index, vSequenceSet);
119 * @throws java.lang.IndexOutOfBoundsException
120 * if the index given is outside the bounds of the collection
122 public void addTree(final java.lang.String vTree)
123 throws java.lang.IndexOutOfBoundsException
125 this._treeList.addElement(vTree);
133 * @throws java.lang.IndexOutOfBoundsException
134 * if the index given is outside the bounds of the collection
136 public void addTree(final int index, final java.lang.String vTree)
137 throws java.lang.IndexOutOfBoundsException
139 this._treeList.add(index, vTree);
143 * Method enumerateAlignment.
145 * @return an Enumeration over all Alignment elements
147 public java.util.Enumeration enumerateAlignment()
149 return this._alignmentList.elements();
153 * Method enumerateSequenceSet.
155 * @return an Enumeration over all SequenceSet elements
157 public java.util.Enumeration enumerateSequenceSet()
159 return this._sequenceSetList.elements();
163 * Method enumerateTree.
165 * @return an Enumeration over all java.lang.String elements
167 public java.util.Enumeration enumerateTree()
169 return this._treeList.elements();
173 * Method getAlignment.
176 * @throws java.lang.IndexOutOfBoundsException
177 * if the index given is outside the bounds of the collection
178 * @return the value of the Alignment at the given index
180 public Alignment getAlignment(final int index)
181 throws java.lang.IndexOutOfBoundsException
183 // check bounds for index
184 if (index < 0 || index >= this._alignmentList.size())
186 throw new IndexOutOfBoundsException(
187 "getAlignment: Index value '" + index + "' not in range [0.."
188 + (this._alignmentList.size() - 1) + "]");
191 return (Alignment) _alignmentList.get(index);
195 * Method getAlignment.Returns the contents of the collection in an Array.
197 * Note: Just in case the collection contents are changing in another thread,
198 * we pass a 0-length Array of the correct type into the API call. This way we
199 * <i>know</i> that the Array returned is of exactly the correct length.
201 * @return this collection as an Array
203 public Alignment[] getAlignment()
205 Alignment[] array = new Alignment[0];
206 return (Alignment[]) this._alignmentList.toArray(array);
210 * Method getAlignmentCount.
212 * @return the size of this collection
214 public int getAlignmentCount()
216 return this._alignmentList.size();
220 * Method getSequenceSet.
223 * @throws java.lang.IndexOutOfBoundsException
224 * if the index given is outside the bounds of the collection
225 * @return the value of the SequenceSet at the given index
227 public SequenceSet getSequenceSet(final int index)
228 throws java.lang.IndexOutOfBoundsException
230 // check bounds for index
231 if (index < 0 || index >= this._sequenceSetList.size())
233 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"
234 + index + "' not in range [0.."
235 + (this._sequenceSetList.size() - 1) + "]");
238 return (SequenceSet) _sequenceSetList.get(index);
242 * Method getSequenceSet.Returns the contents of the collection in an Array.
244 * Note: Just in case the collection contents are changing in another thread,
245 * we pass a 0-length Array of the correct type into the API call. This way we
246 * <i>know</i> that the Array returned is of exactly the correct length.
248 * @return this collection as an Array
250 public SequenceSet[] getSequenceSet()
252 SequenceSet[] array = new SequenceSet[0];
253 return (SequenceSet[]) this._sequenceSetList.toArray(array);
257 * Method getSequenceSetCount.
259 * @return the size of this collection
261 public int getSequenceSetCount()
263 return this._sequenceSetList.size();
270 * @throws java.lang.IndexOutOfBoundsException
271 * if the index given is outside the bounds of the collection
272 * @return the value of the java.lang.String at the given index
274 public java.lang.String getTree(final int index)
275 throws java.lang.IndexOutOfBoundsException
277 // check bounds for index
278 if (index < 0 || index >= this._treeList.size())
280 throw new IndexOutOfBoundsException("getTree: Index value '" + index
281 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
284 return (java.lang.String) _treeList.get(index);
288 * Method getTree.Returns the contents of the collection in an Array.
290 * Note: Just in case the collection contents are changing in another thread,
291 * we pass a 0-length Array of the correct type into the API call. This way we
292 * <i>know</i> that the Array returned is of exactly the correct length.
294 * @return this collection as an Array
296 public java.lang.String[] getTree()
298 java.lang.String[] array = new java.lang.String[0];
299 return (java.lang.String[]) this._treeList.toArray(array);
303 * Method getTreeCount.
305 * @return the size of this collection
307 public int getTreeCount()
309 return this._treeList.size();
315 * @return true if this object is valid according to the schema
317 public boolean isValid()
322 } catch (org.exolab.castor.xml.ValidationException vex)
333 * @throws org.exolab.castor.xml.MarshalException
334 * if object is null or if any SAXException is thrown during
336 * @throws org.exolab.castor.xml.ValidationException
337 * if this object is an invalid instance according to the schema
339 public void marshal(final java.io.Writer out)
340 throws org.exolab.castor.xml.MarshalException,
341 org.exolab.castor.xml.ValidationException
343 Marshaller.marshal(this, out);
350 * @throws java.io.IOException
351 * if an IOException occurs during marshaling
352 * @throws org.exolab.castor.xml.ValidationException
353 * if this object is an invalid instance according to the schema
354 * @throws org.exolab.castor.xml.MarshalException
355 * if object is null or if any SAXException is thrown during
358 public void marshal(final org.xml.sax.ContentHandler handler)
359 throws java.io.IOException,
360 org.exolab.castor.xml.MarshalException,
361 org.exolab.castor.xml.ValidationException
363 Marshaller.marshal(this, handler);
367 * Method removeAlignment.
370 * @return true if the object was removed from the collection.
372 public boolean removeAlignment(final Alignment vAlignment)
374 boolean removed = _alignmentList.remove(vAlignment);
379 * Method removeAlignmentAt.
382 * @return the element removed from the collection
384 public Alignment removeAlignmentAt(final int index)
386 java.lang.Object obj = this._alignmentList.remove(index);
387 return (Alignment) obj;
392 public void removeAllAlignment()
394 this._alignmentList.clear();
399 public void removeAllSequenceSet()
401 this._sequenceSetList.clear();
406 public void removeAllTree()
408 this._treeList.clear();
412 * Method removeSequenceSet.
414 * @param vSequenceSet
415 * @return true if the object was removed from the collection.
417 public boolean removeSequenceSet(final SequenceSet vSequenceSet)
419 boolean removed = _sequenceSetList.remove(vSequenceSet);
424 * Method removeSequenceSetAt.
427 * @return the element removed from the collection
429 public SequenceSet removeSequenceSetAt(final int index)
431 java.lang.Object obj = this._sequenceSetList.remove(index);
432 return (SequenceSet) obj;
439 * @return true if the object was removed from the collection.
441 public boolean removeTree(final java.lang.String vTree)
443 boolean removed = _treeList.remove(vTree);
448 * Method removeTreeAt.
451 * @return the element removed from the collection
453 public java.lang.String removeTreeAt(final int index)
455 java.lang.Object obj = this._treeList.remove(index);
456 return (java.lang.String) obj;
464 * @throws java.lang.IndexOutOfBoundsException
465 * if the index given is outside the bounds of the collection
467 public void setAlignment(final int index, final Alignment vAlignment)
468 throws java.lang.IndexOutOfBoundsException
470 // check bounds for index
471 if (index < 0 || index >= this._alignmentList.size())
473 throw new IndexOutOfBoundsException(
474 "setAlignment: Index value '" + index + "' not in range [0.."
475 + (this._alignmentList.size() - 1) + "]");
478 this._alignmentList.set(index, vAlignment);
484 * @param vAlignmentArray
486 public void setAlignment(final Alignment[] vAlignmentArray)
489 _alignmentList.clear();
491 for (int i = 0; i < vAlignmentArray.length; i++)
493 this._alignmentList.add(vAlignmentArray[i]);
501 * @param vSequenceSet
502 * @throws java.lang.IndexOutOfBoundsException
503 * if the index given is outside the bounds of the collection
505 public void setSequenceSet(final int index,
506 final SequenceSet vSequenceSet)
507 throws java.lang.IndexOutOfBoundsException
509 // check bounds for index
510 if (index < 0 || index >= this._sequenceSetList.size())
512 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"
513 + index + "' not in range [0.."
514 + (this._sequenceSetList.size() - 1) + "]");
517 this._sequenceSetList.set(index, vSequenceSet);
523 * @param vSequenceSetArray
525 public void setSequenceSet(final SequenceSet[] vSequenceSetArray)
528 _sequenceSetList.clear();
530 for (int i = 0; i < vSequenceSetArray.length; i++)
532 this._sequenceSetList.add(vSequenceSetArray[i]);
541 * @throws java.lang.IndexOutOfBoundsException
542 * if the index given is outside the bounds of the collection
544 public void setTree(final int index, final java.lang.String vTree)
545 throws java.lang.IndexOutOfBoundsException
547 // check bounds for index
548 if (index < 0 || index >= this._treeList.size())
550 throw new IndexOutOfBoundsException("setTree: Index value '" + index
551 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
554 this._treeList.set(index, vTree);
562 public void setTree(final java.lang.String[] vTreeArray)
567 for (int i = 0; i < vTreeArray.length; i++)
569 this._treeList.add(vTreeArray[i]);
577 * @throws org.exolab.castor.xml.MarshalException
578 * if object is null or if any SAXException is thrown during
580 * @throws org.exolab.castor.xml.ValidationException
581 * if this object is an invalid instance according to the schema
582 * @return the unmarshaled jalview.binding.VAMSAS
584 public static jalview.binding.VAMSAS unmarshal(
585 final java.io.Reader reader)
586 throws org.exolab.castor.xml.MarshalException,
587 org.exolab.castor.xml.ValidationException
589 return (jalview.binding.VAMSAS) Unmarshaller
590 .unmarshal(jalview.binding.VAMSAS.class, reader);
596 * @throws org.exolab.castor.xml.ValidationException
597 * if this object is an invalid instance according to the schema
599 public void validate() throws org.exolab.castor.xml.ValidationException
601 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
602 validator.validate(this);