Copyright test
[jalview.git] / src / jalview / schemabinding / version2 / JalviewModelSequence.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $(date) The Jalview Authors
4  *
5  * This file is part of Jalview.
6  *  
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *   
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  *******************************************************************************/
21 /*
22  * This class was automatically generated with 
23  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
24  * Schema.
25  * $Id$
26  */
27
28 package jalview.schemabinding.version2;
29
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
33
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
36
37 /**
38  * Class JalviewModelSequence.
39  * 
40  * @version $Revision$ $Date$
41  */
42 public class JalviewModelSequence implements java.io.Serializable
43 {
44
45   // --------------------------/
46   // - Class/Member Variables -/
47   // --------------------------/
48
49   /**
50    * Field _JSeqList.
51    */
52   private java.util.Vector _JSeqList;
53
54   /**
55    * Field _JGroupList.
56    */
57   private java.util.Vector _JGroupList;
58
59   /**
60    * Field _viewportList.
61    */
62   private java.util.Vector _viewportList;
63
64   /**
65    * Field _userColoursList.
66    */
67   private java.util.Vector _userColoursList;
68
69   /**
70    * Field _treeList.
71    */
72   private java.util.Vector _treeList;
73
74   /**
75    * Field _featureSettings.
76    */
77   private jalview.schemabinding.version2.FeatureSettings _featureSettings;
78
79   // ----------------/
80   // - Constructors -/
81   // ----------------/
82
83   public JalviewModelSequence()
84   {
85     super();
86     this._JSeqList = new java.util.Vector();
87     this._JGroupList = new java.util.Vector();
88     this._viewportList = new java.util.Vector();
89     this._userColoursList = new java.util.Vector();
90     this._treeList = new java.util.Vector();
91   }
92
93   // -----------/
94   // - Methods -/
95   // -----------/
96
97   /**
98    * 
99    * 
100    * @param vJGroup
101    * @throws java.lang.IndexOutOfBoundsException
102    *           if the index given is outside the bounds of the collection
103    */
104   public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup)
105           throws java.lang.IndexOutOfBoundsException
106   {
107     this._JGroupList.addElement(vJGroup);
108   }
109
110   /**
111    * 
112    * 
113    * @param index
114    * @param vJGroup
115    * @throws java.lang.IndexOutOfBoundsException
116    *           if the index given is outside the bounds of the collection
117    */
118   public void addJGroup(final int index,
119           final jalview.schemabinding.version2.JGroup vJGroup)
120           throws java.lang.IndexOutOfBoundsException
121   {
122     this._JGroupList.add(index, vJGroup);
123   }
124
125   /**
126    * 
127    * 
128    * @param vJSeq
129    * @throws java.lang.IndexOutOfBoundsException
130    *           if the index given is outside the bounds of the collection
131    */
132   public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
133           throws java.lang.IndexOutOfBoundsException
134   {
135     this._JSeqList.addElement(vJSeq);
136   }
137
138   /**
139    * 
140    * 
141    * @param index
142    * @param vJSeq
143    * @throws java.lang.IndexOutOfBoundsException
144    *           if the index given is outside the bounds of the collection
145    */
146   public void addJSeq(final int index,
147           final jalview.schemabinding.version2.JSeq vJSeq)
148           throws java.lang.IndexOutOfBoundsException
149   {
150     this._JSeqList.add(index, vJSeq);
151   }
152
153   /**
154    * 
155    * 
156    * @param vTree
157    * @throws java.lang.IndexOutOfBoundsException
158    *           if the index given is outside the bounds of the collection
159    */
160   public void addTree(final jalview.schemabinding.version2.Tree vTree)
161           throws java.lang.IndexOutOfBoundsException
162   {
163     this._treeList.addElement(vTree);
164   }
165
166   /**
167    * 
168    * 
169    * @param index
170    * @param vTree
171    * @throws java.lang.IndexOutOfBoundsException
172    *           if the index given is outside the bounds of the collection
173    */
174   public void addTree(final int index,
175           final jalview.schemabinding.version2.Tree vTree)
176           throws java.lang.IndexOutOfBoundsException
177   {
178     this._treeList.add(index, vTree);
179   }
180
181   /**
182    * 
183    * 
184    * @param vUserColours
185    * @throws java.lang.IndexOutOfBoundsException
186    *           if the index given is outside the bounds of the collection
187    */
188   public void addUserColours(
189           final jalview.schemabinding.version2.UserColours vUserColours)
190           throws java.lang.IndexOutOfBoundsException
191   {
192     this._userColoursList.addElement(vUserColours);
193   }
194
195   /**
196    * 
197    * 
198    * @param index
199    * @param vUserColours
200    * @throws java.lang.IndexOutOfBoundsException
201    *           if the index given is outside the bounds of the collection
202    */
203   public void addUserColours(final int index,
204           final jalview.schemabinding.version2.UserColours vUserColours)
205           throws java.lang.IndexOutOfBoundsException
206   {
207     this._userColoursList.add(index, vUserColours);
208   }
209
210   /**
211    * 
212    * 
213    * @param vViewport
214    * @throws java.lang.IndexOutOfBoundsException
215    *           if the index given is outside the bounds of the collection
216    */
217   public void addViewport(
218           final jalview.schemabinding.version2.Viewport vViewport)
219           throws java.lang.IndexOutOfBoundsException
220   {
221     this._viewportList.addElement(vViewport);
222   }
223
224   /**
225    * 
226    * 
227    * @param index
228    * @param vViewport
229    * @throws java.lang.IndexOutOfBoundsException
230    *           if the index given is outside the bounds of the collection
231    */
232   public void addViewport(final int index,
233           final jalview.schemabinding.version2.Viewport vViewport)
234           throws java.lang.IndexOutOfBoundsException
235   {
236     this._viewportList.add(index, vViewport);
237   }
238
239   /**
240    * Method enumerateJGroup.
241    * 
242    * @return an Enumeration over all jalview.schemabinding.version2.JGroup
243    *         elements
244    */
245   public java.util.Enumeration enumerateJGroup()
246   {
247     return this._JGroupList.elements();
248   }
249
250   /**
251    * Method enumerateJSeq.
252    * 
253    * @return an Enumeration over all jalview.schemabinding.version2.JSeq
254    *         elements
255    */
256   public java.util.Enumeration enumerateJSeq()
257   {
258     return this._JSeqList.elements();
259   }
260
261   /**
262    * Method enumerateTree.
263    * 
264    * @return an Enumeration over all jalview.schemabinding.version2.Tree
265    *         elements
266    */
267   public java.util.Enumeration enumerateTree()
268   {
269     return this._treeList.elements();
270   }
271
272   /**
273    * Method enumerateUserColours.
274    * 
275    * @return an Enumeration over all jalview.schemabinding.version2.UserColours
276    *         elements
277    */
278   public java.util.Enumeration enumerateUserColours()
279   {
280     return this._userColoursList.elements();
281   }
282
283   /**
284    * Method enumerateViewport.
285    * 
286    * @return an Enumeration over all jalview.schemabinding.version2.Viewport
287    *         elements
288    */
289   public java.util.Enumeration enumerateViewport()
290   {
291     return this._viewportList.elements();
292   }
293
294   /**
295    * Returns the value of field 'featureSettings'.
296    * 
297    * @return the value of field 'FeatureSettings'.
298    */
299   public jalview.schemabinding.version2.FeatureSettings getFeatureSettings()
300   {
301     return this._featureSettings;
302   }
303
304   /**
305    * Method getJGroup.
306    * 
307    * @param index
308    * @throws java.lang.IndexOutOfBoundsException
309    *           if the index given is outside the bounds of the collection
310    * @return the value of the jalview.schemabinding.version2.JGroup at the given
311    *         index
312    */
313   public jalview.schemabinding.version2.JGroup getJGroup(final int index)
314           throws java.lang.IndexOutOfBoundsException
315   {
316     // check bounds for index
317     if (index < 0 || index >= this._JGroupList.size())
318     {
319       throw new IndexOutOfBoundsException("getJGroup: Index value '"
320               + index + "' not in range [0.."
321               + (this._JGroupList.size() - 1) + "]");
322     }
323
324     return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index);
325   }
326
327   /**
328    * Method getJGroup.Returns the contents of the collection in an Array.
329    * <p>
330    * Note: Just in case the collection contents are changing in another thread,
331    * we pass a 0-length Array of the correct type into the API call. This way we
332    * <i>know</i> that the Array returned is of exactly the correct length.
333    * 
334    * @return this collection as an Array
335    */
336   public jalview.schemabinding.version2.JGroup[] getJGroup()
337   {
338     jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0];
339     return (jalview.schemabinding.version2.JGroup[]) this._JGroupList
340             .toArray(array);
341   }
342
343   /**
344    * Method getJGroupCount.
345    * 
346    * @return the size of this collection
347    */
348   public int getJGroupCount()
349   {
350     return this._JGroupList.size();
351   }
352
353   /**
354    * Method getJSeq.
355    * 
356    * @param index
357    * @throws java.lang.IndexOutOfBoundsException
358    *           if the index given is outside the bounds of the collection
359    * @return the value of the jalview.schemabinding.version2.JSeq at the given
360    *         index
361    */
362   public jalview.schemabinding.version2.JSeq getJSeq(final int index)
363           throws java.lang.IndexOutOfBoundsException
364   {
365     // check bounds for index
366     if (index < 0 || index >= this._JSeqList.size())
367     {
368       throw new IndexOutOfBoundsException("getJSeq: Index value '" + index
369               + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
370     }
371
372     return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index);
373   }
374
375   /**
376    * Method getJSeq.Returns the contents of the collection in an Array.
377    * <p>
378    * Note: Just in case the collection contents are changing in another thread,
379    * we pass a 0-length Array of the correct type into the API call. This way we
380    * <i>know</i> that the Array returned is of exactly the correct length.
381    * 
382    * @return this collection as an Array
383    */
384   public jalview.schemabinding.version2.JSeq[] getJSeq()
385   {
386     jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0];
387     return (jalview.schemabinding.version2.JSeq[]) this._JSeqList
388             .toArray(array);
389   }
390
391   /**
392    * Method getJSeqCount.
393    * 
394    * @return the size of this collection
395    */
396   public int getJSeqCount()
397   {
398     return this._JSeqList.size();
399   }
400
401   /**
402    * Method getTree.
403    * 
404    * @param index
405    * @throws java.lang.IndexOutOfBoundsException
406    *           if the index given is outside the bounds of the collection
407    * @return the value of the jalview.schemabinding.version2.Tree at the given
408    *         index
409    */
410   public jalview.schemabinding.version2.Tree getTree(final int index)
411           throws java.lang.IndexOutOfBoundsException
412   {
413     // check bounds for index
414     if (index < 0 || index >= this._treeList.size())
415     {
416       throw new IndexOutOfBoundsException("getTree: Index value '" + index
417               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
418     }
419
420     return (jalview.schemabinding.version2.Tree) _treeList.get(index);
421   }
422
423   /**
424    * Method getTree.Returns the contents of the collection in an Array.
425    * <p>
426    * Note: Just in case the collection contents are changing in another thread,
427    * we pass a 0-length Array of the correct type into the API call. This way we
428    * <i>know</i> that the Array returned is of exactly the correct length.
429    * 
430    * @return this collection as an Array
431    */
432   public jalview.schemabinding.version2.Tree[] getTree()
433   {
434     jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0];
435     return (jalview.schemabinding.version2.Tree[]) this._treeList
436             .toArray(array);
437   }
438
439   /**
440    * Method getTreeCount.
441    * 
442    * @return the size of this collection
443    */
444   public int getTreeCount()
445   {
446     return this._treeList.size();
447   }
448
449   /**
450    * Method getUserColours.
451    * 
452    * @param index
453    * @throws java.lang.IndexOutOfBoundsException
454    *           if the index given is outside the bounds of the collection
455    * @return the value of the jalview.schemabinding.version2.UserColours at the
456    *         given index
457    */
458   public jalview.schemabinding.version2.UserColours getUserColours(
459           final int index) throws java.lang.IndexOutOfBoundsException
460   {
461     // check bounds for index
462     if (index < 0 || index >= this._userColoursList.size())
463     {
464       throw new IndexOutOfBoundsException("getUserColours: Index value '"
465               + index + "' not in range [0.."
466               + (this._userColoursList.size() - 1) + "]");
467     }
468
469     return (jalview.schemabinding.version2.UserColours) _userColoursList
470             .get(index);
471   }
472
473   /**
474    * Method getUserColours.Returns the contents of the collection in an Array.
475    * <p>
476    * Note: Just in case the collection contents are changing in another thread,
477    * we pass a 0-length Array of the correct type into the API call. This way we
478    * <i>know</i> that the Array returned is of exactly the correct length.
479    * 
480    * @return this collection as an Array
481    */
482   public jalview.schemabinding.version2.UserColours[] getUserColours()
483   {
484     jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0];
485     return (jalview.schemabinding.version2.UserColours[]) this._userColoursList
486             .toArray(array);
487   }
488
489   /**
490    * Method getUserColoursCount.
491    * 
492    * @return the size of this collection
493    */
494   public int getUserColoursCount()
495   {
496     return this._userColoursList.size();
497   }
498
499   /**
500    * Method getViewport.
501    * 
502    * @param index
503    * @throws java.lang.IndexOutOfBoundsException
504    *           if the index given is outside the bounds of the collection
505    * @return the value of the jalview.schemabinding.version2.Viewport at the
506    *         given index
507    */
508   public jalview.schemabinding.version2.Viewport getViewport(final int index)
509           throws java.lang.IndexOutOfBoundsException
510   {
511     // check bounds for index
512     if (index < 0 || index >= this._viewportList.size())
513     {
514       throw new IndexOutOfBoundsException("getViewport: Index value '"
515               + index + "' not in range [0.."
516               + (this._viewportList.size() - 1) + "]");
517     }
518
519     return (jalview.schemabinding.version2.Viewport) _viewportList
520             .get(index);
521   }
522
523   /**
524    * Method getViewport.Returns the contents of the collection in an Array.
525    * <p>
526    * Note: Just in case the collection contents are changing in another thread,
527    * we pass a 0-length Array of the correct type into the API call. This way we
528    * <i>know</i> that the Array returned is of exactly the correct length.
529    * 
530    * @return this collection as an Array
531    */
532   public jalview.schemabinding.version2.Viewport[] getViewport()
533   {
534     jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0];
535     return (jalview.schemabinding.version2.Viewport[]) this._viewportList
536             .toArray(array);
537   }
538
539   /**
540    * Method getViewportCount.
541    * 
542    * @return the size of this collection
543    */
544   public int getViewportCount()
545   {
546     return this._viewportList.size();
547   }
548
549   /**
550    * Method isValid.
551    * 
552    * @return true if this object is valid according to the schema
553    */
554   public boolean isValid()
555   {
556     try
557     {
558       validate();
559     } catch (org.exolab.castor.xml.ValidationException vex)
560     {
561       return false;
562     }
563     return true;
564   }
565
566   /**
567    * 
568    * 
569    * @param out
570    * @throws org.exolab.castor.xml.MarshalException
571    *           if object is null or if any SAXException is thrown during
572    *           marshaling
573    * @throws org.exolab.castor.xml.ValidationException
574    *           if this object is an invalid instance according to the schema
575    */
576   public void marshal(final java.io.Writer out)
577           throws org.exolab.castor.xml.MarshalException,
578           org.exolab.castor.xml.ValidationException
579   {
580     Marshaller.marshal(this, out);
581   }
582
583   /**
584    * 
585    * 
586    * @param handler
587    * @throws java.io.IOException
588    *           if an IOException occurs during marshaling
589    * @throws org.exolab.castor.xml.ValidationException
590    *           if this object is an invalid instance according to the schema
591    * @throws org.exolab.castor.xml.MarshalException
592    *           if object is null or if any SAXException is thrown during
593    *           marshaling
594    */
595   public void marshal(final org.xml.sax.ContentHandler handler)
596           throws java.io.IOException,
597           org.exolab.castor.xml.MarshalException,
598           org.exolab.castor.xml.ValidationException
599   {
600     Marshaller.marshal(this, handler);
601   }
602
603   /**
604      */
605   public void removeAllJGroup()
606   {
607     this._JGroupList.clear();
608   }
609
610   /**
611      */
612   public void removeAllJSeq()
613   {
614     this._JSeqList.clear();
615   }
616
617   /**
618      */
619   public void removeAllTree()
620   {
621     this._treeList.clear();
622   }
623
624   /**
625      */
626   public void removeAllUserColours()
627   {
628     this._userColoursList.clear();
629   }
630
631   /**
632      */
633   public void removeAllViewport()
634   {
635     this._viewportList.clear();
636   }
637
638   /**
639    * Method removeJGroup.
640    * 
641    * @param vJGroup
642    * @return true if the object was removed from the collection.
643    */
644   public boolean removeJGroup(
645           final jalview.schemabinding.version2.JGroup vJGroup)
646   {
647     boolean removed = _JGroupList.remove(vJGroup);
648     return removed;
649   }
650
651   /**
652    * Method removeJGroupAt.
653    * 
654    * @param index
655    * @return the element removed from the collection
656    */
657   public jalview.schemabinding.version2.JGroup removeJGroupAt(
658           final int index)
659   {
660     java.lang.Object obj = this._JGroupList.remove(index);
661     return (jalview.schemabinding.version2.JGroup) obj;
662   }
663
664   /**
665    * Method removeJSeq.
666    * 
667    * @param vJSeq
668    * @return true if the object was removed from the collection.
669    */
670   public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq)
671   {
672     boolean removed = _JSeqList.remove(vJSeq);
673     return removed;
674   }
675
676   /**
677    * Method removeJSeqAt.
678    * 
679    * @param index
680    * @return the element removed from the collection
681    */
682   public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index)
683   {
684     java.lang.Object obj = this._JSeqList.remove(index);
685     return (jalview.schemabinding.version2.JSeq) obj;
686   }
687
688   /**
689    * Method removeTree.
690    * 
691    * @param vTree
692    * @return true if the object was removed from the collection.
693    */
694   public boolean removeTree(final jalview.schemabinding.version2.Tree vTree)
695   {
696     boolean removed = _treeList.remove(vTree);
697     return removed;
698   }
699
700   /**
701    * Method removeTreeAt.
702    * 
703    * @param index
704    * @return the element removed from the collection
705    */
706   public jalview.schemabinding.version2.Tree removeTreeAt(final int index)
707   {
708     java.lang.Object obj = this._treeList.remove(index);
709     return (jalview.schemabinding.version2.Tree) obj;
710   }
711
712   /**
713    * Method removeUserColours.
714    * 
715    * @param vUserColours
716    * @return true if the object was removed from the collection.
717    */
718   public boolean removeUserColours(
719           final jalview.schemabinding.version2.UserColours vUserColours)
720   {
721     boolean removed = _userColoursList.remove(vUserColours);
722     return removed;
723   }
724
725   /**
726    * Method removeUserColoursAt.
727    * 
728    * @param index
729    * @return the element removed from the collection
730    */
731   public jalview.schemabinding.version2.UserColours removeUserColoursAt(
732           final int index)
733   {
734     java.lang.Object obj = this._userColoursList.remove(index);
735     return (jalview.schemabinding.version2.UserColours) obj;
736   }
737
738   /**
739    * Method removeViewport.
740    * 
741    * @param vViewport
742    * @return true if the object was removed from the collection.
743    */
744   public boolean removeViewport(
745           final jalview.schemabinding.version2.Viewport vViewport)
746   {
747     boolean removed = _viewportList.remove(vViewport);
748     return removed;
749   }
750
751   /**
752    * Method removeViewportAt.
753    * 
754    * @param index
755    * @return the element removed from the collection
756    */
757   public jalview.schemabinding.version2.Viewport removeViewportAt(
758           final int index)
759   {
760     java.lang.Object obj = this._viewportList.remove(index);
761     return (jalview.schemabinding.version2.Viewport) obj;
762   }
763
764   /**
765    * Sets the value of field 'featureSettings'.
766    * 
767    * @param featureSettings
768    *          the value of field 'featureSettings'.
769    */
770   public void setFeatureSettings(
771           final jalview.schemabinding.version2.FeatureSettings featureSettings)
772   {
773     this._featureSettings = featureSettings;
774   }
775
776   /**
777    * 
778    * 
779    * @param index
780    * @param vJGroup
781    * @throws java.lang.IndexOutOfBoundsException
782    *           if the index given is outside the bounds of the collection
783    */
784   public void setJGroup(final int index,
785           final jalview.schemabinding.version2.JGroup vJGroup)
786           throws java.lang.IndexOutOfBoundsException
787   {
788     // check bounds for index
789     if (index < 0 || index >= this._JGroupList.size())
790     {
791       throw new IndexOutOfBoundsException("setJGroup: Index value '"
792               + index + "' not in range [0.."
793               + (this._JGroupList.size() - 1) + "]");
794     }
795
796     this._JGroupList.set(index, vJGroup);
797   }
798
799   /**
800    * 
801    * 
802    * @param vJGroupArray
803    */
804   public void setJGroup(
805           final jalview.schemabinding.version2.JGroup[] vJGroupArray)
806   {
807     // -- copy array
808     _JGroupList.clear();
809
810     for (int i = 0; i < vJGroupArray.length; i++)
811     {
812       this._JGroupList.add(vJGroupArray[i]);
813     }
814   }
815
816   /**
817    * 
818    * 
819    * @param index
820    * @param vJSeq
821    * @throws java.lang.IndexOutOfBoundsException
822    *           if the index given is outside the bounds of the collection
823    */
824   public void setJSeq(final int index,
825           final jalview.schemabinding.version2.JSeq vJSeq)
826           throws java.lang.IndexOutOfBoundsException
827   {
828     // check bounds for index
829     if (index < 0 || index >= this._JSeqList.size())
830     {
831       throw new IndexOutOfBoundsException("setJSeq: Index value '" + index
832               + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
833     }
834
835     this._JSeqList.set(index, vJSeq);
836   }
837
838   /**
839    * 
840    * 
841    * @param vJSeqArray
842    */
843   public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray)
844   {
845     // -- copy array
846     _JSeqList.clear();
847
848     for (int i = 0; i < vJSeqArray.length; i++)
849     {
850       this._JSeqList.add(vJSeqArray[i]);
851     }
852   }
853
854   /**
855    * 
856    * 
857    * @param index
858    * @param vTree
859    * @throws java.lang.IndexOutOfBoundsException
860    *           if the index given is outside the bounds of the collection
861    */
862   public void setTree(final int index,
863           final jalview.schemabinding.version2.Tree vTree)
864           throws java.lang.IndexOutOfBoundsException
865   {
866     // check bounds for index
867     if (index < 0 || index >= this._treeList.size())
868     {
869       throw new IndexOutOfBoundsException("setTree: Index value '" + index
870               + "' not in range [0.." + (this._treeList.size() - 1) + "]");
871     }
872
873     this._treeList.set(index, vTree);
874   }
875
876   /**
877    * 
878    * 
879    * @param vTreeArray
880    */
881   public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray)
882   {
883     // -- copy array
884     _treeList.clear();
885
886     for (int i = 0; i < vTreeArray.length; i++)
887     {
888       this._treeList.add(vTreeArray[i]);
889     }
890   }
891
892   /**
893    * 
894    * 
895    * @param index
896    * @param vUserColours
897    * @throws java.lang.IndexOutOfBoundsException
898    *           if the index given is outside the bounds of the collection
899    */
900   public void setUserColours(final int index,
901           final jalview.schemabinding.version2.UserColours vUserColours)
902           throws java.lang.IndexOutOfBoundsException
903   {
904     // check bounds for index
905     if (index < 0 || index >= this._userColoursList.size())
906     {
907       throw new IndexOutOfBoundsException("setUserColours: Index value '"
908               + index + "' not in range [0.."
909               + (this._userColoursList.size() - 1) + "]");
910     }
911
912     this._userColoursList.set(index, vUserColours);
913   }
914
915   /**
916    * 
917    * 
918    * @param vUserColoursArray
919    */
920   public void setUserColours(
921           final jalview.schemabinding.version2.UserColours[] vUserColoursArray)
922   {
923     // -- copy array
924     _userColoursList.clear();
925
926     for (int i = 0; i < vUserColoursArray.length; i++)
927     {
928       this._userColoursList.add(vUserColoursArray[i]);
929     }
930   }
931
932   /**
933    * 
934    * 
935    * @param index
936    * @param vViewport
937    * @throws java.lang.IndexOutOfBoundsException
938    *           if the index given is outside the bounds of the collection
939    */
940   public void setViewport(final int index,
941           final jalview.schemabinding.version2.Viewport vViewport)
942           throws java.lang.IndexOutOfBoundsException
943   {
944     // check bounds for index
945     if (index < 0 || index >= this._viewportList.size())
946     {
947       throw new IndexOutOfBoundsException("setViewport: Index value '"
948               + index + "' not in range [0.."
949               + (this._viewportList.size() - 1) + "]");
950     }
951
952     this._viewportList.set(index, vViewport);
953   }
954
955   /**
956    * 
957    * 
958    * @param vViewportArray
959    */
960   public void setViewport(
961           final jalview.schemabinding.version2.Viewport[] vViewportArray)
962   {
963     // -- copy array
964     _viewportList.clear();
965
966     for (int i = 0; i < vViewportArray.length; i++)
967     {
968       this._viewportList.add(vViewportArray[i]);
969     }
970   }
971
972   /**
973    * Method unmarshal.
974    * 
975    * @param reader
976    * @throws org.exolab.castor.xml.MarshalException
977    *           if object is null or if any SAXException is thrown during
978    *           marshaling
979    * @throws org.exolab.castor.xml.ValidationException
980    *           if this object is an invalid instance according to the schema
981    * @return the unmarshaled jalview.schemabinding.version2.JalviewModelSequence
982    */
983   public static jalview.schemabinding.version2.JalviewModelSequence unmarshal(
984           final java.io.Reader reader)
985           throws org.exolab.castor.xml.MarshalException,
986           org.exolab.castor.xml.ValidationException
987   {
988     return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller
989             .unmarshal(
990                     jalview.schemabinding.version2.JalviewModelSequence.class,
991                     reader);
992   }
993
994   /**
995    * 
996    * 
997    * @throws org.exolab.castor.xml.ValidationException
998    *           if this object is an invalid instance according to the schema
999    */
1000   public void validate() throws org.exolab.castor.xml.ValidationException
1001   {
1002     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
1003     validator.validate(this);
1004   }
1005
1006 }