Created by Castor
[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       //----------------/\r
55      //- Constructors -/\r
56     //----------------/\r
57 \r
58     public JalviewModelSequence() {\r
59         super();\r
60         _JSeqList = new Vector();\r
61         _JGroupList = new Vector();\r
62         _viewportList = new Vector();\r
63     } //-- jalview.binding.JalviewModelSequence()\r
64 \r
65 \r
66       //-----------/\r
67      //- Methods -/\r
68     //-----------/\r
69 \r
70     /**\r
71      * Method addJGroup\r
72      * \r
73      * \r
74      * \r
75      * @param vJGroup\r
76      */\r
77     public void addJGroup(jalview.binding.JGroup vJGroup)\r
78         throws java.lang.IndexOutOfBoundsException\r
79     {\r
80         _JGroupList.addElement(vJGroup);\r
81     } //-- void addJGroup(jalview.binding.JGroup) \r
82 \r
83     /**\r
84      * Method addJGroup\r
85      * \r
86      * \r
87      * \r
88      * @param index\r
89      * @param vJGroup\r
90      */\r
91     public void addJGroup(int index, jalview.binding.JGroup vJGroup)\r
92         throws java.lang.IndexOutOfBoundsException\r
93     {\r
94         _JGroupList.insertElementAt(vJGroup, index);\r
95     } //-- void addJGroup(int, jalview.binding.JGroup) \r
96 \r
97     /**\r
98      * Method addJSeq\r
99      * \r
100      * \r
101      * \r
102      * @param vJSeq\r
103      */\r
104     public void addJSeq(jalview.binding.JSeq vJSeq)\r
105         throws java.lang.IndexOutOfBoundsException\r
106     {\r
107         _JSeqList.addElement(vJSeq);\r
108     } //-- void addJSeq(jalview.binding.JSeq) \r
109 \r
110     /**\r
111      * Method addJSeq\r
112      * \r
113      * \r
114      * \r
115      * @param index\r
116      * @param vJSeq\r
117      */\r
118     public void addJSeq(int index, jalview.binding.JSeq vJSeq)\r
119         throws java.lang.IndexOutOfBoundsException\r
120     {\r
121         _JSeqList.insertElementAt(vJSeq, index);\r
122     } //-- void addJSeq(int, jalview.binding.JSeq) \r
123 \r
124     /**\r
125      * Method addViewport\r
126      * \r
127      * \r
128      * \r
129      * @param vViewport\r
130      */\r
131     public void addViewport(jalview.binding.Viewport vViewport)\r
132         throws java.lang.IndexOutOfBoundsException\r
133     {\r
134         _viewportList.addElement(vViewport);\r
135     } //-- void addViewport(jalview.binding.Viewport) \r
136 \r
137     /**\r
138      * Method addViewport\r
139      * \r
140      * \r
141      * \r
142      * @param index\r
143      * @param vViewport\r
144      */\r
145     public void addViewport(int index, jalview.binding.Viewport vViewport)\r
146         throws java.lang.IndexOutOfBoundsException\r
147     {\r
148         _viewportList.insertElementAt(vViewport, index);\r
149     } //-- void addViewport(int, jalview.binding.Viewport) \r
150 \r
151     /**\r
152      * Method enumerateJGroup\r
153      * \r
154      * \r
155      * \r
156      * @return Enumeration\r
157      */\r
158     public java.util.Enumeration enumerateJGroup()\r
159     {\r
160         return _JGroupList.elements();\r
161     } //-- java.util.Enumeration enumerateJGroup() \r
162 \r
163     /**\r
164      * Method enumerateJSeq\r
165      * \r
166      * \r
167      * \r
168      * @return Enumeration\r
169      */\r
170     public java.util.Enumeration enumerateJSeq()\r
171     {\r
172         return _JSeqList.elements();\r
173     } //-- java.util.Enumeration enumerateJSeq() \r
174 \r
175     /**\r
176      * Method enumerateViewport\r
177      * \r
178      * \r
179      * \r
180      * @return Enumeration\r
181      */\r
182     public java.util.Enumeration enumerateViewport()\r
183     {\r
184         return _viewportList.elements();\r
185     } //-- java.util.Enumeration enumerateViewport() \r
186 \r
187     /**\r
188      * Method getJGroup\r
189      * \r
190      * \r
191      * \r
192      * @param index\r
193      * @return JGroup\r
194      */\r
195     public jalview.binding.JGroup getJGroup(int index)\r
196         throws java.lang.IndexOutOfBoundsException\r
197     {\r
198         //-- check bounds for index\r
199         if ((index < 0) || (index > _JGroupList.size())) {\r
200             throw new IndexOutOfBoundsException();\r
201         }\r
202         \r
203         return (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
204     } //-- jalview.binding.JGroup getJGroup(int) \r
205 \r
206     /**\r
207      * Method getJGroup\r
208      * \r
209      * \r
210      * \r
211      * @return JGroup\r
212      */\r
213     public jalview.binding.JGroup[] getJGroup()\r
214     {\r
215         int size = _JGroupList.size();\r
216         jalview.binding.JGroup[] mArray = new jalview.binding.JGroup[size];\r
217         for (int index = 0; index < size; index++) {\r
218             mArray[index] = (jalview.binding.JGroup) _JGroupList.elementAt(index);\r
219         }\r
220         return mArray;\r
221     } //-- jalview.binding.JGroup[] getJGroup() \r
222 \r
223     /**\r
224      * Method getJGroupCount\r
225      * \r
226      * \r
227      * \r
228      * @return int\r
229      */\r
230     public int getJGroupCount()\r
231     {\r
232         return _JGroupList.size();\r
233     } //-- int getJGroupCount() \r
234 \r
235     /**\r
236      * Method getJSeq\r
237      * \r
238      * \r
239      * \r
240      * @param index\r
241      * @return JSeq\r
242      */\r
243     public jalview.binding.JSeq getJSeq(int index)\r
244         throws java.lang.IndexOutOfBoundsException\r
245     {\r
246         //-- check bounds for index\r
247         if ((index < 0) || (index > _JSeqList.size())) {\r
248             throw new IndexOutOfBoundsException();\r
249         }\r
250         \r
251         return (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
252     } //-- jalview.binding.JSeq getJSeq(int) \r
253 \r
254     /**\r
255      * Method getJSeq\r
256      * \r
257      * \r
258      * \r
259      * @return JSeq\r
260      */\r
261     public jalview.binding.JSeq[] getJSeq()\r
262     {\r
263         int size = _JSeqList.size();\r
264         jalview.binding.JSeq[] mArray = new jalview.binding.JSeq[size];\r
265         for (int index = 0; index < size; index++) {\r
266             mArray[index] = (jalview.binding.JSeq) _JSeqList.elementAt(index);\r
267         }\r
268         return mArray;\r
269     } //-- jalview.binding.JSeq[] getJSeq() \r
270 \r
271     /**\r
272      * Method getJSeqCount\r
273      * \r
274      * \r
275      * \r
276      * @return int\r
277      */\r
278     public int getJSeqCount()\r
279     {\r
280         return _JSeqList.size();\r
281     } //-- int getJSeqCount() \r
282 \r
283     /**\r
284      * Method getViewport\r
285      * \r
286      * \r
287      * \r
288      * @param index\r
289      * @return Viewport\r
290      */\r
291     public jalview.binding.Viewport getViewport(int index)\r
292         throws java.lang.IndexOutOfBoundsException\r
293     {\r
294         //-- check bounds for index\r
295         if ((index < 0) || (index > _viewportList.size())) {\r
296             throw new IndexOutOfBoundsException();\r
297         }\r
298         \r
299         return (jalview.binding.Viewport) _viewportList.elementAt(index);\r
300     } //-- jalview.binding.Viewport getViewport(int) \r
301 \r
302     /**\r
303      * Method getViewport\r
304      * \r
305      * \r
306      * \r
307      * @return Viewport\r
308      */\r
309     public jalview.binding.Viewport[] getViewport()\r
310     {\r
311         int size = _viewportList.size();\r
312         jalview.binding.Viewport[] mArray = new jalview.binding.Viewport[size];\r
313         for (int index = 0; index < size; index++) {\r
314             mArray[index] = (jalview.binding.Viewport) _viewportList.elementAt(index);\r
315         }\r
316         return mArray;\r
317     } //-- jalview.binding.Viewport[] getViewport() \r
318 \r
319     /**\r
320      * Method getViewportCount\r
321      * \r
322      * \r
323      * \r
324      * @return int\r
325      */\r
326     public int getViewportCount()\r
327     {\r
328         return _viewportList.size();\r
329     } //-- int getViewportCount() \r
330 \r
331     /**\r
332      * Method isValid\r
333      * \r
334      * \r
335      * \r
336      * @return boolean\r
337      */\r
338     public boolean isValid()\r
339     {\r
340         try {\r
341             validate();\r
342         }\r
343         catch (org.exolab.castor.xml.ValidationException vex) {\r
344             return false;\r
345         }\r
346         return true;\r
347     } //-- boolean isValid() \r
348 \r
349     /**\r
350      * Method marshal\r
351      * \r
352      * \r
353      * \r
354      * @param out\r
355      */\r
356     public void marshal(java.io.Writer out)\r
357         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
358     {\r
359         \r
360         Marshaller.marshal(this, out);\r
361     } //-- void marshal(java.io.Writer) \r
362 \r
363     /**\r
364      * Method marshal\r
365      * \r
366      * \r
367      * \r
368      * @param handler\r
369      */\r
370     public void marshal(org.xml.sax.ContentHandler handler)\r
371         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
372     {\r
373         \r
374         Marshaller.marshal(this, handler);\r
375     } //-- void marshal(org.xml.sax.ContentHandler) \r
376 \r
377     /**\r
378      * Method removeAllJGroup\r
379      * \r
380      */\r
381     public void removeAllJGroup()\r
382     {\r
383         _JGroupList.removeAllElements();\r
384     } //-- void removeAllJGroup() \r
385 \r
386     /**\r
387      * Method removeAllJSeq\r
388      * \r
389      */\r
390     public void removeAllJSeq()\r
391     {\r
392         _JSeqList.removeAllElements();\r
393     } //-- void removeAllJSeq() \r
394 \r
395     /**\r
396      * Method removeAllViewport\r
397      * \r
398      */\r
399     public void removeAllViewport()\r
400     {\r
401         _viewportList.removeAllElements();\r
402     } //-- void removeAllViewport() \r
403 \r
404     /**\r
405      * Method removeJGroup\r
406      * \r
407      * \r
408      * \r
409      * @param index\r
410      * @return JGroup\r
411      */\r
412     public jalview.binding.JGroup removeJGroup(int index)\r
413     {\r
414         java.lang.Object obj = _JGroupList.elementAt(index);\r
415         _JGroupList.removeElementAt(index);\r
416         return (jalview.binding.JGroup) obj;\r
417     } //-- jalview.binding.JGroup removeJGroup(int) \r
418 \r
419     /**\r
420      * Method removeJSeq\r
421      * \r
422      * \r
423      * \r
424      * @param index\r
425      * @return JSeq\r
426      */\r
427     public jalview.binding.JSeq removeJSeq(int index)\r
428     {\r
429         java.lang.Object obj = _JSeqList.elementAt(index);\r
430         _JSeqList.removeElementAt(index);\r
431         return (jalview.binding.JSeq) obj;\r
432     } //-- jalview.binding.JSeq removeJSeq(int) \r
433 \r
434     /**\r
435      * Method removeViewport\r
436      * \r
437      * \r
438      * \r
439      * @param index\r
440      * @return Viewport\r
441      */\r
442     public jalview.binding.Viewport removeViewport(int index)\r
443     {\r
444         java.lang.Object obj = _viewportList.elementAt(index);\r
445         _viewportList.removeElementAt(index);\r
446         return (jalview.binding.Viewport) obj;\r
447     } //-- jalview.binding.Viewport removeViewport(int) \r
448 \r
449     /**\r
450      * Method setJGroup\r
451      * \r
452      * \r
453      * \r
454      * @param index\r
455      * @param vJGroup\r
456      */\r
457     public void setJGroup(int index, jalview.binding.JGroup vJGroup)\r
458         throws java.lang.IndexOutOfBoundsException\r
459     {\r
460         //-- check bounds for index\r
461         if ((index < 0) || (index > _JGroupList.size())) {\r
462             throw new IndexOutOfBoundsException();\r
463         }\r
464         _JGroupList.setElementAt(vJGroup, index);\r
465     } //-- void setJGroup(int, jalview.binding.JGroup) \r
466 \r
467     /**\r
468      * Method setJGroup\r
469      * \r
470      * \r
471      * \r
472      * @param JGroupArray\r
473      */\r
474     public void setJGroup(jalview.binding.JGroup[] JGroupArray)\r
475     {\r
476         //-- copy array\r
477         _JGroupList.removeAllElements();\r
478         for (int i = 0; i < JGroupArray.length; i++) {\r
479             _JGroupList.addElement(JGroupArray[i]);\r
480         }\r
481     } //-- void setJGroup(jalview.binding.JGroup) \r
482 \r
483     /**\r
484      * Method setJSeq\r
485      * \r
486      * \r
487      * \r
488      * @param index\r
489      * @param vJSeq\r
490      */\r
491     public void setJSeq(int index, jalview.binding.JSeq vJSeq)\r
492         throws java.lang.IndexOutOfBoundsException\r
493     {\r
494         //-- check bounds for index\r
495         if ((index < 0) || (index > _JSeqList.size())) {\r
496             throw new IndexOutOfBoundsException();\r
497         }\r
498         _JSeqList.setElementAt(vJSeq, index);\r
499     } //-- void setJSeq(int, jalview.binding.JSeq) \r
500 \r
501     /**\r
502      * Method setJSeq\r
503      * \r
504      * \r
505      * \r
506      * @param JSeqArray\r
507      */\r
508     public void setJSeq(jalview.binding.JSeq[] JSeqArray)\r
509     {\r
510         //-- copy array\r
511         _JSeqList.removeAllElements();\r
512         for (int i = 0; i < JSeqArray.length; i++) {\r
513             _JSeqList.addElement(JSeqArray[i]);\r
514         }\r
515     } //-- void setJSeq(jalview.binding.JSeq) \r
516 \r
517     /**\r
518      * Method setViewport\r
519      * \r
520      * \r
521      * \r
522      * @param index\r
523      * @param vViewport\r
524      */\r
525     public void setViewport(int index, jalview.binding.Viewport vViewport)\r
526         throws java.lang.IndexOutOfBoundsException\r
527     {\r
528         //-- check bounds for index\r
529         if ((index < 0) || (index > _viewportList.size())) {\r
530             throw new IndexOutOfBoundsException();\r
531         }\r
532         _viewportList.setElementAt(vViewport, index);\r
533     } //-- void setViewport(int, jalview.binding.Viewport) \r
534 \r
535     /**\r
536      * Method setViewport\r
537      * \r
538      * \r
539      * \r
540      * @param viewportArray\r
541      */\r
542     public void setViewport(jalview.binding.Viewport[] viewportArray)\r
543     {\r
544         //-- copy array\r
545         _viewportList.removeAllElements();\r
546         for (int i = 0; i < viewportArray.length; i++) {\r
547             _viewportList.addElement(viewportArray[i]);\r
548         }\r
549     } //-- void setViewport(jalview.binding.Viewport) \r
550 \r
551     /**\r
552      * Method unmarshal\r
553      * \r
554      * \r
555      * \r
556      * @param reader\r
557      * @return Object\r
558      */\r
559     public static java.lang.Object unmarshal(java.io.Reader reader)\r
560         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
561     {\r
562         return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader);\r
563     } //-- java.lang.Object unmarshal(java.io.Reader) \r
564 \r
565     /**\r
566      * Method validate\r
567      * \r
568      */\r
569     public void validate()\r
570         throws org.exolab.castor.xml.ValidationException\r
571     {\r
572         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
573         validator.validate(this);\r
574     } //-- void validate() \r
575 \r
576 }\r