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