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