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