2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\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
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
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
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
25 package jalview.binding;
\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
32 import org.xml.sax.ContentHandler;
\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
42 import java.util.Enumeration;
\r
43 import java.util.Vector;
\r
49 * @version $Revision$ $Date$
\r
51 public class JGroup implements java.io.Serializable {
\r
52 //--------------------------/
\r
53 //- Class/Member Variables -/
\r
54 //--------------------------/
\r
62 * keeps track of state for field: _start
\r
64 private boolean _has_start;
\r
72 * keeps track of state for field: _end
\r
74 private boolean _has_end;
\r
79 private java.lang.String _name;
\r
84 private java.lang.String _colour;
\r
87 * Field _consThreshold
\r
89 private int _consThreshold;
\r
92 * keeps track of state for field: _consThreshold
\r
94 private boolean _has_consThreshold;
\r
97 * Field _pidThreshold
\r
99 private int _pidThreshold;
\r
102 * keeps track of state for field: _pidThreshold
\r
104 private boolean _has_pidThreshold;
\r
107 * Field _outlineColour
\r
109 private int _outlineColour;
\r
112 * keeps track of state for field: _outlineColour
\r
114 private boolean _has_outlineColour;
\r
117 * Field _displayBoxes
\r
119 private boolean _displayBoxes;
\r
122 * keeps track of state for field: _displayBoxes
\r
124 private boolean _has_displayBoxes;
\r
127 * Field _displayText
\r
129 private boolean _displayText;
\r
132 * keeps track of state for field: _displayText
\r
134 private boolean _has_displayText;
\r
137 * Field _colourText
\r
139 private boolean _colourText;
\r
142 * keeps track of state for field: _colourText
\r
144 private boolean _has_colourText;
\r
149 private java.util.Vector _seqList;
\r
151 //----------------/
\r
152 //- Constructors -/
\r
153 //----------------/
\r
156 _seqList = new Vector();
\r
158 //-- jalview.binding.JGroup()
\r
161 public void addSeq(int vSeq) throws java.lang.IndexOutOfBoundsException {
\r
162 _seqList.addElement(new java.lang.Integer(vSeq));
\r
164 //-- void addSeq(int)
\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
178 //-- void addSeq(int, int)
\r
181 * Method deleteColourText
\r
184 public void deleteColourText() {
\r
185 this._has_colourText = false;
\r
187 //-- void deleteColourText()
\r
190 * Method deleteConsThreshold
\r
193 public void deleteConsThreshold() {
\r
194 this._has_consThreshold = false;
\r
196 //-- void deleteConsThreshold()
\r
199 * Method deleteDisplayBoxes
\r
202 public void deleteDisplayBoxes() {
\r
203 this._has_displayBoxes = false;
\r
205 //-- void deleteDisplayBoxes()
\r
208 * Method deleteDisplayText
\r
211 public void deleteDisplayText() {
\r
212 this._has_displayText = false;
\r
214 //-- void deleteDisplayText()
\r
220 public void deleteEnd() {
\r
221 this._has_end = false;
\r
223 //-- void deleteEnd()
\r
226 * Method deleteOutlineColour
\r
229 public void deleteOutlineColour() {
\r
230 this._has_outlineColour = false;
\r
232 //-- void deleteOutlineColour()
\r
235 * Method deletePidThreshold
\r
238 public void deletePidThreshold() {
\r
239 this._has_pidThreshold = false;
\r
241 //-- void deletePidThreshold()
\r
244 * Method deleteStart
\r
247 public void deleteStart() {
\r
248 this._has_start = false;
\r
250 //-- void deleteStart()
\r
253 * Method enumerateSeq
\r
257 * @return Enumeration
\r
259 public java.util.Enumeration enumerateSeq() {
\r
260 return _seqList.elements();
\r
262 //-- java.util.Enumeration enumerateSeq()
\r
265 * Returns the value of field 'colour'.
\r
268 * @return the value of field 'colour'.
\r
270 public java.lang.String getColour() {
\r
271 return this._colour;
\r
273 //-- java.lang.String getColour()
\r
276 * Returns the value of field 'colourText'.
\r
279 * @return the value of field 'colourText'.
\r
281 public boolean getColourText() {
\r
282 return this._colourText;
\r
284 //-- boolean getColourText()
\r
287 * Returns the value of field 'consThreshold'.
\r
290 * @return the value of field 'consThreshold'.
\r
292 public int getConsThreshold() {
\r
293 return this._consThreshold;
\r
295 //-- int getConsThreshold()
\r
298 * Returns the value of field 'displayBoxes'.
\r
301 * @return the value of field 'displayBoxes'.
\r
303 public boolean getDisplayBoxes() {
\r
304 return this._displayBoxes;
\r
306 //-- boolean getDisplayBoxes()
\r
309 * Returns the value of field 'displayText'.
\r
312 * @return the value of field 'displayText'.
\r
314 public boolean getDisplayText() {
\r
315 return this._displayText;
\r
317 //-- boolean getDisplayText()
\r
320 * Returns the value of field 'end'.
\r
323 * @return the value of field 'end'.
\r
325 public int getEnd() {
\r
331 * Returns the value of field 'name'.
\r
334 * @return the value of field 'name'.
\r
336 public java.lang.String getName() {
\r
339 //-- java.lang.String getName()
\r
342 * Returns the value of field 'outlineColour'.
\r
345 * @return the value of field 'outlineColour'.
\r
347 public int getOutlineColour() {
\r
348 return this._outlineColour;
\r
350 //-- int getOutlineColour()
\r
353 * Returns the value of field 'pidThreshold'.
\r
356 * @return the value of field 'pidThreshold'.
\r
358 public int getPidThreshold() {
\r
359 return this._pidThreshold;
\r
361 //-- int getPidThreshold()
\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
377 return ((java.lang.Integer) _seqList.elementAt(index)).intValue();
\r
379 //-- int getSeq(int)
\r
388 public int[] getSeq() {
\r
389 int size = _seqList.size();
\r
390 int[] mArray = new int[size];
\r
392 for (int index = 0; index < size; index++) {
\r
393 mArray[index] = ((java.lang.Integer) _seqList.elementAt(index)).intValue();
\r
398 //-- int[] getSeq()
\r
401 * Method getSeqCount
\r
407 public int getSeqCount() {
\r
408 return _seqList.size();
\r
410 //-- int getSeqCount()
\r
413 * Returns the value of field 'start'.
\r
416 * @return the value of field 'start'.
\r
418 public int getStart() {
\r
419 return this._start;
\r
421 //-- int getStart()
\r
424 * Method hasColourText
\r
430 public boolean hasColourText() {
\r
431 return this._has_colourText;
\r
433 //-- boolean hasColourText()
\r
436 * Method hasConsThreshold
\r
442 public boolean hasConsThreshold() {
\r
443 return this._has_consThreshold;
\r
445 //-- boolean hasConsThreshold()
\r
448 * Method hasDisplayBoxes
\r
454 public boolean hasDisplayBoxes() {
\r
455 return this._has_displayBoxes;
\r
457 //-- boolean hasDisplayBoxes()
\r
460 * Method hasDisplayText
\r
466 public boolean hasDisplayText() {
\r
467 return this._has_displayText;
\r
469 //-- boolean hasDisplayText()
\r
478 public boolean hasEnd() {
\r
479 return this._has_end;
\r
481 //-- boolean hasEnd()
\r
484 * Method hasOutlineColour
\r
490 public boolean hasOutlineColour() {
\r
491 return this._has_outlineColour;
\r
493 //-- boolean hasOutlineColour()
\r
496 * Method hasPidThreshold
\r
502 public boolean hasPidThreshold() {
\r
503 return this._has_pidThreshold;
\r
505 //-- boolean hasPidThreshold()
\r
514 public boolean hasStart() {
\r
515 return this._has_start;
\r
517 //-- boolean hasStart()
\r
526 public boolean isValid() {
\r
529 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
535 //-- boolean isValid()
\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
549 //-- void marshal(java.io.Writer)
\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
563 //-- void marshal(org.xml.sax.ContentHandler)
\r
566 * Method removeAllSeq
\r
569 public void removeAllSeq() {
\r
570 _seqList.removeAllElements();
\r
572 //-- void removeAllSeq()
\r
582 public int removeSeq(int index) {
\r
583 java.lang.Object obj = _seqList.elementAt(index);
\r
584 _seqList.removeElementAt(index);
\r
586 return ((java.lang.Integer) obj).intValue();
\r
588 //-- int removeSeq(int)
\r
591 * Sets the value of field 'colour'.
\r
593 * @param colour the value of field 'colour'.
\r
595 public void setColour(java.lang.String colour) {
\r
596 this._colour = colour;
\r
598 //-- void setColour(java.lang.String)
\r
601 * Sets the value of field 'colourText'.
\r
603 * @param colourText the value of field 'colourText'.
\r
605 public void setColourText(boolean colourText) {
\r
606 this._colourText = colourText;
\r
607 this._has_colourText = true;
\r
609 //-- void setColourText(boolean)
\r
612 * Sets the value of field 'consThreshold'.
\r
614 * @param consThreshold the value of field 'consThreshold'.
\r
616 public void setConsThreshold(int consThreshold) {
\r
617 this._consThreshold = consThreshold;
\r
618 this._has_consThreshold = true;
\r
620 //-- void setConsThreshold(int)
\r
623 * Sets the value of field 'displayBoxes'.
\r
625 * @param displayBoxes the value of field 'displayBoxes'.
\r
627 public void setDisplayBoxes(boolean displayBoxes) {
\r
628 this._displayBoxes = displayBoxes;
\r
629 this._has_displayBoxes = true;
\r
631 //-- void setDisplayBoxes(boolean)
\r
634 * Sets the value of field 'displayText'.
\r
636 * @param displayText the value of field 'displayText'.
\r
638 public void setDisplayText(boolean displayText) {
\r
639 this._displayText = displayText;
\r
640 this._has_displayText = true;
\r
642 //-- void setDisplayText(boolean)
\r
645 * Sets the value of field 'end'.
\r
647 * @param end the value of field 'end'.
\r
649 public void setEnd(int end) {
\r
651 this._has_end = true;
\r
653 //-- void setEnd(int)
\r
656 * Sets the value of field 'name'.
\r
658 * @param name the value of field 'name'.
\r
660 public void setName(java.lang.String name) {
\r
663 //-- void setName(java.lang.String)
\r
666 * Sets the value of field 'outlineColour'.
\r
668 * @param outlineColour the value of field 'outlineColour'.
\r
670 public void setOutlineColour(int outlineColour) {
\r
671 this._outlineColour = outlineColour;
\r
672 this._has_outlineColour = true;
\r
674 //-- void setOutlineColour(int)
\r
677 * Sets the value of field 'pidThreshold'.
\r
679 * @param pidThreshold the value of field 'pidThreshold'.
\r
681 public void setPidThreshold(int pidThreshold) {
\r
682 this._pidThreshold = pidThreshold;
\r
683 this._has_pidThreshold = true;
\r
685 //-- void setPidThreshold(int)
\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
702 _seqList.setElementAt(new java.lang.Integer(vSeq), index);
\r
704 //-- void setSeq(int, int)
\r
713 public void setSeq(int[] seqArray) {
\r
715 _seqList.removeAllElements();
\r
717 for (int i = 0; i < seqArray.length; i++) {
\r
718 _seqList.addElement(new java.lang.Integer(seqArray[i]));
\r
721 //-- void setSeq(int)
\r
724 * Sets the value of field 'start'.
\r
726 * @param start the value of field 'start'.
\r
728 public void setStart(int start) {
\r
729 this._start = start;
\r
730 this._has_start = true;
\r
732 //-- void setStart(int)
\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
748 //-- java.lang.Object unmarshal(java.io.Reader)
\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
758 //-- void validate()
\r