1c92bd357fe8567482bbb819189b85d4db286ae0
[jalview.git] / src / jalview / binding / VAMSAS.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.binding;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class VAMSAS.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class VAMSAS implements java.io.Serializable {
23
24
25       //--------------------------/
26      //- Class/Member Variables -/
27     //--------------------------/
28
29     /**
30      * Field _alignmentList.
31      */
32     private java.util.Vector _alignmentList;
33
34     /**
35      * Field _treeList.
36      */
37     private java.util.Vector _treeList;
38
39     /**
40      * Field _sequenceSetList.
41      */
42     private java.util.Vector _sequenceSetList;
43
44
45       //----------------/
46      //- Constructors -/
47     //----------------/
48
49     public VAMSAS() {
50         super();
51         this._alignmentList = new java.util.Vector();
52         this._treeList = new java.util.Vector();
53         this._sequenceSetList = new java.util.Vector();
54     }
55
56
57       //-----------/
58      //- Methods -/
59     //-----------/
60
61     /**
62      * 
63      * 
64      * @param vAlignment
65      * @throws java.lang.IndexOutOfBoundsException if the index
66      * given is outside the bounds of the collection
67      */
68     public void addAlignment(
69             final Alignment vAlignment)
70     throws java.lang.IndexOutOfBoundsException {
71         this._alignmentList.addElement(vAlignment);
72     }
73
74     /**
75      * 
76      * 
77      * @param index
78      * @param vAlignment
79      * @throws java.lang.IndexOutOfBoundsException if the index
80      * given is outside the bounds of the collection
81      */
82     public void addAlignment(
83             final int index,
84             final Alignment vAlignment)
85     throws java.lang.IndexOutOfBoundsException {
86         this._alignmentList.add(index, vAlignment);
87     }
88
89     /**
90      * 
91      * 
92      * @param vSequenceSet
93      * @throws java.lang.IndexOutOfBoundsException if the index
94      * given is outside the bounds of the collection
95      */
96     public void addSequenceSet(
97             final SequenceSet vSequenceSet)
98     throws java.lang.IndexOutOfBoundsException {
99         this._sequenceSetList.addElement(vSequenceSet);
100     }
101
102     /**
103      * 
104      * 
105      * @param index
106      * @param vSequenceSet
107      * @throws java.lang.IndexOutOfBoundsException if the index
108      * given is outside the bounds of the collection
109      */
110     public void addSequenceSet(
111             final int index,
112             final SequenceSet vSequenceSet)
113     throws java.lang.IndexOutOfBoundsException {
114         this._sequenceSetList.add(index, vSequenceSet);
115     }
116
117     /**
118      * 
119      * 
120      * @param vTree
121      * @throws java.lang.IndexOutOfBoundsException if the index
122      * given is outside the bounds of the collection
123      */
124     public void addTree(
125             final java.lang.String vTree)
126     throws java.lang.IndexOutOfBoundsException {
127         this._treeList.addElement(vTree);
128     }
129
130     /**
131      * 
132      * 
133      * @param index
134      * @param vTree
135      * @throws java.lang.IndexOutOfBoundsException if the index
136      * given is outside the bounds of the collection
137      */
138     public void addTree(
139             final int index,
140             final java.lang.String vTree)
141     throws java.lang.IndexOutOfBoundsException {
142         this._treeList.add(index, vTree);
143     }
144
145     /**
146      * Method enumerateAlignment.
147      * 
148      * @return an Enumeration over all Alignment elements
149      */
150     public java.util.Enumeration enumerateAlignment(
151     ) {
152         return this._alignmentList.elements();
153     }
154
155     /**
156      * Method enumerateSequenceSet.
157      * 
158      * @return an Enumeration over all SequenceSet elements
159      */
160     public java.util.Enumeration enumerateSequenceSet(
161     ) {
162         return this._sequenceSetList.elements();
163     }
164
165     /**
166      * Method enumerateTree.
167      * 
168      * @return an Enumeration over all java.lang.String elements
169      */
170     public java.util.Enumeration enumerateTree(
171     ) {
172         return this._treeList.elements();
173     }
174
175     /**
176      * Method getAlignment.
177      * 
178      * @param index
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
182      */
183     public Alignment getAlignment(
184             final int index)
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) + "]");
189         }
190         
191         return (Alignment) _alignmentList.get(index);
192     }
193
194     /**
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.
200      * 
201      * @return this collection as an Array
202      */
203     public Alignment[] getAlignment(
204     ) {
205         Alignment[] array = new Alignment[0];
206         return (Alignment[]) this._alignmentList.toArray(array);
207     }
208
209     /**
210      * Method getAlignmentCount.
211      * 
212      * @return the size of this collection
213      */
214     public int getAlignmentCount(
215     ) {
216         return this._alignmentList.size();
217     }
218
219     /**
220      * Method getSequenceSet.
221      * 
222      * @param index
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
226      */
227     public SequenceSet getSequenceSet(
228             final int index)
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) + "]");
233         }
234         
235         return (SequenceSet) _sequenceSetList.get(index);
236     }
237
238     /**
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.
244      * 
245      * @return this collection as an Array
246      */
247     public SequenceSet[] getSequenceSet(
248     ) {
249         SequenceSet[] array = new SequenceSet[0];
250         return (SequenceSet[]) this._sequenceSetList.toArray(array);
251     }
252
253     /**
254      * Method getSequenceSetCount.
255      * 
256      * @return the size of this collection
257      */
258     public int getSequenceSetCount(
259     ) {
260         return this._sequenceSetList.size();
261     }
262
263     /**
264      * Method getTree.
265      * 
266      * @param index
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
270      */
271     public java.lang.String getTree(
272             final int index)
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) + "]");
277         }
278         
279         return (java.lang.String) _treeList.get(index);
280     }
281
282     /**
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.
288      * 
289      * @return this collection as an Array
290      */
291     public java.lang.String[] getTree(
292     ) {
293         java.lang.String[] array = new java.lang.String[0];
294         return (java.lang.String[]) this._treeList.toArray(array);
295     }
296
297     /**
298      * Method getTreeCount.
299      * 
300      * @return the size of this collection
301      */
302     public int getTreeCount(
303     ) {
304         return this._treeList.size();
305     }
306
307     /**
308      * Method isValid.
309      * 
310      * @return true if this object is valid according to the schema
311      */
312     public boolean isValid(
313     ) {
314         try {
315             validate();
316         } catch (org.exolab.castor.xml.ValidationException vex) {
317             return false;
318         }
319         return true;
320     }
321
322     /**
323      * 
324      * 
325      * @param out
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
330      */
331     public void marshal(
332             final java.io.Writer out)
333     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
334         Marshaller.marshal(this, out);
335     }
336
337     /**
338      * 
339      * 
340      * @param handler
341      * @throws java.io.IOException if an IOException occurs during
342      * marshaling
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
347      */
348     public void marshal(
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);
352     }
353
354     /**
355      * Method removeAlignment.
356      * 
357      * @param vAlignment
358      * @return true if the object was removed from the collection.
359      */
360     public boolean removeAlignment(
361             final Alignment vAlignment) {
362         boolean removed = _alignmentList.remove(vAlignment);
363         return removed;
364     }
365
366     /**
367      * Method removeAlignmentAt.
368      * 
369      * @param index
370      * @return the element removed from the collection
371      */
372     public Alignment removeAlignmentAt(
373             final int index) {
374         java.lang.Object obj = this._alignmentList.remove(index);
375         return (Alignment) obj;
376     }
377
378     /**
379      */
380     public void removeAllAlignment(
381     ) {
382         this._alignmentList.clear();
383     }
384
385     /**
386      */
387     public void removeAllSequenceSet(
388     ) {
389         this._sequenceSetList.clear();
390     }
391
392     /**
393      */
394     public void removeAllTree(
395     ) {
396         this._treeList.clear();
397     }
398
399     /**
400      * Method removeSequenceSet.
401      * 
402      * @param vSequenceSet
403      * @return true if the object was removed from the collection.
404      */
405     public boolean removeSequenceSet(
406             final SequenceSet vSequenceSet) {
407         boolean removed = _sequenceSetList.remove(vSequenceSet);
408         return removed;
409     }
410
411     /**
412      * Method removeSequenceSetAt.
413      * 
414      * @param index
415      * @return the element removed from the collection
416      */
417     public SequenceSet removeSequenceSetAt(
418             final int index) {
419         java.lang.Object obj = this._sequenceSetList.remove(index);
420         return (SequenceSet) obj;
421     }
422
423     /**
424      * Method removeTree.
425      * 
426      * @param vTree
427      * @return true if the object was removed from the collection.
428      */
429     public boolean removeTree(
430             final java.lang.String vTree) {
431         boolean removed = _treeList.remove(vTree);
432         return removed;
433     }
434
435     /**
436      * Method removeTreeAt.
437      * 
438      * @param index
439      * @return the element removed from the collection
440      */
441     public java.lang.String removeTreeAt(
442             final int index) {
443         java.lang.Object obj = this._treeList.remove(index);
444         return (java.lang.String) obj;
445     }
446
447     /**
448      * 
449      * 
450      * @param index
451      * @param vAlignment
452      * @throws java.lang.IndexOutOfBoundsException if the index
453      * given is outside the bounds of the collection
454      */
455     public void setAlignment(
456             final int index,
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) + "]");
462         }
463         
464         this._alignmentList.set(index, vAlignment);
465     }
466
467     /**
468      * 
469      * 
470      * @param vAlignmentArray
471      */
472     public void setAlignment(
473             final Alignment[] vAlignmentArray) {
474         //-- copy array
475         _alignmentList.clear();
476         
477         for (int i = 0; i < vAlignmentArray.length; i++) {
478                 this._alignmentList.add(vAlignmentArray[i]);
479         }
480     }
481
482     /**
483      * 
484      * 
485      * @param index
486      * @param vSequenceSet
487      * @throws java.lang.IndexOutOfBoundsException if the index
488      * given is outside the bounds of the collection
489      */
490     public void setSequenceSet(
491             final int index,
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) + "]");
497         }
498         
499         this._sequenceSetList.set(index, vSequenceSet);
500     }
501
502     /**
503      * 
504      * 
505      * @param vSequenceSetArray
506      */
507     public void setSequenceSet(
508             final SequenceSet[] vSequenceSetArray) {
509         //-- copy array
510         _sequenceSetList.clear();
511         
512         for (int i = 0; i < vSequenceSetArray.length; i++) {
513                 this._sequenceSetList.add(vSequenceSetArray[i]);
514         }
515     }
516
517     /**
518      * 
519      * 
520      * @param index
521      * @param vTree
522      * @throws java.lang.IndexOutOfBoundsException if the index
523      * given is outside the bounds of the collection
524      */
525     public void setTree(
526             final int index,
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) + "]");
532         }
533         
534         this._treeList.set(index, vTree);
535     }
536
537     /**
538      * 
539      * 
540      * @param vTreeArray
541      */
542     public void setTree(
543             final java.lang.String[] vTreeArray) {
544         //-- copy array
545         _treeList.clear();
546         
547         for (int i = 0; i < vTreeArray.length; i++) {
548                 this._treeList.add(vTreeArray[i]);
549         }
550     }
551
552     /**
553      * Method unmarshal.
554      * 
555      * @param reader
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
561      */
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);
566     }
567
568     /**
569      * 
570      * 
571      * @throws org.exolab.castor.xml.ValidationException if this
572      * object is an invalid instance according to the schema
573      */
574     public void validate(
575     )
576     throws org.exolab.castor.xml.ValidationException {
577         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
578         validator.validate(this);
579     }
580
581 }