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