after merge
[jalview.git] / src / jalview / binding / JSeq.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 JSeq.\r
28  * \r
29  * @version $Revision$ $Date$\r
30  */\r
31 public class JSeq implements java.io.Serializable {\r
32 \r
33 \r
34       //--------------------------/\r
35      //- Class/Member Variables -/\r
36     //--------------------------/\r
37 \r
38     /**\r
39      * Field _colour\r
40      */\r
41     private int _colour;\r
42 \r
43     /**\r
44      * keeps track of state for field: _colour\r
45      */\r
46     private boolean _has_colour;\r
47 \r
48     /**\r
49      * Field _start\r
50      */\r
51     private int _start;\r
52 \r
53     /**\r
54      * keeps track of state for field: _start\r
55      */\r
56     private boolean _has_start;\r
57 \r
58     /**\r
59      * Field _end\r
60      */\r
61     private int _end;\r
62 \r
63     /**\r
64      * keeps track of state for field: _end\r
65      */\r
66     private boolean _has_end;\r
67 \r
68     /**\r
69      * Field _id\r
70      */\r
71     private int _id;\r
72 \r
73     /**\r
74      * keeps track of state for field: _id\r
75      */\r
76     private boolean _has_id;\r
77 \r
78     /**\r
79      * Field _featuresList\r
80      */\r
81     private java.util.Vector _featuresList;\r
82 \r
83     /**\r
84      * Field _pdbidsList\r
85      */\r
86     private java.util.Vector _pdbidsList;\r
87 \r
88 \r
89       //----------------/\r
90      //- Constructors -/\r
91     //----------------/\r
92 \r
93     public JSeq() {\r
94         super();\r
95         _featuresList = new Vector();\r
96         _pdbidsList = new Vector();\r
97     } //-- jalview.binding.JSeq()\r
98 \r
99 \r
100       //-----------/\r
101      //- Methods -/\r
102     //-----------/\r
103 \r
104     /**\r
105      * Method addFeatures\r
106      * \r
107      * \r
108      * \r
109      * @param vFeatures\r
110      */\r
111     public void addFeatures(jalview.binding.Features vFeatures)\r
112         throws java.lang.IndexOutOfBoundsException\r
113     {\r
114         _featuresList.addElement(vFeatures);\r
115     } //-- void addFeatures(jalview.binding.Features) \r
116 \r
117     /**\r
118      * Method addFeatures\r
119      * \r
120      * \r
121      * \r
122      * @param index\r
123      * @param vFeatures\r
124      */\r
125     public void addFeatures(int index, jalview.binding.Features vFeatures)\r
126         throws java.lang.IndexOutOfBoundsException\r
127     {\r
128         _featuresList.insertElementAt(vFeatures, index);\r
129     } //-- void addFeatures(int, jalview.binding.Features) \r
130 \r
131     /**\r
132      * Method addPdbids\r
133      * \r
134      * \r
135      * \r
136      * @param vPdbids\r
137      */\r
138     public void addPdbids(jalview.binding.Pdbids vPdbids)\r
139         throws java.lang.IndexOutOfBoundsException\r
140     {\r
141         _pdbidsList.addElement(vPdbids);\r
142     } //-- void addPdbids(jalview.binding.Pdbids) \r
143 \r
144     /**\r
145      * Method addPdbids\r
146      * \r
147      * \r
148      * \r
149      * @param index\r
150      * @param vPdbids\r
151      */\r
152     public void addPdbids(int index, jalview.binding.Pdbids vPdbids)\r
153         throws java.lang.IndexOutOfBoundsException\r
154     {\r
155         _pdbidsList.insertElementAt(vPdbids, index);\r
156     } //-- void addPdbids(int, jalview.binding.Pdbids) \r
157 \r
158     /**\r
159      * Method deleteColour\r
160      * \r
161      */\r
162     public void deleteColour()\r
163     {\r
164         this._has_colour= false;\r
165     } //-- void deleteColour() \r
166 \r
167     /**\r
168      * Method deleteEnd\r
169      * \r
170      */\r
171     public void deleteEnd()\r
172     {\r
173         this._has_end= false;\r
174     } //-- void deleteEnd() \r
175 \r
176     /**\r
177      * Method deleteId\r
178      * \r
179      */\r
180     public void deleteId()\r
181     {\r
182         this._has_id= false;\r
183     } //-- void deleteId() \r
184 \r
185     /**\r
186      * Method deleteStart\r
187      * \r
188      */\r
189     public void deleteStart()\r
190     {\r
191         this._has_start= false;\r
192     } //-- void deleteStart() \r
193 \r
194     /**\r
195      * Method enumerateFeatures\r
196      * \r
197      * \r
198      * \r
199      * @return Enumeration\r
200      */\r
201     public java.util.Enumeration enumerateFeatures()\r
202     {\r
203         return _featuresList.elements();\r
204     } //-- java.util.Enumeration enumerateFeatures() \r
205 \r
206     /**\r
207      * Method enumeratePdbids\r
208      * \r
209      * \r
210      * \r
211      * @return Enumeration\r
212      */\r
213     public java.util.Enumeration enumeratePdbids()\r
214     {\r
215         return _pdbidsList.elements();\r
216     } //-- java.util.Enumeration enumeratePdbids() \r
217 \r
218     /**\r
219      * Returns the value of field 'colour'.\r
220      * \r
221      * @return int\r
222      * @return the value of field 'colour'.\r
223      */\r
224     public int getColour()\r
225     {\r
226         return this._colour;\r
227     } //-- int getColour() \r
228 \r
229     /**\r
230      * Returns the value of field 'end'.\r
231      * \r
232      * @return int\r
233      * @return the value of field 'end'.\r
234      */\r
235     public int getEnd()\r
236     {\r
237         return this._end;\r
238     } //-- int getEnd() \r
239 \r
240     /**\r
241      * Method getFeatures\r
242      * \r
243      * \r
244      * \r
245      * @param index\r
246      * @return Features\r
247      */\r
248     public jalview.binding.Features getFeatures(int index)\r
249         throws java.lang.IndexOutOfBoundsException\r
250     {\r
251         //-- check bounds for index\r
252         if ((index < 0) || (index > _featuresList.size())) {\r
253             throw new IndexOutOfBoundsException();\r
254         }\r
255         \r
256         return (jalview.binding.Features) _featuresList.elementAt(index);\r
257     } //-- jalview.binding.Features getFeatures(int) \r
258 \r
259     /**\r
260      * Method getFeatures\r
261      * \r
262      * \r
263      * \r
264      * @return Features\r
265      */\r
266     public jalview.binding.Features[] getFeatures()\r
267     {\r
268         int size = _featuresList.size();\r
269         jalview.binding.Features[] mArray = new jalview.binding.Features[size];\r
270         for (int index = 0; index < size; index++) {\r
271             mArray[index] = (jalview.binding.Features) _featuresList.elementAt(index);\r
272         }\r
273         return mArray;\r
274     } //-- jalview.binding.Features[] getFeatures() \r
275 \r
276     /**\r
277      * Method getFeaturesCount\r
278      * \r
279      * \r
280      * \r
281      * @return int\r
282      */\r
283     public int getFeaturesCount()\r
284     {\r
285         return _featuresList.size();\r
286     } //-- int getFeaturesCount() \r
287 \r
288     /**\r
289      * Returns the value of field 'id'.\r
290      * \r
291      * @return int\r
292      * @return the value of field 'id'.\r
293      */\r
294     public int getId()\r
295     {\r
296         return this._id;\r
297     } //-- int getId() \r
298 \r
299     /**\r
300      * Method getPdbids\r
301      * \r
302      * \r
303      * \r
304      * @param index\r
305      * @return Pdbids\r
306      */\r
307     public jalview.binding.Pdbids getPdbids(int index)\r
308         throws java.lang.IndexOutOfBoundsException\r
309     {\r
310         //-- check bounds for index\r
311         if ((index < 0) || (index > _pdbidsList.size())) {\r
312             throw new IndexOutOfBoundsException();\r
313         }\r
314         \r
315         return (jalview.binding.Pdbids) _pdbidsList.elementAt(index);\r
316     } //-- jalview.binding.Pdbids getPdbids(int) \r
317 \r
318     /**\r
319      * Method getPdbids\r
320      * \r
321      * \r
322      * \r
323      * @return Pdbids\r
324      */\r
325     public jalview.binding.Pdbids[] getPdbids()\r
326     {\r
327         int size = _pdbidsList.size();\r
328         jalview.binding.Pdbids[] mArray = new jalview.binding.Pdbids[size];\r
329         for (int index = 0; index < size; index++) {\r
330             mArray[index] = (jalview.binding.Pdbids) _pdbidsList.elementAt(index);\r
331         }\r
332         return mArray;\r
333     } //-- jalview.binding.Pdbids[] getPdbids() \r
334 \r
335     /**\r
336      * Method getPdbidsCount\r
337      * \r
338      * \r
339      * \r
340      * @return int\r
341      */\r
342     public int getPdbidsCount()\r
343     {\r
344         return _pdbidsList.size();\r
345     } //-- int getPdbidsCount() \r
346 \r
347     /**\r
348      * Returns the value of field 'start'.\r
349      * \r
350      * @return int\r
351      * @return the value of field 'start'.\r
352      */\r
353     public int getStart()\r
354     {\r
355         return this._start;\r
356     } //-- int getStart() \r
357 \r
358     /**\r
359      * Method hasColour\r
360      * \r
361      * \r
362      * \r
363      * @return boolean\r
364      */\r
365     public boolean hasColour()\r
366     {\r
367         return this._has_colour;\r
368     } //-- boolean hasColour() \r
369 \r
370     /**\r
371      * Method hasEnd\r
372      * \r
373      * \r
374      * \r
375      * @return boolean\r
376      */\r
377     public boolean hasEnd()\r
378     {\r
379         return this._has_end;\r
380     } //-- boolean hasEnd() \r
381 \r
382     /**\r
383      * Method hasId\r
384      * \r
385      * \r
386      * \r
387      * @return boolean\r
388      */\r
389     public boolean hasId()\r
390     {\r
391         return this._has_id;\r
392     } //-- boolean hasId() \r
393 \r
394     /**\r
395      * Method hasStart\r
396      * \r
397      * \r
398      * \r
399      * @return boolean\r
400      */\r
401     public boolean hasStart()\r
402     {\r
403         return this._has_start;\r
404     } //-- boolean hasStart() \r
405 \r
406     /**\r
407      * Method isValid\r
408      * \r
409      * \r
410      * \r
411      * @return boolean\r
412      */\r
413     public boolean isValid()\r
414     {\r
415         try {\r
416             validate();\r
417         }\r
418         catch (org.exolab.castor.xml.ValidationException vex) {\r
419             return false;\r
420         }\r
421         return true;\r
422     } //-- boolean isValid() \r
423 \r
424     /**\r
425      * Method marshal\r
426      * \r
427      * \r
428      * \r
429      * @param out\r
430      */\r
431     public void marshal(java.io.Writer out)\r
432         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
433     {\r
434         \r
435         Marshaller.marshal(this, out);\r
436     } //-- void marshal(java.io.Writer) \r
437 \r
438     /**\r
439      * Method marshal\r
440      * \r
441      * \r
442      * \r
443      * @param handler\r
444      */\r
445     public void marshal(org.xml.sax.ContentHandler handler)\r
446         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
447     {\r
448         \r
449         Marshaller.marshal(this, handler);\r
450     } //-- void marshal(org.xml.sax.ContentHandler) \r
451 \r
452     /**\r
453      * Method removeAllFeatures\r
454      * \r
455      */\r
456     public void removeAllFeatures()\r
457     {\r
458         _featuresList.removeAllElements();\r
459     } //-- void removeAllFeatures() \r
460 \r
461     /**\r
462      * Method removeAllPdbids\r
463      * \r
464      */\r
465     public void removeAllPdbids()\r
466     {\r
467         _pdbidsList.removeAllElements();\r
468     } //-- void removeAllPdbids() \r
469 \r
470     /**\r
471      * Method removeFeatures\r
472      * \r
473      * \r
474      * \r
475      * @param index\r
476      * @return Features\r
477      */\r
478     public jalview.binding.Features removeFeatures(int index)\r
479     {\r
480         java.lang.Object obj = _featuresList.elementAt(index);\r
481         _featuresList.removeElementAt(index);\r
482         return (jalview.binding.Features) obj;\r
483     } //-- jalview.binding.Features removeFeatures(int) \r
484 \r
485     /**\r
486      * Method removePdbids\r
487      * \r
488      * \r
489      * \r
490      * @param index\r
491      * @return Pdbids\r
492      */\r
493     public jalview.binding.Pdbids removePdbids(int index)\r
494     {\r
495         java.lang.Object obj = _pdbidsList.elementAt(index);\r
496         _pdbidsList.removeElementAt(index);\r
497         return (jalview.binding.Pdbids) obj;\r
498     } //-- jalview.binding.Pdbids removePdbids(int) \r
499 \r
500     /**\r
501      * Sets the value of field 'colour'.\r
502      * \r
503      * @param colour the value of field 'colour'.\r
504      */\r
505     public void setColour(int colour)\r
506     {\r
507         this._colour = colour;\r
508         this._has_colour = true;\r
509     } //-- void setColour(int) \r
510 \r
511     /**\r
512      * Sets the value of field 'end'.\r
513      * \r
514      * @param end the value of field 'end'.\r
515      */\r
516     public void setEnd(int end)\r
517     {\r
518         this._end = end;\r
519         this._has_end = true;\r
520     } //-- void setEnd(int) \r
521 \r
522     /**\r
523      * Method setFeatures\r
524      * \r
525      * \r
526      * \r
527      * @param index\r
528      * @param vFeatures\r
529      */\r
530     public void setFeatures(int index, jalview.binding.Features vFeatures)\r
531         throws java.lang.IndexOutOfBoundsException\r
532     {\r
533         //-- check bounds for index\r
534         if ((index < 0) || (index > _featuresList.size())) {\r
535             throw new IndexOutOfBoundsException();\r
536         }\r
537         _featuresList.setElementAt(vFeatures, index);\r
538     } //-- void setFeatures(int, jalview.binding.Features) \r
539 \r
540     /**\r
541      * Method setFeatures\r
542      * \r
543      * \r
544      * \r
545      * @param featuresArray\r
546      */\r
547     public void setFeatures(jalview.binding.Features[] featuresArray)\r
548     {\r
549         //-- copy array\r
550         _featuresList.removeAllElements();\r
551         for (int i = 0; i < featuresArray.length; i++) {\r
552             _featuresList.addElement(featuresArray[i]);\r
553         }\r
554     } //-- void setFeatures(jalview.binding.Features) \r
555 \r
556     /**\r
557      * Sets the value of field 'id'.\r
558      * \r
559      * @param id the value of field 'id'.\r
560      */\r
561     public void setId(int id)\r
562     {\r
563         this._id = id;\r
564         this._has_id = true;\r
565     } //-- void setId(int) \r
566 \r
567     /**\r
568      * Method setPdbids\r
569      * \r
570      * \r
571      * \r
572      * @param index\r
573      * @param vPdbids\r
574      */\r
575     public void setPdbids(int index, jalview.binding.Pdbids vPdbids)\r
576         throws java.lang.IndexOutOfBoundsException\r
577     {\r
578         //-- check bounds for index\r
579         if ((index < 0) || (index > _pdbidsList.size())) {\r
580             throw new IndexOutOfBoundsException();\r
581         }\r
582         _pdbidsList.setElementAt(vPdbids, index);\r
583     } //-- void setPdbids(int, jalview.binding.Pdbids) \r
584 \r
585     /**\r
586      * Method setPdbids\r
587      * \r
588      * \r
589      * \r
590      * @param pdbidsArray\r
591      */\r
592     public void setPdbids(jalview.binding.Pdbids[] pdbidsArray)\r
593     {\r
594         //-- copy array\r
595         _pdbidsList.removeAllElements();\r
596         for (int i = 0; i < pdbidsArray.length; i++) {\r
597             _pdbidsList.addElement(pdbidsArray[i]);\r
598         }\r
599     } //-- void setPdbids(jalview.binding.Pdbids) \r
600 \r
601     /**\r
602      * Sets the value of field 'start'.\r
603      * \r
604      * @param start the value of field 'start'.\r
605      */\r
606     public void setStart(int start)\r
607     {\r
608         this._start = start;\r
609         this._has_start = true;\r
610     } //-- void setStart(int) \r
611 \r
612     /**\r
613      * Method unmarshal\r
614      * \r
615      * \r
616      * \r
617      * @param reader\r
618      * @return Object\r
619      */\r
620     public static java.lang.Object unmarshal(java.io.Reader reader)\r
621         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
622     {\r
623         return (jalview.binding.JSeq) Unmarshaller.unmarshal(jalview.binding.JSeq.class, reader);\r
624     } //-- java.lang.Object unmarshal(java.io.Reader) \r
625 \r
626     /**\r
627      * Method validate\r
628      * \r
629      */\r
630     public void validate()\r
631         throws org.exolab.castor.xml.ValidationException\r
632     {\r
633         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
634         validator.validate(this);\r
635     } //-- void validate() \r
636 \r
637 }\r