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