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