1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) The Jalview Authors
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.binding;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
40 * @version $Revision$ $Date$
42 public class JGroup implements java.io.Serializable
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
55 * keeps track of state for field: _start
57 private boolean _has_start;
65 * keeps track of state for field: _end
67 private boolean _has_end;
72 private java.lang.String _name;
77 private java.lang.String _colour;
80 * Field _consThreshold.
82 private int _consThreshold;
85 * keeps track of state for field: _consThreshold
87 private boolean _has_consThreshold;
90 * Field _pidThreshold.
92 private int _pidThreshold;
95 * keeps track of state for field: _pidThreshold
97 private boolean _has_pidThreshold;
100 * Field _outlineColour.
102 private int _outlineColour;
105 * keeps track of state for field: _outlineColour
107 private boolean _has_outlineColour;
110 * Field _displayBoxes.
112 private boolean _displayBoxes;
115 * keeps track of state for field: _displayBoxes
117 private boolean _has_displayBoxes;
120 * Field _displayText.
122 private boolean _displayText;
125 * keeps track of state for field: _displayText
127 private boolean _has_displayText;
132 private boolean _colourText;
135 * keeps track of state for field: _colourText
137 private boolean _has_colourText;
142 private java.util.Vector _seqList;
151 this._seqList = new java.util.Vector();
162 * @throws java.lang.IndexOutOfBoundsException
163 * if the index given is outside the bounds of the collection
165 public void addSeq(final int vSeq)
166 throws java.lang.IndexOutOfBoundsException
168 this._seqList.addElement(new java.lang.Integer(vSeq));
176 * @throws java.lang.IndexOutOfBoundsException
177 * if the index given is outside the bounds of the collection
179 public void addSeq(final int index, final int vSeq)
180 throws java.lang.IndexOutOfBoundsException
182 this._seqList.add(index, new java.lang.Integer(vSeq));
187 public void deleteColourText()
189 this._has_colourText = false;
194 public void deleteConsThreshold()
196 this._has_consThreshold = false;
201 public void deleteDisplayBoxes()
203 this._has_displayBoxes = false;
208 public void deleteDisplayText()
210 this._has_displayText = false;
215 public void deleteEnd()
217 this._has_end = false;
222 public void deleteOutlineColour()
224 this._has_outlineColour = false;
229 public void deletePidThreshold()
231 this._has_pidThreshold = false;
236 public void deleteStart()
238 this._has_start = false;
242 * Method enumerateSeq.
244 * @return an Enumeration over all int elements
246 public java.util.Enumeration enumerateSeq()
248 return this._seqList.elements();
252 * Returns the value of field 'colour'.
254 * @return the value of field 'Colour'.
256 public java.lang.String getColour()
262 * Returns the value of field 'colourText'.
264 * @return the value of field 'ColourText'.
266 public boolean getColourText()
268 return this._colourText;
272 * Returns the value of field 'consThreshold'.
274 * @return the value of field 'ConsThreshold'.
276 public int getConsThreshold()
278 return this._consThreshold;
282 * Returns the value of field 'displayBoxes'.
284 * @return the value of field 'DisplayBoxes'.
286 public boolean getDisplayBoxes()
288 return this._displayBoxes;
292 * Returns the value of field 'displayText'.
294 * @return the value of field 'DisplayText'.
296 public boolean getDisplayText()
298 return this._displayText;
302 * Returns the value of field 'end'.
304 * @return the value of field 'End'.
312 * Returns the value of field 'name'.
314 * @return the value of field 'Name'.
316 public java.lang.String getName()
322 * Returns the value of field 'outlineColour'.
324 * @return the value of field 'OutlineColour'.
326 public int getOutlineColour()
328 return this._outlineColour;
332 * Returns the value of field 'pidThreshold'.
334 * @return the value of field 'PidThreshold'.
336 public int getPidThreshold()
338 return this._pidThreshold;
345 * @throws java.lang.IndexOutOfBoundsException
346 * if the index given is outside the bounds of the collection
347 * @return the value of the int at the given index
349 public int getSeq(final int index)
350 throws java.lang.IndexOutOfBoundsException
352 // check bounds for index
353 if (index < 0 || index >= this._seqList.size())
355 throw new IndexOutOfBoundsException("getSeq: Index value '" + index
356 + "' not in range [0.." + (this._seqList.size() - 1) + "]");
359 return ((java.lang.Integer) _seqList.get(index)).intValue();
363 * Method getSeq.Returns the contents of the collection in an Array.
365 * @return this collection as an Array
367 public int[] getSeq()
369 int size = this._seqList.size();
370 int[] array = new int[size];
371 java.util.Iterator iter = _seqList.iterator();
372 for (int index = 0; index < size; index++)
374 array[index] = ((java.lang.Integer) iter.next()).intValue();
380 * Method getSeqCount.
382 * @return the size of this collection
384 public int getSeqCount()
386 return this._seqList.size();
390 * Returns the value of field 'start'.
392 * @return the value of field 'Start'.
394 public int getStart()
400 * Method hasColourText.
402 * @return true if at least one ColourText has been added
404 public boolean hasColourText()
406 return this._has_colourText;
410 * Method hasConsThreshold.
412 * @return true if at least one ConsThreshold has been added
414 public boolean hasConsThreshold()
416 return this._has_consThreshold;
420 * Method hasDisplayBoxes.
422 * @return true if at least one DisplayBoxes has been added
424 public boolean hasDisplayBoxes()
426 return this._has_displayBoxes;
430 * Method hasDisplayText.
432 * @return true if at least one DisplayText has been added
434 public boolean hasDisplayText()
436 return this._has_displayText;
442 * @return true if at least one End has been added
444 public boolean hasEnd()
446 return this._has_end;
450 * Method hasOutlineColour.
452 * @return true if at least one OutlineColour has been added
454 public boolean hasOutlineColour()
456 return this._has_outlineColour;
460 * Method hasPidThreshold.
462 * @return true if at least one PidThreshold has been added
464 public boolean hasPidThreshold()
466 return this._has_pidThreshold;
472 * @return true if at least one Start has been added
474 public boolean hasStart()
476 return this._has_start;
480 * Returns the value of field 'colourText'.
482 * @return the value of field 'ColourText'.
484 public boolean isColourText()
486 return this._colourText;
490 * Returns the value of field 'displayBoxes'.
492 * @return the value of field 'DisplayBoxes'.
494 public boolean isDisplayBoxes()
496 return this._displayBoxes;
500 * Returns the value of field 'displayText'.
502 * @return the value of field 'DisplayText'.
504 public boolean isDisplayText()
506 return this._displayText;
512 * @return true if this object is valid according to the schema
514 public boolean isValid()
519 } catch (org.exolab.castor.xml.ValidationException vex)
530 * @throws org.exolab.castor.xml.MarshalException
531 * if object is null or if any SAXException is thrown during
533 * @throws org.exolab.castor.xml.ValidationException
534 * if this object is an invalid instance according to the schema
536 public void marshal(final java.io.Writer out)
537 throws org.exolab.castor.xml.MarshalException,
538 org.exolab.castor.xml.ValidationException
540 Marshaller.marshal(this, out);
547 * @throws java.io.IOException
548 * if an IOException occurs during marshaling
549 * @throws org.exolab.castor.xml.ValidationException
550 * if this object is an invalid instance according to the schema
551 * @throws org.exolab.castor.xml.MarshalException
552 * if object is null or if any SAXException is thrown during
555 public void marshal(final org.xml.sax.ContentHandler handler)
556 throws java.io.IOException,
557 org.exolab.castor.xml.MarshalException,
558 org.exolab.castor.xml.ValidationException
560 Marshaller.marshal(this, handler);
565 public void removeAllSeq()
567 this._seqList.clear();
574 * @return true if the object was removed from the collection.
576 public boolean removeSeq(final int vSeq)
578 boolean removed = _seqList.remove(new java.lang.Integer(vSeq));
583 * Method removeSeqAt.
586 * @return the element removed from the collection
588 public int removeSeqAt(final int index)
590 java.lang.Object obj = this._seqList.remove(index);
591 return ((java.lang.Integer) obj).intValue();
595 * Sets the value of field 'colour'.
598 * the value of field 'colour'.
600 public void setColour(final java.lang.String colour)
602 this._colour = colour;
606 * Sets the value of field 'colourText'.
609 * the value of field 'colourText'.
611 public void setColourText(final boolean colourText)
613 this._colourText = colourText;
614 this._has_colourText = true;
618 * Sets the value of field 'consThreshold'.
620 * @param consThreshold
621 * the value of field 'consThreshold'.
623 public void setConsThreshold(final int consThreshold)
625 this._consThreshold = consThreshold;
626 this._has_consThreshold = true;
630 * Sets the value of field 'displayBoxes'.
632 * @param displayBoxes
633 * the value of field 'displayBoxes'.
635 public void setDisplayBoxes(final boolean displayBoxes)
637 this._displayBoxes = displayBoxes;
638 this._has_displayBoxes = true;
642 * Sets the value of field 'displayText'.
645 * the value of field 'displayText'.
647 public void setDisplayText(final boolean displayText)
649 this._displayText = displayText;
650 this._has_displayText = true;
654 * Sets the value of field 'end'.
657 * the value of field 'end'.
659 public void setEnd(final int end)
662 this._has_end = true;
666 * Sets the value of field 'name'.
669 * the value of field 'name'.
671 public void setName(final java.lang.String name)
677 * Sets the value of field 'outlineColour'.
679 * @param outlineColour
680 * the value of field 'outlineColour'.
682 public void setOutlineColour(final int outlineColour)
684 this._outlineColour = outlineColour;
685 this._has_outlineColour = true;
689 * Sets the value of field 'pidThreshold'.
691 * @param pidThreshold
692 * the value of field 'pidThreshold'.
694 public void setPidThreshold(final int pidThreshold)
696 this._pidThreshold = pidThreshold;
697 this._has_pidThreshold = true;
705 * @throws java.lang.IndexOutOfBoundsException
706 * if the index given is outside the bounds of the collection
708 public void setSeq(final int index, final int vSeq)
709 throws java.lang.IndexOutOfBoundsException
711 // check bounds for index
712 if (index < 0 || index >= this._seqList.size())
714 throw new IndexOutOfBoundsException("setSeq: Index value '" + index
715 + "' not in range [0.." + (this._seqList.size() - 1) + "]");
718 this._seqList.set(index, new java.lang.Integer(vSeq));
726 public void setSeq(final int[] vSeqArray)
731 for (int i = 0; i < vSeqArray.length; i++)
733 this._seqList.add(new java.lang.Integer(vSeqArray[i]));
738 * Sets the value of field 'start'.
741 * the value of field 'start'.
743 public void setStart(final int start)
746 this._has_start = true;
753 * @throws org.exolab.castor.xml.MarshalException
754 * if object is null or if any SAXException is thrown during
756 * @throws org.exolab.castor.xml.ValidationException
757 * if this object is an invalid instance according to the schema
758 * @return the unmarshaled jalview.binding.JGroup
760 public static jalview.binding.JGroup unmarshal(
761 final java.io.Reader reader)
762 throws org.exolab.castor.xml.MarshalException,
763 org.exolab.castor.xml.ValidationException
765 return (jalview.binding.JGroup) Unmarshaller
766 .unmarshal(jalview.binding.JGroup.class, reader);
772 * @throws org.exolab.castor.xml.ValidationException
773 * if this object is an invalid instance according to the schema
775 public void validate() throws org.exolab.castor.xml.ValidationException
777 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
778 validator.validate(this);