2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
\r
3 * Copyright (C) 2008 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
65 // ----------------/
\r
66 // - Constructors -/
\r
67 // ----------------/
\r
69 public ThresholdLine()
\r
80 public void deleteColour()
\r
82 this._has_colour = false;
\r
87 public void deleteValue()
\r
89 this._has_value = false;
\r
93 * Returns the value of field 'colour'.
\r
95 * @return the value of field 'Colour'.
\r
97 public int getColour()
\r
99 return this._colour;
\r
103 * Returns the value of field 'label'.
\r
105 * @return the value of field 'Label'.
\r
107 public java.lang.String getLabel()
\r
109 return this._label;
\r
113 * Returns the value of field 'value'.
\r
115 * @return the value of field 'Value'.
\r
117 public float getValue()
\r
119 return this._value;
\r
123 * Method hasColour.
\r
125 * @return true if at least one Colour has been added
\r
127 public boolean hasColour()
\r
129 return this._has_colour;
\r
135 * @return true if at least one Value has been added
\r
137 public boolean hasValue()
\r
139 return this._has_value;
\r
145 * @return true if this object is valid according to the schema
\r
147 public boolean isValid()
\r
152 } catch (org.exolab.castor.xml.ValidationException vex)
\r
163 * @throws org.exolab.castor.xml.MarshalException
\r
164 * if object is null or if any SAXException is thrown during
\r
166 * @throws org.exolab.castor.xml.ValidationException
\r
167 * if this object is an invalid instance according to the
\r
170 public void marshal(final java.io.Writer out)
\r
171 throws org.exolab.castor.xml.MarshalException,
\r
172 org.exolab.castor.xml.ValidationException
\r
174 Marshaller.marshal(this, out);
\r
181 * @throws java.io.IOException
\r
182 * if an IOException occurs during marshaling
\r
183 * @throws org.exolab.castor.xml.ValidationException
\r
184 * if this object is an invalid instance according to the
\r
186 * @throws org.exolab.castor.xml.MarshalException
\r
187 * if object is null or if any SAXException is thrown during
\r
190 public void marshal(final org.xml.sax.ContentHandler handler)
\r
191 throws java.io.IOException,
\r
192 org.exolab.castor.xml.MarshalException,
\r
193 org.exolab.castor.xml.ValidationException
\r
195 Marshaller.marshal(this, handler);
\r
199 * Sets the value of field 'colour'.
\r
202 * the value of field 'colour'.
\r
204 public void setColour(final int colour)
\r
206 this._colour = colour;
\r
207 this._has_colour = true;
\r
211 * Sets the value of field 'label'.
\r
214 * the value of field 'label'.
\r
216 public void setLabel(final java.lang.String label)
\r
218 this._label = label;
\r
222 * Sets the value of field 'value'.
\r
225 * the value of field 'value'.
\r
227 public void setValue(final float value)
\r
229 this._value = value;
\r
230 this._has_value = true;
\r
234 * Method unmarshal.
\r
237 * @throws org.exolab.castor.xml.MarshalException
\r
238 * if object is null or if any SAXException is thrown during
\r
240 * @throws org.exolab.castor.xml.ValidationException
\r
241 * if this object is an invalid instance according to the
\r
243 * @return the unmarshaled jalview.schemabinding.version2.ThresholdLine
\r
245 public static jalview.schemabinding.version2.ThresholdLine unmarshal(
\r
246 final java.io.Reader reader)
\r
247 throws org.exolab.castor.xml.MarshalException,
\r
248 org.exolab.castor.xml.ValidationException
\r
250 return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller
\r
251 .unmarshal(jalview.schemabinding.version2.ThresholdLine.class,
\r
258 * @throws org.exolab.castor.xml.ValidationException
\r
259 * if this object is an invalid instance according to the
\r
262 public void validate() throws org.exolab.castor.xml.ValidationException
\r
264 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
265 validator.validate(this);
\r