update author list in license for (JAL-826)
[jalview.git] / src / jalview / binding / 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.binding;
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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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.binding.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 jalview.binding.JGroup
239      * 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 jalview.binding.JSeq elements
250      */
251     public java.util.Enumeration enumerateJSeq(
252     ) {
253         return this._JSeqList.elements();
254     }
255
256     /**
257      * Method enumerateTree.
258      * 
259      * @return an Enumeration over all jalview.binding.Tree elements
260      */
261     public java.util.Enumeration enumerateTree(
262     ) {
263         return this._treeList.elements();
264     }
265
266     /**
267      * Method enumerateUserColours.
268      * 
269      * @return an Enumeration over all jalview.binding.UserColours
270      * elements
271      */
272     public java.util.Enumeration enumerateUserColours(
273     ) {
274         return this._userColoursList.elements();
275     }
276
277     /**
278      * Method enumerateViewport.
279      * 
280      * @return an Enumeration over all jalview.binding.Viewport
281      * elements
282      */
283     public java.util.Enumeration enumerateViewport(
284     ) {
285         return this._viewportList.elements();
286     }
287
288     /**
289      * Returns the value of field 'featureSettings'.
290      * 
291      * @return the value of field 'FeatureSettings'.
292      */
293     public jalview.binding.FeatureSettings getFeatureSettings(
294     ) {
295         return this._featureSettings;
296     }
297
298     /**
299      * Method getJGroup.
300      * 
301      * @param index
302      * @throws java.lang.IndexOutOfBoundsException if the index
303      * given is outside the bounds of the collection
304      * @return the value of the jalview.binding.JGroup at the given
305      * index
306      */
307     public jalview.binding.JGroup getJGroup(
308             final int index)
309     throws java.lang.IndexOutOfBoundsException {
310         // check bounds for index
311         if (index < 0 || index >= this._JGroupList.size()) {
312             throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
313         }
314         
315         return (jalview.binding.JGroup) _JGroupList.get(index);
316     }
317
318     /**
319      * Method getJGroup.Returns the contents of the collection in
320      * an Array.  <p>Note:  Just in case the collection contents
321      * are changing in another thread, we pass a 0-length Array of
322      * the correct type into the API call.  This way we <i>know</i>
323      * that the Array returned is of exactly the correct length.
324      * 
325      * @return this collection as an Array
326      */
327     public jalview.binding.JGroup[] getJGroup(
328     ) {
329         jalview.binding.JGroup[] array = new jalview.binding.JGroup[0];
330         return (jalview.binding.JGroup[]) this._JGroupList.toArray(array);
331     }
332
333     /**
334      * Method getJGroupCount.
335      * 
336      * @return the size of this collection
337      */
338     public int getJGroupCount(
339     ) {
340         return this._JGroupList.size();
341     }
342
343     /**
344      * Method getJSeq.
345      * 
346      * @param index
347      * @throws java.lang.IndexOutOfBoundsException if the index
348      * given is outside the bounds of the collection
349      * @return the value of the jalview.binding.JSeq at the given
350      * index
351      */
352     public jalview.binding.JSeq getJSeq(
353             final int index)
354     throws java.lang.IndexOutOfBoundsException {
355         // check bounds for index
356         if (index < 0 || index >= this._JSeqList.size()) {
357             throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
358         }
359         
360         return (jalview.binding.JSeq) _JSeqList.get(index);
361     }
362
363     /**
364      * Method getJSeq.Returns the contents of the collection in an
365      * Array.  <p>Note:  Just in case the collection contents are
366      * changing in another thread, we pass a 0-length Array of the
367      * correct type into the API call.  This way we <i>know</i>
368      * that the Array returned is of exactly the correct length.
369      * 
370      * @return this collection as an Array
371      */
372     public jalview.binding.JSeq[] getJSeq(
373     ) {
374         jalview.binding.JSeq[] array = new jalview.binding.JSeq[0];
375         return (jalview.binding.JSeq[]) this._JSeqList.toArray(array);
376     }
377
378     /**
379      * Method getJSeqCount.
380      * 
381      * @return the size of this collection
382      */
383     public int getJSeqCount(
384     ) {
385         return this._JSeqList.size();
386     }
387
388     /**
389      * Method getTree.
390      * 
391      * @param index
392      * @throws java.lang.IndexOutOfBoundsException if the index
393      * given is outside the bounds of the collection
394      * @return the value of the jalview.binding.Tree at the given
395      * index
396      */
397     public jalview.binding.Tree getTree(
398             final int index)
399     throws java.lang.IndexOutOfBoundsException {
400         // check bounds for index
401         if (index < 0 || index >= this._treeList.size()) {
402             throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
403         }
404         
405         return (jalview.binding.Tree) _treeList.get(index);
406     }
407
408     /**
409      * Method getTree.Returns the contents of the collection in an
410      * Array.  <p>Note:  Just in case the collection contents are
411      * changing in another thread, we pass a 0-length Array of the
412      * correct type into the API call.  This way we <i>know</i>
413      * that the Array returned is of exactly the correct length.
414      * 
415      * @return this collection as an Array
416      */
417     public jalview.binding.Tree[] getTree(
418     ) {
419         jalview.binding.Tree[] array = new jalview.binding.Tree[0];
420         return (jalview.binding.Tree[]) this._treeList.toArray(array);
421     }
422
423     /**
424      * Method getTreeCount.
425      * 
426      * @return the size of this collection
427      */
428     public int getTreeCount(
429     ) {
430         return this._treeList.size();
431     }
432
433     /**
434      * Method getUserColours.
435      * 
436      * @param index
437      * @throws java.lang.IndexOutOfBoundsException if the index
438      * given is outside the bounds of the collection
439      * @return the value of the jalview.binding.UserColours at the
440      * given index
441      */
442     public jalview.binding.UserColours getUserColours(
443             final int index)
444     throws java.lang.IndexOutOfBoundsException {
445         // check bounds for index
446         if (index < 0 || index >= this._userColoursList.size()) {
447             throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
448         }
449         
450         return (jalview.binding.UserColours) _userColoursList.get(index);
451     }
452
453     /**
454      * Method getUserColours.Returns the contents of the collection
455      * in an Array.  <p>Note:  Just in case the collection contents
456      * are changing in another thread, we pass a 0-length Array of
457      * the correct type into the API call.  This way we <i>know</i>
458      * that the Array returned is of exactly the correct length.
459      * 
460      * @return this collection as an Array
461      */
462     public jalview.binding.UserColours[] getUserColours(
463     ) {
464         jalview.binding.UserColours[] array = new jalview.binding.UserColours[0];
465         return (jalview.binding.UserColours[]) this._userColoursList.toArray(array);
466     }
467
468     /**
469      * Method getUserColoursCount.
470      * 
471      * @return the size of this collection
472      */
473     public int getUserColoursCount(
474     ) {
475         return this._userColoursList.size();
476     }
477
478     /**
479      * Method getViewport.
480      * 
481      * @param index
482      * @throws java.lang.IndexOutOfBoundsException if the index
483      * given is outside the bounds of the collection
484      * @return the value of the jalview.binding.Viewport at the
485      * given index
486      */
487     public jalview.binding.Viewport getViewport(
488             final int index)
489     throws java.lang.IndexOutOfBoundsException {
490         // check bounds for index
491         if (index < 0 || index >= this._viewportList.size()) {
492             throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
493         }
494         
495         return (jalview.binding.Viewport) _viewportList.get(index);
496     }
497
498     /**
499      * Method getViewport.Returns the contents of the collection in
500      * an Array.  <p>Note:  Just in case the collection contents
501      * are changing in another thread, we pass a 0-length Array of
502      * the correct type into the API call.  This way we <i>know</i>
503      * that the Array returned is of exactly the correct length.
504      * 
505      * @return this collection as an Array
506      */
507     public jalview.binding.Viewport[] getViewport(
508     ) {
509         jalview.binding.Viewport[] array = new jalview.binding.Viewport[0];
510         return (jalview.binding.Viewport[]) this._viewportList.toArray(array);
511     }
512
513     /**
514      * Method getViewportCount.
515      * 
516      * @return the size of this collection
517      */
518     public int getViewportCount(
519     ) {
520         return this._viewportList.size();
521     }
522
523     /**
524      * Method isValid.
525      * 
526      * @return true if this object is valid according to the schema
527      */
528     public boolean isValid(
529     ) {
530         try {
531             validate();
532         } catch (org.exolab.castor.xml.ValidationException vex) {
533             return false;
534         }
535         return true;
536     }
537
538     /**
539      * 
540      * 
541      * @param out
542      * @throws org.exolab.castor.xml.MarshalException if object is
543      * null or if any SAXException is thrown during marshaling
544      * @throws org.exolab.castor.xml.ValidationException if this
545      * object is an invalid instance according to the schema
546      */
547     public void marshal(
548             final java.io.Writer out)
549     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
550         Marshaller.marshal(this, out);
551     }
552
553     /**
554      * 
555      * 
556      * @param handler
557      * @throws java.io.IOException if an IOException occurs during
558      * marshaling
559      * @throws org.exolab.castor.xml.ValidationException if this
560      * object is an invalid instance according to the schema
561      * @throws org.exolab.castor.xml.MarshalException if object is
562      * null or if any SAXException is thrown during marshaling
563      */
564     public void marshal(
565             final org.xml.sax.ContentHandler handler)
566     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
567         Marshaller.marshal(this, handler);
568     }
569
570     /**
571      */
572     public void removeAllJGroup(
573     ) {
574         this._JGroupList.clear();
575     }
576
577     /**
578      */
579     public void removeAllJSeq(
580     ) {
581         this._JSeqList.clear();
582     }
583
584     /**
585      */
586     public void removeAllTree(
587     ) {
588         this._treeList.clear();
589     }
590
591     /**
592      */
593     public void removeAllUserColours(
594     ) {
595         this._userColoursList.clear();
596     }
597
598     /**
599      */
600     public void removeAllViewport(
601     ) {
602         this._viewportList.clear();
603     }
604
605     /**
606      * Method removeJGroup.
607      * 
608      * @param vJGroup
609      * @return true if the object was removed from the collection.
610      */
611     public boolean removeJGroup(
612             final jalview.binding.JGroup vJGroup) {
613         boolean removed = _JGroupList.remove(vJGroup);
614         return removed;
615     }
616
617     /**
618      * Method removeJGroupAt.
619      * 
620      * @param index
621      * @return the element removed from the collection
622      */
623     public jalview.binding.JGroup removeJGroupAt(
624             final int index) {
625         java.lang.Object obj = this._JGroupList.remove(index);
626         return (jalview.binding.JGroup) obj;
627     }
628
629     /**
630      * Method removeJSeq.
631      * 
632      * @param vJSeq
633      * @return true if the object was removed from the collection.
634      */
635     public boolean removeJSeq(
636             final jalview.binding.JSeq vJSeq) {
637         boolean removed = _JSeqList.remove(vJSeq);
638         return removed;
639     }
640
641     /**
642      * Method removeJSeqAt.
643      * 
644      * @param index
645      * @return the element removed from the collection
646      */
647     public jalview.binding.JSeq removeJSeqAt(
648             final int index) {
649         java.lang.Object obj = this._JSeqList.remove(index);
650         return (jalview.binding.JSeq) obj;
651     }
652
653     /**
654      * Method removeTree.
655      * 
656      * @param vTree
657      * @return true if the object was removed from the collection.
658      */
659     public boolean removeTree(
660             final jalview.binding.Tree vTree) {
661         boolean removed = _treeList.remove(vTree);
662         return removed;
663     }
664
665     /**
666      * Method removeTreeAt.
667      * 
668      * @param index
669      * @return the element removed from the collection
670      */
671     public jalview.binding.Tree removeTreeAt(
672             final int index) {
673         java.lang.Object obj = this._treeList.remove(index);
674         return (jalview.binding.Tree) obj;
675     }
676
677     /**
678      * Method removeUserColours.
679      * 
680      * @param vUserColours
681      * @return true if the object was removed from the collection.
682      */
683     public boolean removeUserColours(
684             final jalview.binding.UserColours vUserColours) {
685         boolean removed = _userColoursList.remove(vUserColours);
686         return removed;
687     }
688
689     /**
690      * Method removeUserColoursAt.
691      * 
692      * @param index
693      * @return the element removed from the collection
694      */
695     public jalview.binding.UserColours removeUserColoursAt(
696             final int index) {
697         java.lang.Object obj = this._userColoursList.remove(index);
698         return (jalview.binding.UserColours) obj;
699     }
700
701     /**
702      * Method removeViewport.
703      * 
704      * @param vViewport
705      * @return true if the object was removed from the collection.
706      */
707     public boolean removeViewport(
708             final jalview.binding.Viewport vViewport) {
709         boolean removed = _viewportList.remove(vViewport);
710         return removed;
711     }
712
713     /**
714      * Method removeViewportAt.
715      * 
716      * @param index
717      * @return the element removed from the collection
718      */
719     public jalview.binding.Viewport removeViewportAt(
720             final int index) {
721         java.lang.Object obj = this._viewportList.remove(index);
722         return (jalview.binding.Viewport) obj;
723     }
724
725     /**
726      * Sets the value of field 'featureSettings'.
727      * 
728      * @param featureSettings the value of field 'featureSettings'.
729      */
730     public void setFeatureSettings(
731             final jalview.binding.FeatureSettings featureSettings) {
732         this._featureSettings = featureSettings;
733     }
734
735     /**
736      * 
737      * 
738      * @param index
739      * @param vJGroup
740      * @throws java.lang.IndexOutOfBoundsException if the index
741      * given is outside the bounds of the collection
742      */
743     public void setJGroup(
744             final int index,
745             final jalview.binding.JGroup vJGroup)
746     throws java.lang.IndexOutOfBoundsException {
747         // check bounds for index
748         if (index < 0 || index >= this._JGroupList.size()) {
749             throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]");
750         }
751         
752         this._JGroupList.set(index, vJGroup);
753     }
754
755     /**
756      * 
757      * 
758      * @param vJGroupArray
759      */
760     public void setJGroup(
761             final jalview.binding.JGroup[] vJGroupArray) {
762         //-- copy array
763         _JGroupList.clear();
764         
765         for (int i = 0; i < vJGroupArray.length; i++) {
766                 this._JGroupList.add(vJGroupArray[i]);
767         }
768     }
769
770     /**
771      * 
772      * 
773      * @param index
774      * @param vJSeq
775      * @throws java.lang.IndexOutOfBoundsException if the index
776      * given is outside the bounds of the collection
777      */
778     public void setJSeq(
779             final int index,
780             final jalview.binding.JSeq vJSeq)
781     throws java.lang.IndexOutOfBoundsException {
782         // check bounds for index
783         if (index < 0 || index >= this._JSeqList.size()) {
784             throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]");
785         }
786         
787         this._JSeqList.set(index, vJSeq);
788     }
789
790     /**
791      * 
792      * 
793      * @param vJSeqArray
794      */
795     public void setJSeq(
796             final jalview.binding.JSeq[] vJSeqArray) {
797         //-- copy array
798         _JSeqList.clear();
799         
800         for (int i = 0; i < vJSeqArray.length; i++) {
801                 this._JSeqList.add(vJSeqArray[i]);
802         }
803     }
804
805     /**
806      * 
807      * 
808      * @param index
809      * @param vTree
810      * @throws java.lang.IndexOutOfBoundsException if the index
811      * given is outside the bounds of the collection
812      */
813     public void setTree(
814             final int index,
815             final jalview.binding.Tree vTree)
816     throws java.lang.IndexOutOfBoundsException {
817         // check bounds for index
818         if (index < 0 || index >= this._treeList.size()) {
819             throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]");
820         }
821         
822         this._treeList.set(index, vTree);
823     }
824
825     /**
826      * 
827      * 
828      * @param vTreeArray
829      */
830     public void setTree(
831             final jalview.binding.Tree[] vTreeArray) {
832         //-- copy array
833         _treeList.clear();
834         
835         for (int i = 0; i < vTreeArray.length; i++) {
836                 this._treeList.add(vTreeArray[i]);
837         }
838     }
839
840     /**
841      * 
842      * 
843      * @param index
844      * @param vUserColours
845      * @throws java.lang.IndexOutOfBoundsException if the index
846      * given is outside the bounds of the collection
847      */
848     public void setUserColours(
849             final int index,
850             final jalview.binding.UserColours vUserColours)
851     throws java.lang.IndexOutOfBoundsException {
852         // check bounds for index
853         if (index < 0 || index >= this._userColoursList.size()) {
854             throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]");
855         }
856         
857         this._userColoursList.set(index, vUserColours);
858     }
859
860     /**
861      * 
862      * 
863      * @param vUserColoursArray
864      */
865     public void setUserColours(
866             final jalview.binding.UserColours[] vUserColoursArray) {
867         //-- copy array
868         _userColoursList.clear();
869         
870         for (int i = 0; i < vUserColoursArray.length; i++) {
871                 this._userColoursList.add(vUserColoursArray[i]);
872         }
873     }
874
875     /**
876      * 
877      * 
878      * @param index
879      * @param vViewport
880      * @throws java.lang.IndexOutOfBoundsException if the index
881      * given is outside the bounds of the collection
882      */
883     public void setViewport(
884             final int index,
885             final jalview.binding.Viewport vViewport)
886     throws java.lang.IndexOutOfBoundsException {
887         // check bounds for index
888         if (index < 0 || index >= this._viewportList.size()) {
889             throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]");
890         }
891         
892         this._viewportList.set(index, vViewport);
893     }
894
895     /**
896      * 
897      * 
898      * @param vViewportArray
899      */
900     public void setViewport(
901             final jalview.binding.Viewport[] vViewportArray) {
902         //-- copy array
903         _viewportList.clear();
904         
905         for (int i = 0; i < vViewportArray.length; i++) {
906                 this._viewportList.add(vViewportArray[i]);
907         }
908     }
909
910     /**
911      * Method unmarshal.
912      * 
913      * @param reader
914      * @throws org.exolab.castor.xml.MarshalException if object is
915      * null or if any SAXException is thrown during marshaling
916      * @throws org.exolab.castor.xml.ValidationException if this
917      * object is an invalid instance according to the schema
918      * @return the unmarshaled jalview.binding.JalviewModelSequence
919      */
920     public static jalview.binding.JalviewModelSequence unmarshal(
921             final java.io.Reader reader)
922     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
923         return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);
924     }
925
926     /**
927      * 
928      * 
929      * @throws org.exolab.castor.xml.ValidationException if this
930      * object is an invalid instance according to the schema
931      */
932     public void validate(
933     )
934     throws org.exolab.castor.xml.ValidationException {
935         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
936         validator.validate(this);
937     }
938
939 }