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