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