2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
29 * Class ThresholdLine.
\r
31 * @version $Revision$ $Date$
\r
33 public class ThresholdLine implements java.io.Serializable {
\r
36 //--------------------------/
\r
37 //- Class/Member Variables -/
\r
38 //--------------------------/
\r
43 private java.lang.String _label;
\r
48 private float _value;
\r
51 * keeps track of state for field: _value
\r
53 private boolean _has_value;
\r
58 private int _colour;
\r
61 * keeps track of state for field: _colour
\r
63 private boolean _has_colour;
\r
70 public ThresholdLine() {
\r
81 public void deleteColour(
\r
83 this._has_colour= false;
\r
88 public void deleteValue(
\r
90 this._has_value= false;
\r
94 * Returns the value of field 'colour'.
\r
96 * @return the value of field 'Colour'.
\r
98 public int getColour(
\r
100 return this._colour;
\r
104 * Returns the value of field 'label'.
\r
106 * @return the value of field 'Label'.
\r
108 public java.lang.String getLabel(
\r
110 return this._label;
\r
114 * Returns the value of field 'value'.
\r
116 * @return the value of field 'Value'.
\r
118 public float getValue(
\r
120 return this._value;
\r
124 * Method hasColour.
\r
126 * @return true if at least one Colour has been added
\r
128 public boolean hasColour(
\r
130 return this._has_colour;
\r
136 * @return true if at least one Value has been added
\r
138 public boolean hasValue(
\r
140 return this._has_value;
\r
146 * @return true if this object is valid according to the schema
\r
148 public boolean isValid(
\r
152 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
162 * @throws org.exolab.castor.xml.MarshalException if object is
\r
163 * null or if any SAXException is thrown during marshaling
\r
164 * @throws org.exolab.castor.xml.ValidationException if this
\r
165 * object is an invalid instance according to the schema
\r
167 public void marshal(
\r
168 final java.io.Writer out)
\r
169 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
170 Marshaller.marshal(this, out);
\r
177 * @throws java.io.IOException if an IOException occurs during
\r
179 * @throws org.exolab.castor.xml.ValidationException if this
\r
180 * object is an invalid instance according to the schema
\r
181 * @throws org.exolab.castor.xml.MarshalException if object is
\r
182 * null or if any SAXException is thrown during marshaling
\r
184 public void marshal(
\r
185 final org.xml.sax.ContentHandler handler)
\r
186 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
187 Marshaller.marshal(this, handler);
\r
191 * Sets the value of field 'colour'.
\r
193 * @param colour the value of field 'colour'.
\r
195 public void setColour(
\r
196 final int colour) {
\r
197 this._colour = colour;
\r
198 this._has_colour = true;
\r
202 * Sets the value of field 'label'.
\r
204 * @param label the value of field 'label'.
\r
206 public void setLabel(
\r
207 final java.lang.String label) {
\r
208 this._label = label;
\r
212 * Sets the value of field 'value'.
\r
214 * @param value the value of field 'value'.
\r
216 public void setValue(
\r
217 final float value) {
\r
218 this._value = value;
\r
219 this._has_value = true;
\r
223 * Method unmarshal.
\r
226 * @throws org.exolab.castor.xml.MarshalException if object is
\r
227 * null or if any SAXException is thrown during marshaling
\r
228 * @throws org.exolab.castor.xml.ValidationException if this
\r
229 * object is an invalid instance according to the schema
\r
230 * @return the unmarshaled
\r
231 * jalview.schemabinding.version2.ThresholdLine
\r
233 public static jalview.schemabinding.version2.ThresholdLine unmarshal(
\r
234 final java.io.Reader reader)
\r
235 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
236 return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller.unmarshal(jalview.schemabinding.version2.ThresholdLine.class, reader);
\r
242 * @throws org.exolab.castor.xml.ValidationException if this
\r
243 * object is an invalid instance according to the schema
\r
245 public void validate(
\r
247 throws org.exolab.castor.xml.ValidationException {
\r
248 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
249 validator.validate(this);
\r