JAL-2664 Updates following review
[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   // - Constructors -/
46   // ----------------/
47
48   public VAMSAS()
49   {
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   // - Methods -/
58   // -----------/
59
60   /**
61    * 
62    * 
63    * @param vAlignment
64    * @throws java.lang.IndexOutOfBoundsException
65    *           if the index given is outside the bounds of the collection
66    */
67   public void addAlignment(final Alignment vAlignment)
68           throws java.lang.IndexOutOfBoundsException
69   {
70     this._alignmentList.addElement(vAlignment);
71   }
72
73   /**
74    * 
75    * 
76    * @param index
77    * @param vAlignment
78    * @throws java.lang.IndexOutOfBoundsException
79    *           if the index given is outside the bounds of the collection
80    */
81   public void addAlignment(final int index, final Alignment vAlignment)
82           throws java.lang.IndexOutOfBoundsException
83   {
84     this._alignmentList.add(index, vAlignment);
85   }
86
87   /**
88    * 
89    * 
90    * @param vSequenceSet
91    * @throws java.lang.IndexOutOfBoundsException
92    *           if the index given is outside the bounds of the collection
93    */
94   public void addSequenceSet(final SequenceSet vSequenceSet)
95           throws java.lang.IndexOutOfBoundsException
96   {
97     this._sequenceSetList.addElement(vSequenceSet);
98   }
99
100   /**
101    * 
102    * 
103    * @param index
104    * @param vSequenceSet
105    * @throws java.lang.IndexOutOfBoundsException
106    *           if the index given is outside the bounds of the collection
107    */
108   public void addSequenceSet(final int index, final SequenceSet vSequenceSet)
109           throws java.lang.IndexOutOfBoundsException
110   {
111     this._sequenceSetList.add(index, vSequenceSet);
112   }
113
114   /**
115    * 
116    * 
117    * @param vTree
118    * @throws java.lang.IndexOutOfBoundsException
119    *           if the index given is outside the bounds of the collection
120    */
121   public void addTree(final java.lang.String vTree)
122           throws java.lang.IndexOutOfBoundsException
123   {
124     this._treeList.addElement(vTree);
125   }
126
127   /**
128    * 
129    * 
130    * @param index
131    * @param vTree
132    * @throws java.lang.IndexOutOfBoundsException
133    *           if the index given is outside the bounds of the collection
134    */
135   public void addTree(final int index, final java.lang.String vTree)
136           throws java.lang.IndexOutOfBoundsException
137   {
138     this._treeList.add(index, vTree);
139   }
140
141   /**
142    * Method enumerateAlignment.
143    * 
144    * @return an Enumeration over all Alignment elements
145    */
146   public java.util.Enumeration enumerateAlignment()
147   {
148     return this._alignmentList.elements();
149   }
150
151   /**
152    * Method enumerateSequenceSet.
153    * 
154    * @return an Enumeration over all SequenceSet elements
155    */
156   public java.util.Enumeration enumerateSequenceSet()
157   {
158     return this._sequenceSetList.elements();
159   }
160
161   /**
162    * Method enumerateTree.
163    * 
164    * @return an Enumeration over all java.lang.String elements
165    */
166   public java.util.Enumeration enumerateTree()
167   {
168     return this._treeList.elements();
169   }
170
171   /**
172    * Method getAlignment.
173    * 
174    * @param index
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
178    */
179   public Alignment getAlignment(final int index)
180           throws java.lang.IndexOutOfBoundsException
181   {
182     // check bounds for index
183     if (index < 0 || index >= this._alignmentList.size())
184     {
185       throw new IndexOutOfBoundsException("getAlignment: Index value '"
186               + index + "' not in range [0.."
187               + (this._alignmentList.size() - 1) + "]");
188     }
189
190     return (Alignment) _alignmentList.get(index);
191   }
192
193   /**
194    * Method getAlignment.Returns the contents of the collection in an Array.
195    * <p>
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.
199    * 
200    * @return this collection as an Array
201    */
202   public Alignment[] getAlignment()
203   {
204     Alignment[] array = new Alignment[0];
205     return (Alignment[]) this._alignmentList.toArray(array);
206   }
207
208   /**
209    * Method getAlignmentCount.
210    * 
211    * @return the size of this collection
212    */
213   public int getAlignmentCount()
214   {
215     return this._alignmentList.size();
216   }
217
218   /**
219    * Method getSequenceSet.
220    * 
221    * @param index
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
225    */
226   public SequenceSet getSequenceSet(final int index)
227           throws java.lang.IndexOutOfBoundsException
228   {
229     // check bounds for index
230     if (index < 0 || index >= this._sequenceSetList.size())
231     {
232       throw new IndexOutOfBoundsException("getSequenceSet: Index value '"
233               + index + "' not in range [0.."
234               + (this._sequenceSetList.size() - 1) + "]");
235     }
236
237     return (SequenceSet) _sequenceSetList.get(index);
238   }
239
240   /**
241    * Method getSequenceSet.Returns the contents of the collection in an Array.
242    * <p>
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.
246    * 
247    * @return this collection as an Array
248    */
249   public SequenceSet[] getSequenceSet()
250   {
251     SequenceSet[] array = new SequenceSet[0];
252     return (SequenceSet[]) this._sequenceSetList.toArray(array);
253   }
254
255   /**
256    * Method getSequenceSetCount.
257    * 
258    * @return the size of this collection
259    */
260   public int getSequenceSetCount()
261   {
262     return this._sequenceSetList.size();
263   }
264
265   /**
266    * Method getTree.
267    * 
268    * @param index
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
272    */
273   public java.lang.String getTree(final int index)
274           throws java.lang.IndexOutOfBoundsException
275   {
276     // check bounds for index
277     if (index < 0 || index >= this._treeList.size())
278     {
279       throw new IndexOutOfBoundsException("getTree: Index value '" + index
280               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
281     }
282
283     return (java.lang.String) _treeList.get(index);
284   }
285
286   /**
287    * Method getTree.Returns the contents of the collection in an Array.
288    * <p>
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.
292    * 
293    * @return this collection as an Array
294    */
295   public java.lang.String[] getTree()
296   {
297     java.lang.String[] array = new java.lang.String[0];
298     return (java.lang.String[]) this._treeList.toArray(array);
299   }
300
301   /**
302    * Method getTreeCount.
303    * 
304    * @return the size of this collection
305    */
306   public int getTreeCount()
307   {
308     return this._treeList.size();
309   }
310
311   /**
312    * Method isValid.
313    * 
314    * @return true if this object is valid according to the schema
315    */
316   public boolean isValid()
317   {
318     try
319     {
320       validate();
321     } catch (org.exolab.castor.xml.ValidationException vex)
322     {
323       return false;
324     }
325     return true;
326   }
327
328   /**
329    * 
330    * 
331    * @param out
332    * @throws org.exolab.castor.xml.MarshalException
333    *           if object is null or if any SAXException is thrown during
334    *           marshaling
335    * @throws org.exolab.castor.xml.ValidationException
336    *           if this object is an invalid instance according to the schema
337    */
338   public void marshal(final java.io.Writer out)
339           throws org.exolab.castor.xml.MarshalException,
340           org.exolab.castor.xml.ValidationException
341   {
342     Marshaller.marshal(this, out);
343   }
344
345   /**
346    * 
347    * 
348    * @param handler
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
355    *           marshaling
356    */
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
361   {
362     Marshaller.marshal(this, handler);
363   }
364
365   /**
366    * Method removeAlignment.
367    * 
368    * @param vAlignment
369    * @return true if the object was removed from the collection.
370    */
371   public boolean removeAlignment(final Alignment vAlignment)
372   {
373     boolean removed = _alignmentList.remove(vAlignment);
374     return removed;
375   }
376
377   /**
378    * Method removeAlignmentAt.
379    * 
380    * @param index
381    * @return the element removed from the collection
382    */
383   public Alignment removeAlignmentAt(final int index)
384   {
385     java.lang.Object obj = this._alignmentList.remove(index);
386     return (Alignment) obj;
387   }
388
389   /**
390      */
391   public void removeAllAlignment()
392   {
393     this._alignmentList.clear();
394   }
395
396   /**
397      */
398   public void removeAllSequenceSet()
399   {
400     this._sequenceSetList.clear();
401   }
402
403   /**
404      */
405   public void removeAllTree()
406   {
407     this._treeList.clear();
408   }
409
410   /**
411    * Method removeSequenceSet.
412    * 
413    * @param vSequenceSet
414    * @return true if the object was removed from the collection.
415    */
416   public boolean removeSequenceSet(final SequenceSet vSequenceSet)
417   {
418     boolean removed = _sequenceSetList.remove(vSequenceSet);
419     return removed;
420   }
421
422   /**
423    * Method removeSequenceSetAt.
424    * 
425    * @param index
426    * @return the element removed from the collection
427    */
428   public SequenceSet removeSequenceSetAt(final int index)
429   {
430     java.lang.Object obj = this._sequenceSetList.remove(index);
431     return (SequenceSet) obj;
432   }
433
434   /**
435    * Method removeTree.
436    * 
437    * @param vTree
438    * @return true if the object was removed from the collection.
439    */
440   public boolean removeTree(final java.lang.String vTree)
441   {
442     boolean removed = _treeList.remove(vTree);
443     return removed;
444   }
445
446   /**
447    * Method removeTreeAt.
448    * 
449    * @param index
450    * @return the element removed from the collection
451    */
452   public java.lang.String removeTreeAt(final int index)
453   {
454     java.lang.Object obj = this._treeList.remove(index);
455     return (java.lang.String) obj;
456   }
457
458   /**
459    * 
460    * 
461    * @param index
462    * @param vAlignment
463    * @throws java.lang.IndexOutOfBoundsException
464    *           if the index given is outside the bounds of the collection
465    */
466   public void setAlignment(final int index, final Alignment vAlignment)
467           throws java.lang.IndexOutOfBoundsException
468   {
469     // check bounds for index
470     if (index < 0 || index >= this._alignmentList.size())
471     {
472       throw new IndexOutOfBoundsException("setAlignment: Index value '"
473               + index + "' not in range [0.."
474               + (this._alignmentList.size() - 1) + "]");
475     }
476
477     this._alignmentList.set(index, vAlignment);
478   }
479
480   /**
481    * 
482    * 
483    * @param vAlignmentArray
484    */
485   public void setAlignment(final Alignment[] vAlignmentArray)
486   {
487     // -- copy array
488     _alignmentList.clear();
489
490     for (int i = 0; i < vAlignmentArray.length; i++)
491     {
492       this._alignmentList.add(vAlignmentArray[i]);
493     }
494   }
495
496   /**
497    * 
498    * 
499    * @param index
500    * @param vSequenceSet
501    * @throws java.lang.IndexOutOfBoundsException
502    *           if the index given is outside the bounds of the collection
503    */
504   public void setSequenceSet(final int index, final SequenceSet vSequenceSet)
505           throws java.lang.IndexOutOfBoundsException
506   {
507     // check bounds for index
508     if (index < 0 || index >= this._sequenceSetList.size())
509     {
510       throw new IndexOutOfBoundsException("setSequenceSet: Index value '"
511               + index + "' not in range [0.."
512               + (this._sequenceSetList.size() - 1) + "]");
513     }
514
515     this._sequenceSetList.set(index, vSequenceSet);
516   }
517
518   /**
519    * 
520    * 
521    * @param vSequenceSetArray
522    */
523   public void setSequenceSet(final SequenceSet[] vSequenceSetArray)
524   {
525     // -- copy array
526     _sequenceSetList.clear();
527
528     for (int i = 0; i < vSequenceSetArray.length; i++)
529     {
530       this._sequenceSetList.add(vSequenceSetArray[i]);
531     }
532   }
533
534   /**
535    * 
536    * 
537    * @param index
538    * @param vTree
539    * @throws java.lang.IndexOutOfBoundsException
540    *           if the index given is outside the bounds of the collection
541    */
542   public void setTree(final int index, final java.lang.String vTree)
543           throws java.lang.IndexOutOfBoundsException
544   {
545     // check bounds for index
546     if (index < 0 || index >= this._treeList.size())
547     {
548       throw new IndexOutOfBoundsException("setTree: Index value '" + index
549               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
550     }
551
552     this._treeList.set(index, vTree);
553   }
554
555   /**
556    * 
557    * 
558    * @param vTreeArray
559    */
560   public void setTree(final java.lang.String[] vTreeArray)
561   {
562     // -- copy array
563     _treeList.clear();
564
565     for (int i = 0; i < vTreeArray.length; i++)
566     {
567       this._treeList.add(vTreeArray[i]);
568     }
569   }
570
571   /**
572    * Method unmarshal.
573    * 
574    * @param reader
575    * @throws org.exolab.castor.xml.MarshalException
576    *           if object is null or if any SAXException is thrown during
577    *           marshaling
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
581    */
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
585   {
586     return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(
587             jalview.binding.VAMSAS.class, reader);
588   }
589
590   /**
591    * 
592    * 
593    * @throws org.exolab.castor.xml.ValidationException
594    *           if this object is an invalid instance according to the schema
595    */
596   public void validate() throws org.exolab.castor.xml.ValidationException
597   {
598     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
599     validator.validate(this);
600   }
601
602 }