2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML
\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
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
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
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
27 package jalview.binding;
\r
29 //---------------------------------/
\r
30 //- Imported classes and packages -/
\r
31 //---------------------------------/
\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
48 * @version $Revision$ $Date$
\r
50 public class JGroup implements java.io.Serializable {
\r
53 //--------------------------/
\r
54 //- Class/Member Variables -/
\r
55 //--------------------------/
\r
63 * keeps track of state for field: _start
\r
65 private boolean _has_start;
\r
73 * keeps track of state for field: _end
\r
75 private boolean _has_end;
\r
80 private java.lang.String _name;
\r
85 private java.lang.String _colour;
\r
88 * Field _consThreshold
\r
90 private int _consThreshold;
\r
93 * keeps track of state for field: _consThreshold
\r
95 private boolean _has_consThreshold;
\r
98 * Field _pidThreshold
\r
100 private int _pidThreshold;
\r
103 * keeps track of state for field: _pidThreshold
\r
105 private boolean _has_pidThreshold;
\r
108 * Field _outlineColour
\r
110 private int _outlineColour;
\r
113 * keeps track of state for field: _outlineColour
\r
115 private boolean _has_outlineColour;
\r
118 * Field _displayBoxes
\r
120 private boolean _displayBoxes;
\r
123 * keeps track of state for field: _displayBoxes
\r
125 private boolean _has_displayBoxes;
\r
128 * Field _displayText
\r
130 private boolean _displayText;
\r
133 * keeps track of state for field: _displayText
\r
135 private boolean _has_displayText;
\r
138 * Field _colourText
\r
140 private boolean _colourText;
\r
143 * keeps track of state for field: _colourText
\r
145 private boolean _has_colourText;
\r
150 private java.util.Vector _seqList;
\r
153 //----------------/
\r
154 //- Constructors -/
\r
155 //----------------/
\r
159 _seqList = new Vector();
\r
160 } //-- jalview.binding.JGroup()
\r
174 public void addSeq(int vSeq)
\r
175 throws java.lang.IndexOutOfBoundsException
\r
177 _seqList.addElement(new java.lang.Integer(vSeq));
\r
178 } //-- void addSeq(int)
\r
188 public void addSeq(int index, int vSeq)
\r
189 throws java.lang.IndexOutOfBoundsException
\r
191 _seqList.insertElementAt(new java.lang.Integer(vSeq), index);
\r
192 } //-- void addSeq(int, int)
\r
195 * Method deleteColourText
\r
198 public void deleteColourText()
\r
200 this._has_colourText= false;
\r
201 } //-- void deleteColourText()
\r
204 * Method deleteConsThreshold
\r
207 public void deleteConsThreshold()
\r
209 this._has_consThreshold= false;
\r
210 } //-- void deleteConsThreshold()
\r
213 * Method deleteDisplayBoxes
\r
216 public void deleteDisplayBoxes()
\r
218 this._has_displayBoxes= false;
\r
219 } //-- void deleteDisplayBoxes()
\r
222 * Method deleteDisplayText
\r
225 public void deleteDisplayText()
\r
227 this._has_displayText= false;
\r
228 } //-- void deleteDisplayText()
\r
234 public void deleteEnd()
\r
236 this._has_end= false;
\r
237 } //-- void deleteEnd()
\r
240 * Method deleteOutlineColour
\r
243 public void deleteOutlineColour()
\r
245 this._has_outlineColour= false;
\r
246 } //-- void deleteOutlineColour()
\r
249 * Method deletePidThreshold
\r
252 public void deletePidThreshold()
\r
254 this._has_pidThreshold= false;
\r
255 } //-- void deletePidThreshold()
\r
258 * Method deleteStart
\r
261 public void deleteStart()
\r
263 this._has_start= false;
\r
264 } //-- void deleteStart()
\r
267 * Method enumerateSeq
\r
271 * @return Enumeration
\r
273 public java.util.Enumeration enumerateSeq()
\r
275 return _seqList.elements();
\r
276 } //-- java.util.Enumeration enumerateSeq()
\r
279 * Returns the value of field 'colour'.
\r
282 * @return the value of field 'colour'.
\r
284 public java.lang.String getColour()
\r
286 return this._colour;
\r
287 } //-- java.lang.String getColour()
\r
290 * Returns the value of field 'colourText'.
\r
293 * @return the value of field 'colourText'.
\r
295 public boolean getColourText()
\r
297 return this._colourText;
\r
298 } //-- boolean getColourText()
\r
301 * Returns the value of field 'consThreshold'.
\r
304 * @return the value of field 'consThreshold'.
\r
306 public int getConsThreshold()
\r
308 return this._consThreshold;
\r
309 } //-- int getConsThreshold()
\r
312 * Returns the value of field 'displayBoxes'.
\r
315 * @return the value of field 'displayBoxes'.
\r
317 public boolean getDisplayBoxes()
\r
319 return this._displayBoxes;
\r
320 } //-- boolean getDisplayBoxes()
\r
323 * Returns the value of field 'displayText'.
\r
326 * @return the value of field 'displayText'.
\r
328 public boolean getDisplayText()
\r
330 return this._displayText;
\r
331 } //-- boolean getDisplayText()
\r
334 * Returns the value of field 'end'.
\r
337 * @return the value of field 'end'.
\r
339 public int getEnd()
\r
342 } //-- int getEnd()
\r
345 * Returns the value of field 'name'.
\r
348 * @return the value of field 'name'.
\r
350 public java.lang.String getName()
\r
353 } //-- java.lang.String getName()
\r
356 * Returns the value of field 'outlineColour'.
\r
359 * @return the value of field 'outlineColour'.
\r
361 public int getOutlineColour()
\r
363 return this._outlineColour;
\r
364 } //-- int getOutlineColour()
\r
367 * Returns the value of field 'pidThreshold'.
\r
370 * @return the value of field 'pidThreshold'.
\r
372 public int getPidThreshold()
\r
374 return this._pidThreshold;
\r
375 } //-- int getPidThreshold()
\r
385 public int getSeq(int index)
\r
386 throws java.lang.IndexOutOfBoundsException
\r
388 //-- check bounds for index
\r
389 if ((index < 0) || (index > _seqList.size())) {
\r
390 throw new IndexOutOfBoundsException();
\r
393 return ((java.lang.Integer)_seqList.elementAt(index)).intValue();
\r
394 } //-- int getSeq(int)
\r
403 public int[] getSeq()
\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
411 } //-- int[] getSeq()
\r
414 * Method getSeqCount
\r
420 public int getSeqCount()
\r
422 return _seqList.size();
\r
423 } //-- int getSeqCount()
\r
426 * Returns the value of field 'start'.
\r
429 * @return the value of field 'start'.
\r
431 public int getStart()
\r
433 return this._start;
\r
434 } //-- int getStart()
\r
437 * Method hasColourText
\r
443 public boolean hasColourText()
\r
445 return this._has_colourText;
\r
446 } //-- boolean hasColourText()
\r
449 * Method hasConsThreshold
\r
455 public boolean hasConsThreshold()
\r
457 return this._has_consThreshold;
\r
458 } //-- boolean hasConsThreshold()
\r
461 * Method hasDisplayBoxes
\r
467 public boolean hasDisplayBoxes()
\r
469 return this._has_displayBoxes;
\r
470 } //-- boolean hasDisplayBoxes()
\r
473 * Method hasDisplayText
\r
479 public boolean hasDisplayText()
\r
481 return this._has_displayText;
\r
482 } //-- boolean hasDisplayText()
\r
491 public boolean hasEnd()
\r
493 return this._has_end;
\r
494 } //-- boolean hasEnd()
\r
497 * Method hasOutlineColour
\r
503 public boolean hasOutlineColour()
\r
505 return this._has_outlineColour;
\r
506 } //-- boolean hasOutlineColour()
\r
509 * Method hasPidThreshold
\r
515 public boolean hasPidThreshold()
\r
517 return this._has_pidThreshold;
\r
518 } //-- boolean hasPidThreshold()
\r
527 public boolean hasStart()
\r
529 return this._has_start;
\r
530 } //-- boolean hasStart()
\r
539 public boolean isValid()
\r
544 catch (org.exolab.castor.xml.ValidationException vex) {
\r
548 } //-- boolean isValid()
\r
557 public void marshal(java.io.Writer out)
\r
558 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
\r
561 Marshaller.marshal(this, out);
\r
562 } //-- void marshal(java.io.Writer)
\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
575 Marshaller.marshal(this, handler);
\r
576 } //-- void marshal(org.xml.sax.ContentHandler)
\r
579 * Method removeAllSeq
\r
582 public void removeAllSeq()
\r
584 _seqList.removeAllElements();
\r
585 } //-- void removeAllSeq()
\r
595 public int removeSeq(int index)
\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
603 * Sets the value of field 'colour'.
\r
605 * @param colour the value of field 'colour'.
\r
607 public void setColour(java.lang.String colour)
\r
609 this._colour = colour;
\r
610 } //-- void setColour(java.lang.String)
\r
613 * Sets the value of field 'colourText'.
\r
615 * @param colourText the value of field 'colourText'.
\r
617 public void setColourText(boolean colourText)
\r
619 this._colourText = colourText;
\r
620 this._has_colourText = true;
\r
621 } //-- void setColourText(boolean)
\r
624 * Sets the value of field 'consThreshold'.
\r
626 * @param consThreshold the value of field 'consThreshold'.
\r
628 public void setConsThreshold(int consThreshold)
\r
630 this._consThreshold = consThreshold;
\r
631 this._has_consThreshold = true;
\r
632 } //-- void setConsThreshold(int)
\r
635 * Sets the value of field 'displayBoxes'.
\r
637 * @param displayBoxes the value of field 'displayBoxes'.
\r
639 public void setDisplayBoxes(boolean displayBoxes)
\r
641 this._displayBoxes = displayBoxes;
\r
642 this._has_displayBoxes = true;
\r
643 } //-- void setDisplayBoxes(boolean)
\r
646 * Sets the value of field 'displayText'.
\r
648 * @param displayText the value of field 'displayText'.
\r
650 public void setDisplayText(boolean displayText)
\r
652 this._displayText = displayText;
\r
653 this._has_displayText = true;
\r
654 } //-- void setDisplayText(boolean)
\r
657 * Sets the value of field 'end'.
\r
659 * @param end the value of field 'end'.
\r
661 public void setEnd(int end)
\r
664 this._has_end = true;
\r
665 } //-- void setEnd(int)
\r
668 * Sets the value of field 'name'.
\r
670 * @param name the value of field 'name'.
\r
672 public void setName(java.lang.String name)
\r
675 } //-- void setName(java.lang.String)
\r
678 * Sets the value of field 'outlineColour'.
\r
680 * @param outlineColour the value of field 'outlineColour'.
\r
682 public void setOutlineColour(int outlineColour)
\r
684 this._outlineColour = outlineColour;
\r
685 this._has_outlineColour = true;
\r
686 } //-- void setOutlineColour(int)
\r
689 * Sets the value of field 'pidThreshold'.
\r
691 * @param pidThreshold the value of field 'pidThreshold'.
\r
693 public void setPidThreshold(int pidThreshold)
\r
695 this._pidThreshold = pidThreshold;
\r
696 this._has_pidThreshold = true;
\r
697 } //-- void setPidThreshold(int)
\r
707 public void setSeq(int index, int vSeq)
\r
708 throws java.lang.IndexOutOfBoundsException
\r
710 //-- check bounds for index
\r
711 if ((index < 0) || (index > _seqList.size())) {
\r
712 throw new IndexOutOfBoundsException();
\r
714 _seqList.setElementAt(new java.lang.Integer(vSeq), index);
\r
715 } //-- void setSeq(int, int)
\r
724 public void setSeq(int[] seqArray)
\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
731 } //-- void setSeq(int)
\r
734 * Sets the value of field 'start'.
\r
736 * @param start the value of field 'start'.
\r
738 public void setStart(int start)
\r
740 this._start = start;
\r
741 this._has_start = true;
\r
742 } //-- void setStart(int)
\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
755 return (jalview.binding.JGroup) Unmarshaller.unmarshal(jalview.binding.JGroup.class, reader);
\r
756 } //-- java.lang.Object unmarshal(java.io.Reader)
\r
762 public void validate()
\r
763 throws org.exolab.castor.xml.ValidationException
\r
765 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
766 validator.validate(this);
\r
767 } //-- void validate()
\r