Formatted source
[jalview.git] / src / jalview / binding / JGroup.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 * Jalview - A Sequence Alignment Editor and Viewer\r
9 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
10 *\r
11 * This program is free software; you can redistribute it and/or\r
12 * modify it under the terms of the GNU General Public License\r
13 * as published by the Free Software Foundation; either version 2\r
14 * of the License, or (at your option) any later version.\r
15 *\r
16 * This program is distributed in the hope that it will be useful,\r
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
19 * GNU General Public License for more details.\r
20 *\r
21 * You should have received a copy of the GNU General Public License\r
22 * along with this program; if not, write to the Free Software\r
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
24 */\r
25 package jalview.binding;\r
26 \r
27 import org.exolab.castor.xml.MarshalException;\r
28 import org.exolab.castor.xml.Marshaller;\r
29 import org.exolab.castor.xml.Unmarshaller;\r
30 import org.exolab.castor.xml.ValidationException;\r
31 \r
32 import org.xml.sax.ContentHandler;\r
33 \r
34 //---------------------------------/\r
35 //- Imported classes and packages -/\r
36 //---------------------------------/\r
37 import java.io.IOException;\r
38 import java.io.Reader;\r
39 import java.io.Serializable;\r
40 import java.io.Writer;\r
41 \r
42 import java.util.Enumeration;\r
43 import java.util.Vector;\r
44 \r
45 \r
46 /**\r
47  * Class JGroup.\r
48  *\r
49  * @version $Revision$ $Date$\r
50  */\r
51 public class JGroup implements java.io.Serializable {\r
52     //--------------------------/\r
53     //- Class/Member Variables -/\r
54     //--------------------------/\r
55 \r
56     /**\r
57      * Field _start\r
58      */\r
59     private int _start;\r
60 \r
61     /**\r
62      * keeps track of state for field: _start\r
63      */\r
64     private boolean _has_start;\r
65 \r
66     /**\r
67      * Field _end\r
68      */\r
69     private int _end;\r
70 \r
71     /**\r
72      * keeps track of state for field: _end\r
73      */\r
74     private boolean _has_end;\r
75 \r
76     /**\r
77      * Field _name\r
78      */\r
79     private java.lang.String _name;\r
80 \r
81     /**\r
82      * Field _colour\r
83      */\r
84     private java.lang.String _colour;\r
85 \r
86     /**\r
87      * Field _consThreshold\r
88      */\r
89     private int _consThreshold;\r
90 \r
91     /**\r
92      * keeps track of state for field: _consThreshold\r
93      */\r
94     private boolean _has_consThreshold;\r
95 \r
96     /**\r
97      * Field _pidThreshold\r
98      */\r
99     private int _pidThreshold;\r
100 \r
101     /**\r
102      * keeps track of state for field: _pidThreshold\r
103      */\r
104     private boolean _has_pidThreshold;\r
105 \r
106     /**\r
107      * Field _outlineColour\r
108      */\r
109     private int _outlineColour;\r
110 \r
111     /**\r
112      * keeps track of state for field: _outlineColour\r
113      */\r
114     private boolean _has_outlineColour;\r
115 \r
116     /**\r
117      * Field _displayBoxes\r
118      */\r
119     private boolean _displayBoxes;\r
120 \r
121     /**\r
122      * keeps track of state for field: _displayBoxes\r
123      */\r
124     private boolean _has_displayBoxes;\r
125 \r
126     /**\r
127      * Field _displayText\r
128      */\r
129     private boolean _displayText;\r
130 \r
131     /**\r
132      * keeps track of state for field: _displayText\r
133      */\r
134     private boolean _has_displayText;\r
135 \r
136     /**\r
137      * Field _colourText\r
138      */\r
139     private boolean _colourText;\r
140 \r
141     /**\r
142      * keeps track of state for field: _colourText\r
143      */\r
144     private boolean _has_colourText;\r
145 \r
146     /**\r
147      * Field _seqList\r
148      */\r
149     private java.util.Vector _seqList;\r
150 \r
151     //----------------/\r
152     //- Constructors -/\r
153     //----------------/\r
154     public JGroup() {\r
155         super();\r
156         _seqList = new Vector();\r
157     }\r
158      //-- jalview.binding.JGroup()\r
159  //-----------/\r
160 \r
161     public void addSeq(int vSeq) throws java.lang.IndexOutOfBoundsException {\r
162         _seqList.addElement(new java.lang.Integer(vSeq));\r
163     }\r
164      //-- void addSeq(int)\r
165 \r
166     /**\r
167      * Method addSeq\r
168      *\r
169      *\r
170      *\r
171      * @param index\r
172      * @param vSeq\r
173      */\r
174     public void addSeq(int index, int vSeq)\r
175         throws java.lang.IndexOutOfBoundsException {\r
176         _seqList.insertElementAt(new java.lang.Integer(vSeq), index);\r
177     }\r
178      //-- void addSeq(int, int)\r
179 \r
180     /**\r
181      * Method deleteColourText\r
182      *\r
183      */\r
184     public void deleteColourText() {\r
185         this._has_colourText = false;\r
186     }\r
187      //-- void deleteColourText()\r
188 \r
189     /**\r
190      * Method deleteConsThreshold\r
191      *\r
192      */\r
193     public void deleteConsThreshold() {\r
194         this._has_consThreshold = false;\r
195     }\r
196      //-- void deleteConsThreshold()\r
197 \r
198     /**\r
199      * Method deleteDisplayBoxes\r
200      *\r
201      */\r
202     public void deleteDisplayBoxes() {\r
203         this._has_displayBoxes = false;\r
204     }\r
205      //-- void deleteDisplayBoxes()\r
206 \r
207     /**\r
208      * Method deleteDisplayText\r
209      *\r
210      */\r
211     public void deleteDisplayText() {\r
212         this._has_displayText = false;\r
213     }\r
214      //-- void deleteDisplayText()\r
215 \r
216     /**\r
217      * Method deleteEnd\r
218      *\r
219      */\r
220     public void deleteEnd() {\r
221         this._has_end = false;\r
222     }\r
223      //-- void deleteEnd()\r
224 \r
225     /**\r
226      * Method deleteOutlineColour\r
227      *\r
228      */\r
229     public void deleteOutlineColour() {\r
230         this._has_outlineColour = false;\r
231     }\r
232      //-- void deleteOutlineColour()\r
233 \r
234     /**\r
235      * Method deletePidThreshold\r
236      *\r
237      */\r
238     public void deletePidThreshold() {\r
239         this._has_pidThreshold = false;\r
240     }\r
241      //-- void deletePidThreshold()\r
242 \r
243     /**\r
244      * Method deleteStart\r
245      *\r
246      */\r
247     public void deleteStart() {\r
248         this._has_start = false;\r
249     }\r
250      //-- void deleteStart()\r
251 \r
252     /**\r
253      * Method enumerateSeq\r
254      *\r
255      *\r
256      *\r
257      * @return Enumeration\r
258      */\r
259     public java.util.Enumeration enumerateSeq() {\r
260         return _seqList.elements();\r
261     }\r
262      //-- java.util.Enumeration enumerateSeq()\r
263 \r
264     /**\r
265      * Returns the value of field 'colour'.\r
266      *\r
267      * @return String\r
268      * @return the value of field 'colour'.\r
269      */\r
270     public java.lang.String getColour() {\r
271         return this._colour;\r
272     }\r
273      //-- java.lang.String getColour()\r
274 \r
275     /**\r
276      * Returns the value of field 'colourText'.\r
277      *\r
278      * @return boolean\r
279      * @return the value of field 'colourText'.\r
280      */\r
281     public boolean getColourText() {\r
282         return this._colourText;\r
283     }\r
284      //-- boolean getColourText()\r
285 \r
286     /**\r
287      * Returns the value of field 'consThreshold'.\r
288      *\r
289      * @return int\r
290      * @return the value of field 'consThreshold'.\r
291      */\r
292     public int getConsThreshold() {\r
293         return this._consThreshold;\r
294     }\r
295      //-- int getConsThreshold()\r
296 \r
297     /**\r
298      * Returns the value of field 'displayBoxes'.\r
299      *\r
300      * @return boolean\r
301      * @return the value of field 'displayBoxes'.\r
302      */\r
303     public boolean getDisplayBoxes() {\r
304         return this._displayBoxes;\r
305     }\r
306      //-- boolean getDisplayBoxes()\r
307 \r
308     /**\r
309      * Returns the value of field 'displayText'.\r
310      *\r
311      * @return boolean\r
312      * @return the value of field 'displayText'.\r
313      */\r
314     public boolean getDisplayText() {\r
315         return this._displayText;\r
316     }\r
317      //-- boolean getDisplayText()\r
318 \r
319     /**\r
320      * Returns the value of field 'end'.\r
321      *\r
322      * @return int\r
323      * @return the value of field 'end'.\r
324      */\r
325     public int getEnd() {\r
326         return this._end;\r
327     }\r
328      //-- int getEnd()\r
329 \r
330     /**\r
331      * Returns the value of field 'name'.\r
332      *\r
333      * @return String\r
334      * @return the value of field 'name'.\r
335      */\r
336     public java.lang.String getName() {\r
337         return this._name;\r
338     }\r
339      //-- java.lang.String getName()\r
340 \r
341     /**\r
342      * Returns the value of field 'outlineColour'.\r
343      *\r
344      * @return int\r
345      * @return the value of field 'outlineColour'.\r
346      */\r
347     public int getOutlineColour() {\r
348         return this._outlineColour;\r
349     }\r
350      //-- int getOutlineColour()\r
351 \r
352     /**\r
353      * Returns the value of field 'pidThreshold'.\r
354      *\r
355      * @return int\r
356      * @return the value of field 'pidThreshold'.\r
357      */\r
358     public int getPidThreshold() {\r
359         return this._pidThreshold;\r
360     }\r
361      //-- int getPidThreshold()\r
362 \r
363     /**\r
364      * Method getSeq\r
365      *\r
366      *\r
367      *\r
368      * @param index\r
369      * @return int\r
370      */\r
371     public int getSeq(int index) throws java.lang.IndexOutOfBoundsException {\r
372         //-- check bounds for index\r
373         if ((index < 0) || (index > _seqList.size())) {\r
374             throw new IndexOutOfBoundsException();\r
375         }\r
376 \r
377         return ((java.lang.Integer) _seqList.elementAt(index)).intValue();\r
378     }\r
379      //-- int getSeq(int)\r
380 \r
381     /**\r
382      * Method getSeq\r
383      *\r
384      *\r
385      *\r
386      * @return int\r
387      */\r
388     public int[] getSeq() {\r
389         int size = _seqList.size();\r
390         int[] mArray = new int[size];\r
391 \r
392         for (int index = 0; index < size; index++) {\r
393             mArray[index] = ((java.lang.Integer) _seqList.elementAt(index)).intValue();\r
394         }\r
395 \r
396         return mArray;\r
397     }\r
398      //-- int[] getSeq()\r
399 \r
400     /**\r
401      * Method getSeqCount\r
402      *\r
403      *\r
404      *\r
405      * @return int\r
406      */\r
407     public int getSeqCount() {\r
408         return _seqList.size();\r
409     }\r
410      //-- int getSeqCount()\r
411 \r
412     /**\r
413      * Returns the value of field 'start'.\r
414      *\r
415      * @return int\r
416      * @return the value of field 'start'.\r
417      */\r
418     public int getStart() {\r
419         return this._start;\r
420     }\r
421      //-- int getStart()\r
422 \r
423     /**\r
424      * Method hasColourText\r
425      *\r
426      *\r
427      *\r
428      * @return boolean\r
429      */\r
430     public boolean hasColourText() {\r
431         return this._has_colourText;\r
432     }\r
433      //-- boolean hasColourText()\r
434 \r
435     /**\r
436      * Method hasConsThreshold\r
437      *\r
438      *\r
439      *\r
440      * @return boolean\r
441      */\r
442     public boolean hasConsThreshold() {\r
443         return this._has_consThreshold;\r
444     }\r
445      //-- boolean hasConsThreshold()\r
446 \r
447     /**\r
448      * Method hasDisplayBoxes\r
449      *\r
450      *\r
451      *\r
452      * @return boolean\r
453      */\r
454     public boolean hasDisplayBoxes() {\r
455         return this._has_displayBoxes;\r
456     }\r
457      //-- boolean hasDisplayBoxes()\r
458 \r
459     /**\r
460      * Method hasDisplayText\r
461      *\r
462      *\r
463      *\r
464      * @return boolean\r
465      */\r
466     public boolean hasDisplayText() {\r
467         return this._has_displayText;\r
468     }\r
469      //-- boolean hasDisplayText()\r
470 \r
471     /**\r
472      * Method hasEnd\r
473      *\r
474      *\r
475      *\r
476      * @return boolean\r
477      */\r
478     public boolean hasEnd() {\r
479         return this._has_end;\r
480     }\r
481      //-- boolean hasEnd()\r
482 \r
483     /**\r
484      * Method hasOutlineColour\r
485      *\r
486      *\r
487      *\r
488      * @return boolean\r
489      */\r
490     public boolean hasOutlineColour() {\r
491         return this._has_outlineColour;\r
492     }\r
493      //-- boolean hasOutlineColour()\r
494 \r
495     /**\r
496      * Method hasPidThreshold\r
497      *\r
498      *\r
499      *\r
500      * @return boolean\r
501      */\r
502     public boolean hasPidThreshold() {\r
503         return this._has_pidThreshold;\r
504     }\r
505      //-- boolean hasPidThreshold()\r
506 \r
507     /**\r
508      * Method hasStart\r
509      *\r
510      *\r
511      *\r
512      * @return boolean\r
513      */\r
514     public boolean hasStart() {\r
515         return this._has_start;\r
516     }\r
517      //-- boolean hasStart()\r
518 \r
519     /**\r
520      * Method isValid\r
521      *\r
522      *\r
523      *\r
524      * @return boolean\r
525      */\r
526     public boolean isValid() {\r
527         try {\r
528             validate();\r
529         } catch (org.exolab.castor.xml.ValidationException vex) {\r
530             return false;\r
531         }\r
532 \r
533         return true;\r
534     }\r
535      //-- boolean isValid()\r
536 \r
537     /**\r
538      * Method marshal\r
539      *\r
540      *\r
541      *\r
542      * @param out\r
543      */\r
544     public void marshal(java.io.Writer out)\r
545         throws org.exolab.castor.xml.MarshalException, \r
546             org.exolab.castor.xml.ValidationException {\r
547         Marshaller.marshal(this, out);\r
548     }\r
549      //-- void marshal(java.io.Writer)\r
550 \r
551     /**\r
552      * Method marshal\r
553      *\r
554      *\r
555      *\r
556      * @param handler\r
557      */\r
558     public void marshal(org.xml.sax.ContentHandler handler)\r
559         throws java.io.IOException, org.exolab.castor.xml.MarshalException, \r
560             org.exolab.castor.xml.ValidationException {\r
561         Marshaller.marshal(this, handler);\r
562     }\r
563      //-- void marshal(org.xml.sax.ContentHandler)\r
564 \r
565     /**\r
566      * Method removeAllSeq\r
567      *\r
568      */\r
569     public void removeAllSeq() {\r
570         _seqList.removeAllElements();\r
571     }\r
572      //-- void removeAllSeq()\r
573 \r
574     /**\r
575      * Method removeSeq\r
576      *\r
577      *\r
578      *\r
579      * @param index\r
580      * @return int\r
581      */\r
582     public int removeSeq(int index) {\r
583         java.lang.Object obj = _seqList.elementAt(index);\r
584         _seqList.removeElementAt(index);\r
585 \r
586         return ((java.lang.Integer) obj).intValue();\r
587     }\r
588      //-- int removeSeq(int)\r
589 \r
590     /**\r
591      * Sets the value of field 'colour'.\r
592      *\r
593      * @param colour the value of field 'colour'.\r
594      */\r
595     public void setColour(java.lang.String colour) {\r
596         this._colour = colour;\r
597     }\r
598      //-- void setColour(java.lang.String)\r
599 \r
600     /**\r
601      * Sets the value of field 'colourText'.\r
602      *\r
603      * @param colourText the value of field 'colourText'.\r
604      */\r
605     public void setColourText(boolean colourText) {\r
606         this._colourText = colourText;\r
607         this._has_colourText = true;\r
608     }\r
609      //-- void setColourText(boolean)\r
610 \r
611     /**\r
612      * Sets the value of field 'consThreshold'.\r
613      *\r
614      * @param consThreshold the value of field 'consThreshold'.\r
615      */\r
616     public void setConsThreshold(int consThreshold) {\r
617         this._consThreshold = consThreshold;\r
618         this._has_consThreshold = true;\r
619     }\r
620      //-- void setConsThreshold(int)\r
621 \r
622     /**\r
623      * Sets the value of field 'displayBoxes'.\r
624      *\r
625      * @param displayBoxes the value of field 'displayBoxes'.\r
626      */\r
627     public void setDisplayBoxes(boolean displayBoxes) {\r
628         this._displayBoxes = displayBoxes;\r
629         this._has_displayBoxes = true;\r
630     }\r
631      //-- void setDisplayBoxes(boolean)\r
632 \r
633     /**\r
634      * Sets the value of field 'displayText'.\r
635      *\r
636      * @param displayText the value of field 'displayText'.\r
637      */\r
638     public void setDisplayText(boolean displayText) {\r
639         this._displayText = displayText;\r
640         this._has_displayText = true;\r
641     }\r
642      //-- void setDisplayText(boolean)\r
643 \r
644     /**\r
645      * Sets the value of field 'end'.\r
646      *\r
647      * @param end the value of field 'end'.\r
648      */\r
649     public void setEnd(int end) {\r
650         this._end = end;\r
651         this._has_end = true;\r
652     }\r
653      //-- void setEnd(int)\r
654 \r
655     /**\r
656      * Sets the value of field 'name'.\r
657      *\r
658      * @param name the value of field 'name'.\r
659      */\r
660     public void setName(java.lang.String name) {\r
661         this._name = name;\r
662     }\r
663      //-- void setName(java.lang.String)\r
664 \r
665     /**\r
666      * Sets the value of field 'outlineColour'.\r
667      *\r
668      * @param outlineColour the value of field 'outlineColour'.\r
669      */\r
670     public void setOutlineColour(int outlineColour) {\r
671         this._outlineColour = outlineColour;\r
672         this._has_outlineColour = true;\r
673     }\r
674      //-- void setOutlineColour(int)\r
675 \r
676     /**\r
677      * Sets the value of field 'pidThreshold'.\r
678      *\r
679      * @param pidThreshold the value of field 'pidThreshold'.\r
680      */\r
681     public void setPidThreshold(int pidThreshold) {\r
682         this._pidThreshold = pidThreshold;\r
683         this._has_pidThreshold = true;\r
684     }\r
685      //-- void setPidThreshold(int)\r
686 \r
687     /**\r
688      * Method setSeq\r
689      *\r
690      *\r
691      *\r
692      * @param index\r
693      * @param vSeq\r
694      */\r
695     public void setSeq(int index, int vSeq)\r
696         throws java.lang.IndexOutOfBoundsException {\r
697         //-- check bounds for index\r
698         if ((index < 0) || (index > _seqList.size())) {\r
699             throw new IndexOutOfBoundsException();\r
700         }\r
701 \r
702         _seqList.setElementAt(new java.lang.Integer(vSeq), index);\r
703     }\r
704      //-- void setSeq(int, int)\r
705 \r
706     /**\r
707      * Method setSeq\r
708      *\r
709      *\r
710      *\r
711      * @param seqArray\r
712      */\r
713     public void setSeq(int[] seqArray) {\r
714         //-- copy array\r
715         _seqList.removeAllElements();\r
716 \r
717         for (int i = 0; i < seqArray.length; i++) {\r
718             _seqList.addElement(new java.lang.Integer(seqArray[i]));\r
719         }\r
720     }\r
721      //-- void setSeq(int)\r
722 \r
723     /**\r
724      * Sets the value of field 'start'.\r
725      *\r
726      * @param start the value of field 'start'.\r
727      */\r
728     public void setStart(int start) {\r
729         this._start = start;\r
730         this._has_start = true;\r
731     }\r
732      //-- void setStart(int)\r
733 \r
734     /**\r
735      * Method unmarshal\r
736      *\r
737      *\r
738      *\r
739      * @param reader\r
740      * @return Object\r
741      */\r
742     public static java.lang.Object unmarshal(java.io.Reader reader)\r
743         throws org.exolab.castor.xml.MarshalException, \r
744             org.exolab.castor.xml.ValidationException {\r
745         return (jalview.binding.JGroup) Unmarshaller.unmarshal(jalview.binding.JGroup.class,\r
746             reader);\r
747     }\r
748      //-- java.lang.Object unmarshal(java.io.Reader)\r
749 \r
750     /**\r
751      * Method validate\r
752      *\r
753      */\r
754     public void validate() throws org.exolab.castor.xml.ValidationException {\r
755         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
756         validator.validate(this);\r
757     }\r
758      //-- void validate()\r
759 }\r