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
5 * This file is part of Jalview.
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.
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.
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 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.binding;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import org.exolab.castor.xml.Marshaller;
32 import org.exolab.castor.xml.Unmarshaller;
37 * @version $Revision$ $Date$
39 public class JGroup implements java.io.Serializable {
42 //--------------------------/
43 //- Class/Member Variables -/
44 //--------------------------/
52 * keeps track of state for field: _start
54 private boolean _has_start;
62 * keeps track of state for field: _end
64 private boolean _has_end;
69 private java.lang.String _name;
74 private java.lang.String _colour;
77 * Field _consThreshold.
79 private int _consThreshold;
82 * keeps track of state for field: _consThreshold
84 private boolean _has_consThreshold;
87 * Field _pidThreshold.
89 private int _pidThreshold;
92 * keeps track of state for field: _pidThreshold
94 private boolean _has_pidThreshold;
97 * Field _outlineColour.
99 private int _outlineColour;
102 * keeps track of state for field: _outlineColour
104 private boolean _has_outlineColour;
107 * Field _displayBoxes.
109 private boolean _displayBoxes;
112 * keeps track of state for field: _displayBoxes
114 private boolean _has_displayBoxes;
117 * Field _displayText.
119 private boolean _displayText;
122 * keeps track of state for field: _displayText
124 private boolean _has_displayText;
129 private boolean _colourText;
132 * keeps track of state for field: _colourText
134 private boolean _has_colourText;
139 private java.util.Vector _seqList;
148 this._seqList = new java.util.Vector();
160 * @throws java.lang.IndexOutOfBoundsException if the index
161 * given is outside the bounds of the collection
165 throws java.lang.IndexOutOfBoundsException {
166 this._seqList.addElement(new java.lang.Integer(vSeq));
174 * @throws java.lang.IndexOutOfBoundsException if the index
175 * given is outside the bounds of the collection
180 throws java.lang.IndexOutOfBoundsException {
181 this._seqList.add(index, new java.lang.Integer(vSeq));
186 public void deleteColourText(
188 this._has_colourText= false;
193 public void deleteConsThreshold(
195 this._has_consThreshold= false;
200 public void deleteDisplayBoxes(
202 this._has_displayBoxes= false;
207 public void deleteDisplayText(
209 this._has_displayText= false;
214 public void deleteEnd(
216 this._has_end= false;
221 public void deleteOutlineColour(
223 this._has_outlineColour= false;
228 public void deletePidThreshold(
230 this._has_pidThreshold= false;
235 public void deleteStart(
237 this._has_start= false;
241 * Method enumerateSeq.
243 * @return an Enumeration over all int elements
245 public java.util.Enumeration enumerateSeq(
247 return this._seqList.elements();
251 * Returns the value of field 'colour'.
253 * @return the value of field 'Colour'.
255 public java.lang.String getColour(
261 * Returns the value of field 'colourText'.
263 * @return the value of field 'ColourText'.
265 public boolean getColourText(
267 return this._colourText;
271 * Returns the value of field 'consThreshold'.
273 * @return the value of field 'ConsThreshold'.
275 public int getConsThreshold(
277 return this._consThreshold;
281 * Returns the value of field 'displayBoxes'.
283 * @return the value of field 'DisplayBoxes'.
285 public boolean getDisplayBoxes(
287 return this._displayBoxes;
291 * Returns the value of field 'displayText'.
293 * @return the value of field 'DisplayText'.
295 public boolean getDisplayText(
297 return this._displayText;
301 * Returns the value of field 'end'.
303 * @return the value of field 'End'.
311 * Returns the value of field 'name'.
313 * @return the value of field 'Name'.
315 public java.lang.String getName(
321 * Returns the value of field 'outlineColour'.
323 * @return the value of field 'OutlineColour'.
325 public int getOutlineColour(
327 return this._outlineColour;
331 * Returns the value of field 'pidThreshold'.
333 * @return the value of field 'PidThreshold'.
335 public int getPidThreshold(
337 return this._pidThreshold;
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
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) + "]");
356 return ((java.lang.Integer) _seqList.get(index)).intValue();
360 * Method getSeq.Returns the contents of the collection in an
363 * @return this collection as an Array
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();
377 * Method getSeqCount.
379 * @return the size of this collection
381 public int getSeqCount(
383 return this._seqList.size();
387 * Returns the value of field 'start'.
389 * @return the value of field 'Start'.
397 * Method hasColourText.
399 * @return true if at least one ColourText has been added
401 public boolean hasColourText(
403 return this._has_colourText;
407 * Method hasConsThreshold.
409 * @return true if at least one ConsThreshold has been added
411 public boolean hasConsThreshold(
413 return this._has_consThreshold;
417 * Method hasDisplayBoxes.
419 * @return true if at least one DisplayBoxes has been added
421 public boolean hasDisplayBoxes(
423 return this._has_displayBoxes;
427 * Method hasDisplayText.
429 * @return true if at least one DisplayText has been added
431 public boolean hasDisplayText(
433 return this._has_displayText;
439 * @return true if at least one End has been added
441 public boolean hasEnd(
443 return this._has_end;
447 * Method hasOutlineColour.
449 * @return true if at least one OutlineColour has been added
451 public boolean hasOutlineColour(
453 return this._has_outlineColour;
457 * Method hasPidThreshold.
459 * @return true if at least one PidThreshold has been added
461 public boolean hasPidThreshold(
463 return this._has_pidThreshold;
469 * @return true if at least one Start has been added
471 public boolean hasStart(
473 return this._has_start;
477 * Returns the value of field 'colourText'.
479 * @return the value of field 'ColourText'.
481 public boolean isColourText(
483 return this._colourText;
487 * Returns the value of field 'displayBoxes'.
489 * @return the value of field 'DisplayBoxes'.
491 public boolean isDisplayBoxes(
493 return this._displayBoxes;
497 * Returns the value of field 'displayText'.
499 * @return the value of field 'DisplayText'.
501 public boolean isDisplayText(
503 return this._displayText;
509 * @return true if this object is valid according to the schema
511 public boolean isValid(
515 } catch (org.exolab.castor.xml.ValidationException vex) {
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
531 final java.io.Writer out)
532 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
533 Marshaller.marshal(this, out);
540 * @throws java.io.IOException if an IOException occurs during
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
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);
555 public void removeAllSeq(
557 this._seqList.clear();
564 * @return true if the object was removed from the collection.
566 public boolean removeSeq(
568 boolean removed = _seqList.remove(new java.lang.Integer(vSeq));
573 * Method removeSeqAt.
576 * @return the element removed from the collection
578 public int removeSeqAt(
580 java.lang.Object obj = this._seqList.remove(index);
581 return ((java.lang.Integer) obj).intValue();
585 * Sets the value of field 'colour'.
587 * @param colour the value of field 'colour'.
589 public void setColour(
590 final java.lang.String colour) {
591 this._colour = colour;
595 * Sets the value of field 'colourText'.
597 * @param colourText the value of field 'colourText'.
599 public void setColourText(
600 final boolean colourText) {
601 this._colourText = colourText;
602 this._has_colourText = true;
606 * Sets the value of field 'consThreshold'.
608 * @param consThreshold the value of field 'consThreshold'.
610 public void setConsThreshold(
611 final int consThreshold) {
612 this._consThreshold = consThreshold;
613 this._has_consThreshold = true;
617 * Sets the value of field 'displayBoxes'.
619 * @param displayBoxes the value of field 'displayBoxes'.
621 public void setDisplayBoxes(
622 final boolean displayBoxes) {
623 this._displayBoxes = displayBoxes;
624 this._has_displayBoxes = true;
628 * Sets the value of field 'displayText'.
630 * @param displayText the value of field 'displayText'.
632 public void setDisplayText(
633 final boolean displayText) {
634 this._displayText = displayText;
635 this._has_displayText = true;
639 * Sets the value of field 'end'.
641 * @param end the value of field 'end'.
646 this._has_end = true;
650 * Sets the value of field 'name'.
652 * @param name the value of field 'name'.
655 final java.lang.String name) {
660 * Sets the value of field 'outlineColour'.
662 * @param outlineColour the value of field 'outlineColour'.
664 public void setOutlineColour(
665 final int outlineColour) {
666 this._outlineColour = outlineColour;
667 this._has_outlineColour = true;
671 * Sets the value of field 'pidThreshold'.
673 * @param pidThreshold the value of field 'pidThreshold'.
675 public void setPidThreshold(
676 final int pidThreshold) {
677 this._pidThreshold = pidThreshold;
678 this._has_pidThreshold = true;
686 * @throws java.lang.IndexOutOfBoundsException if the index
687 * given is outside the bounds of the collection
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) + "]");
698 this._seqList.set(index, new java.lang.Integer(vSeq));
707 final int[] vSeqArray) {
711 for (int i = 0; i < vSeqArray.length; i++) {
712 this._seqList.add(new java.lang.Integer(vSeqArray[i]));
717 * Sets the value of field 'start'.
719 * @param start the value of field 'start'.
721 public void setStart(
724 this._has_start = true;
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
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);
746 * @throws org.exolab.castor.xml.ValidationException if this
747 * object is an invalid instance according to the schema
749 public void validate(
751 throws org.exolab.castor.xml.ValidationException {
752 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
753 validator.validate(this);