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();
65 * @throws java.lang.IndexOutOfBoundsException if the index
66 * given is outside the bounds of the collection
68 public void addAlignment(
69 final Alignment vAlignment)
70 throws java.lang.IndexOutOfBoundsException {
71 this._alignmentList.addElement(vAlignment);
79 * @throws java.lang.IndexOutOfBoundsException if the index
80 * given is outside the bounds of the collection
82 public void addAlignment(
84 final Alignment vAlignment)
85 throws java.lang.IndexOutOfBoundsException {
86 this._alignmentList.add(index, vAlignment);
93 * @throws java.lang.IndexOutOfBoundsException if the index
94 * given is outside the bounds of the collection
96 public void addSequenceSet(
97 final SequenceSet vSequenceSet)
98 throws java.lang.IndexOutOfBoundsException {
99 this._sequenceSetList.addElement(vSequenceSet);
106 * @param vSequenceSet
107 * @throws java.lang.IndexOutOfBoundsException if the index
108 * given is outside the bounds of the collection
110 public void addSequenceSet(
112 final SequenceSet vSequenceSet)
113 throws java.lang.IndexOutOfBoundsException {
114 this._sequenceSetList.add(index, vSequenceSet);
121 * @throws java.lang.IndexOutOfBoundsException if the index
122 * given is outside the bounds of the collection
125 final java.lang.String vTree)
126 throws java.lang.IndexOutOfBoundsException {
127 this._treeList.addElement(vTree);
135 * @throws java.lang.IndexOutOfBoundsException if the index
136 * given is outside the bounds of the collection
140 final java.lang.String vTree)
141 throws java.lang.IndexOutOfBoundsException {
142 this._treeList.add(index, vTree);
146 * Method enumerateAlignment.
148 * @return an Enumeration over all Alignment elements
150 public java.util.Enumeration enumerateAlignment(
152 return this._alignmentList.elements();
156 * Method enumerateSequenceSet.
158 * @return an Enumeration over all SequenceSet elements
160 public java.util.Enumeration enumerateSequenceSet(
162 return this._sequenceSetList.elements();
166 * Method enumerateTree.
168 * @return an Enumeration over all java.lang.String elements
170 public java.util.Enumeration enumerateTree(
172 return this._treeList.elements();
176 * Method getAlignment.
179 * @throws java.lang.IndexOutOfBoundsException if the index
180 * given is outside the bounds of the collection
181 * @return the value of the Alignment at the given index
183 public Alignment getAlignment(
185 throws java.lang.IndexOutOfBoundsException {
186 // check bounds for index
187 if (index < 0 || index >= this._alignmentList.size()) {
188 throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
191 return (Alignment) _alignmentList.get(index);
195 * Method getAlignment.Returns the contents of the collection
196 * in an Array. <p>Note: Just in case the collection contents
197 * are changing in another thread, we pass a 0-length Array of
198 * the correct type into the API call. This way we <i>know</i>
199 * 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 if the index
224 * given is outside the bounds of the collection
225 * @return the value of the SequenceSet at the given index
227 public SequenceSet getSequenceSet(
229 throws java.lang.IndexOutOfBoundsException {
230 // check bounds for index
231 if (index < 0 || index >= this._sequenceSetList.size()) {
232 throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
235 return (SequenceSet) _sequenceSetList.get(index);
239 * Method getSequenceSet.Returns the contents of the collection
240 * in an Array. <p>Note: Just in case the collection contents
241 * are changing in another thread, we pass a 0-length Array of
242 * the correct type into the API call. This way we <i>know</i>
243 * that the Array returned is of exactly the correct length.
245 * @return this collection as an Array
247 public SequenceSet[] getSequenceSet(
249 SequenceSet[] array = new SequenceSet[0];
250 return (SequenceSet[]) this._sequenceSetList.toArray(array);
254 * Method getSequenceSetCount.
256 * @return the size of this collection
258 public int getSequenceSetCount(
260 return this._sequenceSetList.size();
267 * @throws java.lang.IndexOutOfBoundsException if the index
268 * given is outside the bounds of the collection
269 * @return the value of the java.lang.String at the given index
271 public java.lang.String getTree(
273 throws java.lang.IndexOutOfBoundsException {
274 // check bounds for index
275 if (index < 0 || index >= this._treeList.size()) {
276 throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
279 return (java.lang.String) _treeList.get(index);
283 * Method getTree.Returns the contents of the collection in an
284 * Array. <p>Note: Just in case the collection contents are
285 * changing in another thread, we pass a 0-length Array of the
286 * correct type into the API call. This way we <i>know</i>
287 * that the Array returned is of exactly the correct length.
289 * @return this collection as an Array
291 public java.lang.String[] getTree(
293 java.lang.String[] array = new java.lang.String[0];
294 return (java.lang.String[]) this._treeList.toArray(array);
298 * Method getTreeCount.
300 * @return the size of this collection
302 public int getTreeCount(
304 return this._treeList.size();
310 * @return true if this object is valid according to the schema
312 public boolean isValid(
316 } catch (org.exolab.castor.xml.ValidationException vex) {
326 * @throws org.exolab.castor.xml.MarshalException if object is
327 * null or if any SAXException is thrown during marshaling
328 * @throws org.exolab.castor.xml.ValidationException if this
329 * object is an invalid instance according to the schema
332 final java.io.Writer out)
333 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
334 Marshaller.marshal(this, out);
341 * @throws java.io.IOException if an IOException occurs during
343 * @throws org.exolab.castor.xml.ValidationException if this
344 * object is an invalid instance according to the schema
345 * @throws org.exolab.castor.xml.MarshalException if object is
346 * null or if any SAXException is thrown during marshaling
349 final org.xml.sax.ContentHandler handler)
350 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
351 Marshaller.marshal(this, handler);
355 * Method removeAlignment.
358 * @return true if the object was removed from the collection.
360 public boolean removeAlignment(
361 final Alignment vAlignment) {
362 boolean removed = _alignmentList.remove(vAlignment);
367 * Method removeAlignmentAt.
370 * @return the element removed from the collection
372 public Alignment removeAlignmentAt(
374 java.lang.Object obj = this._alignmentList.remove(index);
375 return (Alignment) obj;
380 public void removeAllAlignment(
382 this._alignmentList.clear();
387 public void removeAllSequenceSet(
389 this._sequenceSetList.clear();
394 public void removeAllTree(
396 this._treeList.clear();
400 * Method removeSequenceSet.
402 * @param vSequenceSet
403 * @return true if the object was removed from the collection.
405 public boolean removeSequenceSet(
406 final SequenceSet vSequenceSet) {
407 boolean removed = _sequenceSetList.remove(vSequenceSet);
412 * Method removeSequenceSetAt.
415 * @return the element removed from the collection
417 public SequenceSet removeSequenceSetAt(
419 java.lang.Object obj = this._sequenceSetList.remove(index);
420 return (SequenceSet) obj;
427 * @return true if the object was removed from the collection.
429 public boolean removeTree(
430 final java.lang.String vTree) {
431 boolean removed = _treeList.remove(vTree);
436 * Method removeTreeAt.
439 * @return the element removed from the collection
441 public java.lang.String removeTreeAt(
443 java.lang.Object obj = this._treeList.remove(index);
444 return (java.lang.String) obj;
452 * @throws java.lang.IndexOutOfBoundsException if the index
453 * given is outside the bounds of the collection
455 public void setAlignment(
457 final Alignment vAlignment)
458 throws java.lang.IndexOutOfBoundsException {
459 // check bounds for index
460 if (index < 0 || index >= this._alignmentList.size()) {
461 throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]");
464 this._alignmentList.set(index, vAlignment);
470 * @param vAlignmentArray
472 public void setAlignment(
473 final Alignment[] vAlignmentArray) {
475 _alignmentList.clear();
477 for (int i = 0; i < vAlignmentArray.length; i++) {
478 this._alignmentList.add(vAlignmentArray[i]);
486 * @param vSequenceSet
487 * @throws java.lang.IndexOutOfBoundsException if the index
488 * given is outside the bounds of the collection
490 public void setSequenceSet(
492 final SequenceSet vSequenceSet)
493 throws java.lang.IndexOutOfBoundsException {
494 // check bounds for index
495 if (index < 0 || index >= this._sequenceSetList.size()) {
496 throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]");
499 this._sequenceSetList.set(index, vSequenceSet);
505 * @param vSequenceSetArray
507 public void setSequenceSet(
508 final SequenceSet[] vSequenceSetArray) {
510 _sequenceSetList.clear();
512 for (int i = 0; i < vSequenceSetArray.length; i++) {
513 this._sequenceSetList.add(vSequenceSetArray[i]);
522 * @throws java.lang.IndexOutOfBoundsException if the index
523 * given is outside the bounds of the collection
527 final java.lang.String vTree)
528 throws java.lang.IndexOutOfBoundsException {
529 // check bounds for index
530 if (index < 0 || index >= this._treeList.size()) {
531 throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
534 this._treeList.set(index, vTree);
543 final java.lang.String[] vTreeArray) {
547 for (int i = 0; i < vTreeArray.length; i++) {
548 this._treeList.add(vTreeArray[i]);
556 * @throws org.exolab.castor.xml.MarshalException if object is
557 * null or if any SAXException is thrown during marshaling
558 * @throws org.exolab.castor.xml.ValidationException if this
559 * object is an invalid instance according to the schema
560 * @return the unmarshaled jalview.binding.VAMSAS
562 public static jalview.binding.VAMSAS unmarshal(
563 final java.io.Reader reader)
564 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
565 return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VAMSAS.class, reader);
571 * @throws org.exolab.castor.xml.ValidationException if this
572 * object is an invalid instance according to the schema
574 public void validate(
576 throws org.exolab.castor.xml.ValidationException {
577 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
578 validator.validate(this);