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