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