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