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, final SequenceSet vSequenceSet)
109 throws java.lang.IndexOutOfBoundsException
111 this._sequenceSetList.add(index, vSequenceSet);
118 * @throws java.lang.IndexOutOfBoundsException
119 * if the index given is outside the bounds of the collection
121 public void addTree(final java.lang.String vTree)
122 throws java.lang.IndexOutOfBoundsException
124 this._treeList.addElement(vTree);
132 * @throws java.lang.IndexOutOfBoundsException
133 * if the index given is outside the bounds of the collection
135 public void addTree(final int index, final java.lang.String vTree)
136 throws java.lang.IndexOutOfBoundsException
138 this._treeList.add(index, vTree);
142 * Method enumerateAlignment.
144 * @return an Enumeration over all Alignment elements
146 public java.util.Enumeration enumerateAlignment()
148 return this._alignmentList.elements();
152 * Method enumerateSequenceSet.
154 * @return an Enumeration over all SequenceSet elements
156 public java.util.Enumeration enumerateSequenceSet()
158 return this._sequenceSetList.elements();
162 * Method enumerateTree.
164 * @return an Enumeration over all java.lang.String elements
166 public java.util.Enumeration enumerateTree()
168 return this._treeList.elements();
172 * Method getAlignment.
175 * @throws java.lang.IndexOutOfBoundsException
176 * if the index given is outside the bounds of the collection
177 * @return the value of the Alignment at the given index
179 public Alignment getAlignment(final int index)
180 throws java.lang.IndexOutOfBoundsException
182 // check bounds for index
183 if (index < 0 || index >= this._alignmentList.size())
185 throw new IndexOutOfBoundsException("getAlignment: Index value '"
186 + index + "' not in range [0.."
187 + (this._alignmentList.size() - 1) + "]");
190 return (Alignment) _alignmentList.get(index);
194 * Method getAlignment.Returns the contents of the collection in an Array.
196 * Note: Just in case the collection contents are changing in another thread,
197 * we pass a 0-length Array of the correct type into the API call. This way we
198 * <i>know</i> that the Array returned is of exactly the correct length.
200 * @return this collection as an Array
202 public Alignment[] getAlignment()
204 Alignment[] array = new Alignment[0];
205 return (Alignment[]) this._alignmentList.toArray(array);
209 * Method getAlignmentCount.
211 * @return the size of this collection
213 public int getAlignmentCount()
215 return this._alignmentList.size();
219 * Method getSequenceSet.
222 * @throws java.lang.IndexOutOfBoundsException
223 * if the index given is outside the bounds of the collection
224 * @return the value of the SequenceSet at the given index
226 public SequenceSet getSequenceSet(final int index)
227 throws java.lang.IndexOutOfBoundsException
229 // check bounds for index
230 if (index < 0 || index >= this._sequenceSetList.size())
232 throw new IndexOutOfBoundsException("getSequenceSet: Index value '"
233 + index + "' not in range [0.."
234 + (this._sequenceSetList.size() - 1) + "]");
237 return (SequenceSet) _sequenceSetList.get(index);
241 * Method getSequenceSet.Returns the contents of the collection in an Array.
243 * Note: Just in case the collection contents are changing in another thread,
244 * we pass a 0-length Array of the correct type into the API call. This way we
245 * <i>know</i> that the Array returned is of exactly the correct length.
247 * @return this collection as an Array
249 public SequenceSet[] getSequenceSet()
251 SequenceSet[] array = new SequenceSet[0];
252 return (SequenceSet[]) this._sequenceSetList.toArray(array);
256 * Method getSequenceSetCount.
258 * @return the size of this collection
260 public int getSequenceSetCount()
262 return this._sequenceSetList.size();
269 * @throws java.lang.IndexOutOfBoundsException
270 * if the index given is outside the bounds of the collection
271 * @return the value of the java.lang.String at the given index
273 public java.lang.String getTree(final int index)
274 throws java.lang.IndexOutOfBoundsException
276 // check bounds for index
277 if (index < 0 || index >= this._treeList.size())
279 throw new IndexOutOfBoundsException("getTree: Index value '" + index
280 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
283 return (java.lang.String) _treeList.get(index);
287 * Method getTree.Returns the contents of the collection in an Array.
289 * Note: Just in case the collection contents are changing in another thread,
290 * we pass a 0-length Array of the correct type into the API call. This way we
291 * <i>know</i> that the Array returned is of exactly the correct length.
293 * @return this collection as an Array
295 public java.lang.String[] getTree()
297 java.lang.String[] array = new java.lang.String[0];
298 return (java.lang.String[]) this._treeList.toArray(array);
302 * Method getTreeCount.
304 * @return the size of this collection
306 public int getTreeCount()
308 return this._treeList.size();
314 * @return true if this object is valid according to the schema
316 public boolean isValid()
321 } catch (org.exolab.castor.xml.ValidationException vex)
332 * @throws org.exolab.castor.xml.MarshalException
333 * if object is null or if any SAXException is thrown during
335 * @throws org.exolab.castor.xml.ValidationException
336 * if this object is an invalid instance according to the schema
338 public void marshal(final java.io.Writer out)
339 throws org.exolab.castor.xml.MarshalException,
340 org.exolab.castor.xml.ValidationException
342 Marshaller.marshal(this, out);
349 * @throws java.io.IOException
350 * if an IOException occurs during marshaling
351 * @throws org.exolab.castor.xml.ValidationException
352 * if this object is an invalid instance according to the schema
353 * @throws org.exolab.castor.xml.MarshalException
354 * if object is null or if any SAXException is thrown during
357 public void marshal(final org.xml.sax.ContentHandler handler)
358 throws java.io.IOException,
359 org.exolab.castor.xml.MarshalException,
360 org.exolab.castor.xml.ValidationException
362 Marshaller.marshal(this, handler);
366 * Method removeAlignment.
369 * @return true if the object was removed from the collection.
371 public boolean removeAlignment(final Alignment vAlignment)
373 boolean removed = _alignmentList.remove(vAlignment);
378 * Method removeAlignmentAt.
381 * @return the element removed from the collection
383 public Alignment removeAlignmentAt(final int index)
385 java.lang.Object obj = this._alignmentList.remove(index);
386 return (Alignment) obj;
391 public void removeAllAlignment()
393 this._alignmentList.clear();
398 public void removeAllSequenceSet()
400 this._sequenceSetList.clear();
405 public void removeAllTree()
407 this._treeList.clear();
411 * Method removeSequenceSet.
413 * @param vSequenceSet
414 * @return true if the object was removed from the collection.
416 public boolean removeSequenceSet(final SequenceSet vSequenceSet)
418 boolean removed = _sequenceSetList.remove(vSequenceSet);
423 * Method removeSequenceSetAt.
426 * @return the element removed from the collection
428 public SequenceSet removeSequenceSetAt(final int index)
430 java.lang.Object obj = this._sequenceSetList.remove(index);
431 return (SequenceSet) obj;
438 * @return true if the object was removed from the collection.
440 public boolean removeTree(final java.lang.String vTree)
442 boolean removed = _treeList.remove(vTree);
447 * Method removeTreeAt.
450 * @return the element removed from the collection
452 public java.lang.String removeTreeAt(final int index)
454 java.lang.Object obj = this._treeList.remove(index);
455 return (java.lang.String) obj;
463 * @throws java.lang.IndexOutOfBoundsException
464 * if the index given is outside the bounds of the collection
466 public void setAlignment(final int index, final Alignment vAlignment)
467 throws java.lang.IndexOutOfBoundsException
469 // check bounds for index
470 if (index < 0 || index >= this._alignmentList.size())
472 throw new IndexOutOfBoundsException("setAlignment: Index value '"
473 + index + "' not in range [0.."
474 + (this._alignmentList.size() - 1) + "]");
477 this._alignmentList.set(index, vAlignment);
483 * @param vAlignmentArray
485 public void setAlignment(final Alignment[] vAlignmentArray)
488 _alignmentList.clear();
490 for (int i = 0; i < vAlignmentArray.length; i++)
492 this._alignmentList.add(vAlignmentArray[i]);
500 * @param vSequenceSet
501 * @throws java.lang.IndexOutOfBoundsException
502 * if the index given is outside the bounds of the collection
504 public void setSequenceSet(final int index, final SequenceSet vSequenceSet)
505 throws java.lang.IndexOutOfBoundsException
507 // check bounds for index
508 if (index < 0 || index >= this._sequenceSetList.size())
510 throw new IndexOutOfBoundsException("setSequenceSet: Index value '"
511 + index + "' not in range [0.."
512 + (this._sequenceSetList.size() - 1) + "]");
515 this._sequenceSetList.set(index, vSequenceSet);
521 * @param vSequenceSetArray
523 public void setSequenceSet(final SequenceSet[] vSequenceSetArray)
526 _sequenceSetList.clear();
528 for (int i = 0; i < vSequenceSetArray.length; i++)
530 this._sequenceSetList.add(vSequenceSetArray[i]);
539 * @throws java.lang.IndexOutOfBoundsException
540 * if the index given is outside the bounds of the collection
542 public void setTree(final int index, final java.lang.String vTree)
543 throws java.lang.IndexOutOfBoundsException
545 // check bounds for index
546 if (index < 0 || index >= this._treeList.size())
548 throw new IndexOutOfBoundsException("setTree: Index value '" + index
549 + "' not in range [0.." + (this._treeList.size() - 1) + "]");
552 this._treeList.set(index, vTree);
560 public void setTree(final java.lang.String[] vTreeArray)
565 for (int i = 0; i < vTreeArray.length; i++)
567 this._treeList.add(vTreeArray[i]);
575 * @throws org.exolab.castor.xml.MarshalException
576 * if object is null or if any SAXException is thrown during
578 * @throws org.exolab.castor.xml.ValidationException
579 * if this object is an invalid instance according to the schema
580 * @return the unmarshaled jalview.binding.VAMSAS
582 public static jalview.binding.VAMSAS unmarshal(final java.io.Reader reader)
583 throws org.exolab.castor.xml.MarshalException,
584 org.exolab.castor.xml.ValidationException
586 return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(
587 jalview.binding.VAMSAS.class, reader);
593 * @throws org.exolab.castor.xml.ValidationException
594 * if this object is an invalid instance according to the schema
596 public void validate() throws org.exolab.castor.xml.ValidationException
598 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
599 validator.validate(this);