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