2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
28 * Class ThresholdLine.
\r
30 * @version $Revision$ $Date$
\r
32 public class ThresholdLine implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
42 private java.lang.String _label;
\r
47 private float _value;
\r
50 * keeps track of state for field: _value
\r
52 private boolean _has_value;
\r
57 private int _colour;
\r
60 * keeps track of state for field: _colour
\r
62 private boolean _has_colour;
\r
64 // ----------------/
\r
65 // - Constructors -/
\r
66 // ----------------/
\r
68 public ThresholdLine()
\r
79 public void deleteColour()
\r
81 this._has_colour = false;
\r
86 public void deleteValue()
\r
88 this._has_value = false;
\r
92 * Returns the value of field 'colour'.
\r
94 * @return the value of field 'Colour'.
\r
96 public int getColour()
\r
98 return this._colour;
\r
102 * Returns the value of field 'label'.
\r
104 * @return the value of field 'Label'.
\r
106 public java.lang.String getLabel()
\r
108 return this._label;
\r
112 * Returns the value of field 'value'.
\r
114 * @return the value of field 'Value'.
\r
116 public float getValue()
\r
118 return this._value;
\r
122 * Method hasColour.
\r
124 * @return true if at least one Colour has been added
\r
126 public boolean hasColour()
\r
128 return this._has_colour;
\r
134 * @return true if at least one Value has been added
\r
136 public boolean hasValue()
\r
138 return this._has_value;
\r
144 * @return true if this object is valid according to the schema
\r
146 public boolean isValid()
\r
151 } catch (org.exolab.castor.xml.ValidationException vex)
\r
162 * @throws org.exolab.castor.xml.MarshalException
\r
163 * if object is null or if any SAXException is thrown during
\r
165 * @throws org.exolab.castor.xml.ValidationException
\r
166 * if this object is an invalid instance according to the schema
\r
168 public void marshal(final java.io.Writer out)
\r
169 throws org.exolab.castor.xml.MarshalException,
\r
170 org.exolab.castor.xml.ValidationException
\r
172 Marshaller.marshal(this, out);
\r
179 * @throws java.io.IOException
\r
180 * if an IOException occurs during marshaling
\r
181 * @throws org.exolab.castor.xml.ValidationException
\r
182 * if this object is an invalid instance according to the schema
\r
183 * @throws org.exolab.castor.xml.MarshalException
\r
184 * if object is null or if any SAXException is thrown during
\r
187 public void marshal(final org.xml.sax.ContentHandler handler)
\r
188 throws java.io.IOException,
\r
189 org.exolab.castor.xml.MarshalException,
\r
190 org.exolab.castor.xml.ValidationException
\r
192 Marshaller.marshal(this, handler);
\r
196 * Sets the value of field 'colour'.
\r
199 * the value of field 'colour'.
\r
201 public void setColour(final int colour)
\r
203 this._colour = colour;
\r
204 this._has_colour = true;
\r
208 * Sets the value of field 'label'.
\r
211 * the value of field 'label'.
\r
213 public void setLabel(final java.lang.String label)
\r
215 this._label = label;
\r
219 * Sets the value of field 'value'.
\r
222 * the value of field 'value'.
\r
224 public void setValue(final float value)
\r
226 this._value = value;
\r
227 this._has_value = true;
\r
231 * Method unmarshal.
\r
234 * @throws org.exolab.castor.xml.MarshalException
\r
235 * if object is null or if any SAXException is thrown during
\r
237 * @throws org.exolab.castor.xml.ValidationException
\r
238 * if this object is an invalid instance according to the schema
\r
239 * @return the unmarshaled jalview.schemabinding.version2.ThresholdLine
\r
241 public static jalview.schemabinding.version2.ThresholdLine unmarshal(
\r
242 final java.io.Reader reader)
\r
243 throws org.exolab.castor.xml.MarshalException,
\r
244 org.exolab.castor.xml.ValidationException
\r
246 return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller
\r
247 .unmarshal(jalview.schemabinding.version2.ThresholdLine.class,
\r
254 * @throws org.exolab.castor.xml.ValidationException
\r
255 * if this object is an invalid instance according to the schema
\r
257 public void validate() throws org.exolab.castor.xml.ValidationException
\r
259 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
260 validator.validate(this);
\r