61c80aa11b8396e82f26968e453964f5623b12bc
[jalview.git] / src / jalview / binding / JalviewModelSequence.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package jalview.binding;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import java.util.Enumeration;\r
19 import java.util.Vector;\r
20 import org.exolab.castor.xml.MarshalException;\r
21 import org.exolab.castor.xml.Marshaller;\r
22 import org.exolab.castor.xml.Unmarshaller;\r
23 import org.exolab.castor.xml.ValidationException;\r
24 import org.xml.sax.ContentHandler;\r
25 \r
26 /**\r
27  * Class JalviewModelSequence.\r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class JalviewModelSequence implements java.io.Serializable {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Field _JSeqList\r
40      */\r
41     private java.util.Vector _JSeqList;\r
42 \r
43     /**\r
44      * Field _JGroupList\r
45      */\r
46     private java.util.Vector _JGroupList;\r
47 \r
48     /**\r
49      * Field _viewportList\r
50      */\r
51     private java.util.Vector _viewportList;\r
52 \r
53     /**\r
54      * Field _userColoursList\r
55      */\r
56     private java.util.Vector _userColoursList;\r
57 \r
58 \r
59       //----------------/\r
60      //- Constructors -/\r
61     //----------------/\r
62 \r
63     public JalviewModelSequence() {\r
64         super();\r
65         _JSeqList = new Vector();\r
66         _JGroupList = new Vector();\r
67         _viewportList = new Vector();\r
68         _userColoursList = new Vector();\r
69     } //-- jalview.binding.JalviewModelSequence()\r
70 \r
71 \r
72       //-----------/\r
73      //- Methods -/\r
74     //-----------/\r
75 \r
76     /**\r
77      * Method addJGroup\r
78      * \r
79      * \r
80      * \r
81      * @param vJGroup\r
82      */\r
83     public void addJGroup(jalview.binding.JGroup vJGroup)\r
84         throws java.lang.IndexOutOfBoundsException\r
85     {\r
86         _JGroupList.addElement(vJGroup);\r
87     } //-- void addJGroup(jalview.binding.JGroup) \r
88 \r
89     /**\r
90      * Method addJGroup\r
91      * \r
92      * \r
93      * \r
94      * @param index\r
95      * @param vJGroup\r
96      */\r
97     public void addJGroup(int index, jalview.binding.JGroup vJGroup)\r
98         throws java.lang.IndexOutOfBoundsException\r
99     {\r
100         _JGroupList.insertElementAt(vJGroup, index);\r
101     } //-- void addJGroup(int, jalview.binding.JGroup) \r
102 \r
103     /**\r
104      * Method addJSeq\r
105      * \r
106      * \r
107      * \r
108      * @param vJSeq\r
109      */\r
110     public void addJSeq(jalview.binding.JSeq vJSeq)\r
111         throws java.lang.IndexOutOfBoundsException\r
112     {\r
113         _JSeqList.addElement(vJSeq);\r
114     } //-- void addJSeq(jalview.binding.JSeq) \r
115 \r
116     /**\r
117      * Method addJSeq\r
118      * \r
119      * \r
120      * \r
121      * @param index\r
122      * @param vJSeq\r
123      */\r
124     public void addJSeq(int index, jalview.binding.JSeq vJSeq)\r
125         throws java.lang.IndexOutOfBoundsException\r
126     {\r
127         _JSeqList.insertElementAt(vJSeq, index);\r
128     } //-- void addJSeq(int, jalview.binding.JSeq) \r
129 \r
130     /**\r
131      * Method addUserColours\r
132      * \r
133      * \r
134      * \r
135      * @param vUserColours\r
136      */\r
137     public void addUserColours(jalview.binding.UserColours vUserColours)\r
138         throws java.lang.IndexOutOfBoundsException\r
139     {\r
140         _userColoursList.addElement(vUserColours);\r
141     } //-- void addUserColours(jalview.binding.UserColours) \r
142 \r
143     /**\r
144      * Method addUserColours\r
145      * \r
146      * \r
147      * \r
148      * @param index\r
149      * @param vUserColours\r
150      */\r
151     public void addUserColours(int index, jalview.binding.UserColours vUserColours)\r
152         throws java.lang.IndexOutOfBoundsException\r
153     {\r
154         _userColoursList.insertElementAt(vUserColours, index);\r
155     } //-- void addUserColours(int, jalview.binding.UserColours) \r
156 \r
157     /**\r
158      * Method addViewport\r
159      * \r
160      * \r
161      * \r
162      * @param vViewport\r
163      */\r
164     public void addViewport(jalview.binding.Viewport vViewport)\r
165         throws java.lang.IndexOutOfBoundsException\r
166     {\r
167         _viewportList.addElement(vViewport);\r
168     } //-- void addViewport(jalview.binding.Viewport) \r
169 \r
170     /**\r
171      * Method addViewport\r
172      * \r
173      * \r
174      * \r
175      * @param index\r
176      * @param vViewport\r
177      */\r
178     public void addViewport(int index, jalview.binding.Viewport vViewport)\r
179         throws java.lang.IndexOutOfBoundsException\r
180     {\r
181         _viewportList.insertElementAt(vViewport, index);\r
182     } //-- void addViewport(int, jalview.binding.Viewport) \r
183 \r
184     /**\r
185      * Method enumerateJGroup\r
186      * \r
187      * \r
188      * \r
189      * @return Enumeration\r
190      */\r
191     public java.util.Enumeration enumerateJGroup()\r
192     {\r
193         return _JGroupList.elements();\r
194     } //-- java.util.Enumeration enumerateJGroup() \r
195 \r
196     /**\r
197      * Method enumerateJSeq\r
198      * \r
199      * \r
200      * \r
201      * @return Enumeration\r
202      */\r
203     public java.util.Enumeration enumerateJSeq()\r
204     {\r
205         return _JSeqList.elements();\r
206     } //-- java.util.Enumeration enumerateJSeq() \r
207 \r
208     /**\r
209      * Method enumerateUserColours\r
210      * \r
211      * \r
212      * \r
213      * @return Enumeration\r
214      */\r
215     public java.util.Enumeration enumerateUserColours()\r
216     {\r
217         return _userColoursList.elements();\r
218     } //-- java.util.Enumeration enumerateUserColours() \r
219 \r
220     /**\r
221      * Method enumerateViewport\r
222      * \r
223      * \r
224      * \r
225      * @return Enumeration\r
226      */\r
227     public java.util.Enumeration enumerateViewport()\r
228     {\r
229         return _viewportList.elements();\r
230     } //-- java.util.Enumeration enumerateViewport() \r
231 \r
232     /**\r
233      * Method getJGroup\r
234      * \r
235      * \r
236      * \r
237      * @param index\r
238      * @return JGroup\r
239      */\r
240     public jalview.binding.JGroup getJGroup(int index)\r
241         throws java.lang.IndexOutOfBoundsException\r
242     {\r
243         //-- check bounds for index\r
244         if ((index < 0) || (index > _JGroupList.size())) {\r
245             throw new IndexOutOfBoundsException();\r
246         }\r
247         \r
248         return (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
249     } //-- jalview.binding.JGroup getJGroup(int) \r
250 \r
251     /**\r
252      * Method getJGroup\r
253      * \r
254      * \r
255      * \r
256      * @return JGroup\r
257      */\r
258     public jalview.binding.JGroup[] getJGroup()\r
259     {\r
260         int size = _JGroupList.size();\r
261         jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];\r
262         for (int index = 0; index < size; index++) {\r
263             mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
264         }\r
265         return mArray;\r
266     } //-- jalview.binding.JGroup[] getJGroup() \r
267 \r
268     /**\r
269      * Method getJGroupCount\r
270      * \r
271      * \r
272      * \r
273      * @return int\r
274      */\r
275     public int getJGroupCount()\r
276     {\r
277         return _JGroupList.size();\r
278     } //-- int getJGroupCount() \r
279 \r
280     /**\r
281      * Method getJSeq\r
282      * \r
283      * \r
284      * \r
285      * @param index\r
286      * @return JSeq\r
287      */\r
288     public jalview.binding.JSeq getJSeq(int index)\r
289         throws java.lang.IndexOutOfBoundsException\r
290     {\r
291         //-- check bounds for index\r
292         if ((index < 0) || (index > _JSeqList.size())) {\r
293             throw new IndexOutOfBoundsException();\r
294         }\r
295         \r
296         return (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
297     } //-- jalview.binding.JSeq getJSeq(int) \r
298 \r
299     /**\r
300      * Method getJSeq\r
301      * \r
302      * \r
303      * \r
304      * @return JSeq\r
305      */\r
306     public jalview.binding.JSeq[] getJSeq()\r
307     {\r
308         int size = _JSeqList.size();\r
309         jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];\r
310         for (int index = 0; index < size; index++) {\r
311             mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
312         }\r
313         return mArray;\r
314     } //-- jalview.binding.JSeq[] getJSeq() \r
315 \r
316     /**\r
317      * Method getJSeqCount\r
318      * \r
319      * \r
320      * \r
321      * @return int\r
322      */\r
323     public int getJSeqCount()\r
324     {\r
325         return _JSeqList.size();\r
326     } //-- int getJSeqCount() \r
327 \r
328     /**\r
329      * Method getUserColours\r
330      * \r
331      * \r
332      * \r
333      * @param index\r
334      * @return UserColours\r
335      */\r
336     public jalview.binding.UserColours getUserColours(int index)\r
337         throws java.lang.IndexOutOfBoundsException\r
338     {\r
339         //-- check bounds for index\r
340         if ((index < 0) || (index > _userColoursList.size())) {\r
341             throw new IndexOutOfBoundsException();\r
342         }\r
343         \r
344         return (jalview.binding.UserColours) _userColoursList.elementAt(index);\r
345     } //-- jalview.binding.UserColours getUserColours(int) \r
346 \r
347     /**\r
348      * Method getUserColours\r
349      * \r
350      * \r
351      * \r
352      * @return UserColours\r
353      */\r
354     public jalview.binding.UserColours[] getUserColours()\r
355     {\r
356         int size = _userColoursList.size();\r
357         jalview.binding.UserColours[] mArray = new jalview.binding.UserColours[size];\r
358         for (int index = 0; index < size; index++) {\r
359             mArray[index] = (jalview.binding.UserColours) _userColoursList.elementAt(index);\r
360         }\r
361         return mArray;\r
362     } //-- jalview.binding.UserColours[] getUserColours() \r
363 \r
364     /**\r
365      * Method getUserColoursCount\r
366      * \r
367      * \r
368      * \r
369      * @return int\r
370      */\r
371     public int getUserColoursCount()\r
372     {\r
373         return _userColoursList.size();\r
374     } //-- int getUserColoursCount() \r
375 \r
376     /**\r
377      * Method getViewport\r
378      * \r
379      * \r
380      * \r
381      * @param index\r
382      * @return Viewport\r
383      */\r
384     public jalview.binding.Viewport getViewport(int index)\r
385         throws java.lang.IndexOutOfBoundsException\r
386     {\r
387         //-- check bounds for index\r
388         if ((index < 0) || (index > _viewportList.size())) {\r
389             throw new IndexOutOfBoundsException();\r
390         }\r
391         \r
392         return (jalview.binding.Viewport) _viewportList.elementAt(index);\r
393     } //-- jalview.binding.Viewport getViewport(int) \r
394 \r
395     /**\r
396      * Method getViewport\r
397      * \r
398      * \r
399      * \r
400      * @return Viewport\r
401      */\r
402     public jalview.binding.Viewport[] getViewport()\r
403     {\r
404         int size = _viewportList.size();\r
405         jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];\r
406         for (int index = 0; index < size; index++) {\r
407             mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);\r
408         }\r
409         return mArray;\r
410     } //-- jalview.binding.Viewport[] getViewport() \r
411 \r
412     /**\r
413      * Method getViewportCount\r
414      * \r
415      * \r
416      * \r
417      * @return int\r
418      */\r
419     public int getViewportCount()\r
420     {\r
421         return _viewportList.size();\r
422     } //-- int getViewportCount() \r
423 \r
424     /**\r
425      * Method isValid\r
426      * \r
427      * \r
428      * \r
429      * @return boolean\r
430      */\r
431     public boolean isValid()\r
432     {\r
433         try {\r
434             validate();\r
435         }\r
436         catch (org.exolab.castor.xml.ValidationException vex) {\r
437             return false;\r
438         }\r
439         return true;\r
440     } //-- boolean isValid() \r
441 \r
442     /**\r
443      * Method marshal\r
444      * \r
445      * \r
446      * \r
447      * @param out\r
448      */\r
449     public void marshal(java.io.Writer out)\r
450         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
451     {\r
452         \r
453         Marshaller.marshal(this, out);\r
454     } //-- void marshal(java.io.Writer) \r
455 \r
456     /**\r
457      * Method marshal\r
458      * \r
459      * \r
460      * \r
461      * @param handler\r
462      */\r
463     public void marshal(org.xml.sax.ContentHandler handler)\r
464         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
465     {\r
466         \r
467         Marshaller.marshal(this, handler);\r
468     } //-- void marshal(org.xml.sax.ContentHandler) \r
469 \r
470     /**\r
471      * Method removeAllJGroup\r
472      * \r
473      */\r
474     public void removeAllJGroup()\r
475     {\r
476         _JGroupList.removeAllElements();\r
477     } //-- void removeAllJGroup() \r
478 \r
479     /**\r
480      * Method removeAllJSeq\r
481      * \r
482      */\r
483     public void removeAllJSeq()\r
484     {\r
485         _JSeqList.removeAllElements();\r
486     } //-- void removeAllJSeq() \r
487 \r
488     /**\r
489      * Method removeAllUserColours\r
490      * \r
491      */\r
492     public void removeAllUserColours()\r
493     {\r
494         _userColoursList.removeAllElements();\r
495     } //-- void removeAllUserColours() \r
496 \r
497     /**\r
498      * Method removeAllViewport\r
499      * \r
500      */\r
501     public void removeAllViewport()\r
502     {\r
503         _viewportList.removeAllElements();\r
504     } //-- void removeAllViewport() \r
505 \r
506     /**\r
507      * Method removeJGroup\r
508      * \r
509      * \r
510      * \r
511      * @param index\r
512      * @return JGroup\r
513      */\r
514     public jalview.binding.JGroup removeJGroup(int index)\r
515     {\r
516         java.lang.Object obj = _JGroupList.elementAt(index);\r
517         _JGroupList.removeElementAt(index);\r
518         return (jalview.binding.JGroup) obj;\r
519     } //-- jalview.binding.JGroup removeJGroup(int) \r
520 \r
521     /**\r
522      * Method removeJSeq\r
523      * \r
524      * \r
525      * \r
526      * @param index\r
527      * @return JSeq\r
528      */\r
529     public jalview.binding.JSeq removeJSeq(int index)\r
530     {\r
531         java.lang.Object obj = _JSeqList.elementAt(index);\r
532         _JSeqList.removeElementAt(index);\r
533         return (jalview.binding.JSeq) obj;\r
534     } //-- jalview.binding.JSeq removeJSeq(int) \r
535 \r
536     /**\r
537      * Method removeUserColours\r
538      * \r
539      * \r
540      * \r
541      * @param index\r
542      * @return UserColours\r
543      */\r
544     public jalview.binding.UserColours removeUserColours(int index)\r
545     {\r
546         java.lang.Object obj = _userColoursList.elementAt(index);\r
547         _userColoursList.removeElementAt(index);\r
548         return (jalview.binding.UserColours) obj;\r
549     } //-- jalview.binding.UserColours removeUserColours(int) \r
550 \r
551     /**\r
552      * Method removeViewport\r
553      * \r
554      * \r
555      * \r
556      * @param index\r
557      * @return Viewport\r
558      */\r
559     public jalview.binding.Viewport removeViewport(int index)\r
560     {\r
561         java.lang.Object obj = _viewportList.elementAt(index);\r
562         _viewportList.removeElementAt(index);\r
563         return (jalview.binding.Viewport) obj;\r
564     } //-- jalview.binding.Viewport removeViewport(int) \r
565 \r
566     /**\r
567      * Method setJGroup\r
568      * \r
569      * \r
570      * \r
571      * @param index\r
572      * @param vJGroup\r
573      */\r
574     public void setJGroup(int index, jalview.binding.JGroup vJGroup)\r
575         throws java.lang.IndexOutOfBoundsException\r
576     {\r
577         //-- check bounds for index\r
578         if ((index < 0) || (index > _JGroupList.size())) {\r
579             throw new IndexOutOfBoundsException();\r
580         }\r
581         _JGroupList.setElementAt(vJGroup, index);\r
582     } //-- void setJGroup(int, jalview.binding.JGroup) \r
583 \r
584     /**\r
585      * Method setJGroup\r
586      * \r
587      * \r
588      * \r
589      * @param JGroupArray\r
590      */\r
591     public void setJGroup(jalview.binding.JGroup[] JGroupArray)\r
592     {\r
593         //-- copy array\r
594         _JGroupList.removeAllElements();\r
595         for (int i = 0; i < JGroupArray.length; i++) {\r
596             _JGroupList.addElement(JGroupArray[i]);\r
597         }\r
598     } //-- void setJGroup(jalview.binding.JGroup) \r
599 \r
600     /**\r
601      * Method setJSeq\r
602      * \r
603      * \r
604      * \r
605      * @param index\r
606      * @param vJSeq\r
607      */\r
608     public void setJSeq(int index, jalview.binding.JSeq vJSeq)\r
609         throws java.lang.IndexOutOfBoundsException\r
610     {\r
611         //-- check bounds for index\r
612         if ((index < 0) || (index > _JSeqList.size())) {\r
613             throw new IndexOutOfBoundsException();\r
614         }\r
615         _JSeqList.setElementAt(vJSeq, index);\r
616     } //-- void setJSeq(int, jalview.binding.JSeq) \r
617 \r
618     /**\r
619      * Method setJSeq\r
620      * \r
621      * \r
622      * \r
623      * @param JSeqArray\r
624      */\r
625     public void setJSeq(jalview.binding.JSeq[] JSeqArray)\r
626     {\r
627         //-- copy array\r
628         _JSeqList.removeAllElements();\r
629         for (int i = 0; i < JSeqArray.length; i++) {\r
630             _JSeqList.addElement(JSeqArray[i]);\r
631         }\r
632     } //-- void setJSeq(jalview.binding.JSeq) \r
633 \r
634     /**\r
635      * Method setUserColours\r
636      * \r
637      * \r
638      * \r
639      * @param index\r
640      * @param vUserColours\r
641      */\r
642     public void setUserColours(int index, jalview.binding.UserColours vUserColours)\r
643         throws java.lang.IndexOutOfBoundsException\r
644     {\r
645         //-- check bounds for index\r
646         if ((index < 0) || (index > _userColoursList.size())) {\r
647             throw new IndexOutOfBoundsException();\r
648         }\r
649         _userColoursList.setElementAt(vUserColours, index);\r
650     } //-- void setUserColours(int, jalview.binding.UserColours) \r
651 \r
652     /**\r
653      * Method setUserColours\r
654      * \r
655      * \r
656      * \r
657      * @param userColoursArray\r
658      */\r
659     public void setUserColours(jalview.binding.UserColours[] userColoursArray)\r
660     {\r
661         //-- copy array\r
662         _userColoursList.removeAllElements();\r
663         for (int i = 0; i < userColoursArray.length; i++) {\r
664             _userColoursList.addElement(userColoursArray[i]);\r
665         }\r
666     } //-- void setUserColours(jalview.binding.UserColours) \r
667 \r
668     /**\r
669      * Method setViewport\r
670      * \r
671      * \r
672      * \r
673      * @param index\r
674      * @param vViewport\r
675      */\r
676     public void setViewport(int index, jalview.binding.Viewport vViewport)\r
677         throws java.lang.IndexOutOfBoundsException\r
678     {\r
679         //-- check bounds for index\r
680         if ((index < 0) || (index > _viewportList.size())) {\r
681             throw new IndexOutOfBoundsException();\r
682         }\r
683         _viewportList.setElementAt(vViewport, index);\r
684     } //-- void setViewport(int, jalview.binding.Viewport) \r
685 \r
686     /**\r
687      * Method setViewport\r
688      * \r
689      * \r
690      * \r
691      * @param viewportArray\r
692      */\r
693     public void setViewport(jalview.binding.Viewport[] viewportArray)\r
694     {\r
695         //-- copy array\r
696         _viewportList.removeAllElements();\r
697         for (int i = 0; i < viewportArray.length; i++) {\r
698             _viewportList.addElement(viewportArray[i]);\r
699         }\r
700     } //-- void setViewport(jalview.binding.Viewport) \r
701 \r
702     /**\r
703      * Method unmarshal\r
704      * \r
705      * \r
706      * \r
707      * @param reader\r
708      * @return Object\r
709      */\r
710     public static java.lang.Object unmarshal(java.io.Reader reader)\r
711         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
712     {\r
713         return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);\r
714     } //-- java.lang.Object unmarshal(java.io.Reader) \r
715 \r
716     /**\r
717      * Method validate\r
718      * \r
719      */\r
720     public void validate()\r
721         throws org.exolab.castor.xml.ValidationException\r
722     {\r
723         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
724         validator.validate(this);\r
725     } //-- void validate() \r
726 \r
727 }\r