f5dab4d4d2a6e51f7e57b974c42601d6b944adce
[jalview.git] / src / jalview / schemabinding / version2 / ThresholdLine.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
11  *  
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.
16  * 
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  */
21 package jalview.schemabinding.version2;
22
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
26
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
29
30 /**
31  * Class ThresholdLine.
32  * 
33  * @version $Revision$ $Date$
34  */
35 public class ThresholdLine implements java.io.Serializable
36 {
37
38   // --------------------------/
39   // - Class/Member Variables -/
40   // --------------------------/
41
42   /**
43    * Field _label.
44    */
45   private java.lang.String _label;
46
47   /**
48    * Field _value.
49    */
50   private float _value;
51
52   /**
53    * keeps track of state for field: _value
54    */
55   private boolean _has_value;
56
57   /**
58    * Field _colour.
59    */
60   private int _colour;
61
62   /**
63    * keeps track of state for field: _colour
64    */
65   private boolean _has_colour;
66
67   // ----------------/
68   // - Constructors -/
69   // ----------------/
70
71   public ThresholdLine()
72   {
73     super();
74   }
75
76   // -----------/
77   // - Methods -/
78   // -----------/
79
80   /**
81      */
82   public void deleteColour()
83   {
84     this._has_colour = false;
85   }
86
87   /**
88      */
89   public void deleteValue()
90   {
91     this._has_value = false;
92   }
93
94   /**
95    * Returns the value of field 'colour'.
96    * 
97    * @return the value of field 'Colour'.
98    */
99   public int getColour()
100   {
101     return this._colour;
102   }
103
104   /**
105    * Returns the value of field 'label'.
106    * 
107    * @return the value of field 'Label'.
108    */
109   public java.lang.String getLabel()
110   {
111     return this._label;
112   }
113
114   /**
115    * Returns the value of field 'value'.
116    * 
117    * @return the value of field 'Value'.
118    */
119   public float getValue()
120   {
121     return this._value;
122   }
123
124   /**
125    * Method hasColour.
126    * 
127    * @return true if at least one Colour has been added
128    */
129   public boolean hasColour()
130   {
131     return this._has_colour;
132   }
133
134   /**
135    * Method hasValue.
136    * 
137    * @return true if at least one Value has been added
138    */
139   public boolean hasValue()
140   {
141     return this._has_value;
142   }
143
144   /**
145    * Method isValid.
146    * 
147    * @return true if this object is valid according to the schema
148    */
149   public boolean isValid()
150   {
151     try
152     {
153       validate();
154     } catch (org.exolab.castor.xml.ValidationException vex)
155     {
156       return false;
157     }
158     return true;
159   }
160
161   /**
162    * 
163    * 
164    * @param out
165    * @throws org.exolab.castor.xml.MarshalException
166    *           if object is null or if any SAXException is thrown during
167    *           marshaling
168    * @throws org.exolab.castor.xml.ValidationException
169    *           if this object is an invalid instance according to the schema
170    */
171   public void marshal(final java.io.Writer out)
172           throws org.exolab.castor.xml.MarshalException,
173           org.exolab.castor.xml.ValidationException
174   {
175     Marshaller.marshal(this, out);
176   }
177
178   /**
179    * 
180    * 
181    * @param handler
182    * @throws java.io.IOException
183    *           if an IOException occurs during marshaling
184    * @throws org.exolab.castor.xml.ValidationException
185    *           if this object is an invalid instance according to the schema
186    * @throws org.exolab.castor.xml.MarshalException
187    *           if object is null or if any SAXException is thrown during
188    *           marshaling
189    */
190   public void marshal(final org.xml.sax.ContentHandler handler)
191           throws java.io.IOException,
192           org.exolab.castor.xml.MarshalException,
193           org.exolab.castor.xml.ValidationException
194   {
195     Marshaller.marshal(this, handler);
196   }
197
198   /**
199    * Sets the value of field 'colour'.
200    * 
201    * @param colour
202    *          the value of field 'colour'.
203    */
204   public void setColour(final int colour)
205   {
206     this._colour = colour;
207     this._has_colour = true;
208   }
209
210   /**
211    * Sets the value of field 'label'.
212    * 
213    * @param label
214    *          the value of field 'label'.
215    */
216   public void setLabel(final java.lang.String label)
217   {
218     this._label = label;
219   }
220
221   /**
222    * Sets the value of field 'value'.
223    * 
224    * @param value
225    *          the value of field 'value'.
226    */
227   public void setValue(final float value)
228   {
229     this._value = value;
230     this._has_value = true;
231   }
232
233   /**
234    * Method unmarshal.
235    * 
236    * @param reader
237    * @throws org.exolab.castor.xml.MarshalException
238    *           if object is null or if any SAXException is thrown during
239    *           marshaling
240    * @throws org.exolab.castor.xml.ValidationException
241    *           if this object is an invalid instance according to the schema
242    * @return the unmarshaled jalview.schemabinding.version2.ThresholdLine
243    */
244   public static jalview.schemabinding.version2.ThresholdLine unmarshal(
245           final java.io.Reader reader)
246           throws org.exolab.castor.xml.MarshalException,
247           org.exolab.castor.xml.ValidationException
248   {
249     return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller
250             .unmarshal(jalview.schemabinding.version2.ThresholdLine.class,
251                     reader);
252   }
253
254   /**
255    * 
256    * 
257    * @throws org.exolab.castor.xml.ValidationException
258    *           if this object is an invalid instance according to the schema
259    */
260   public void validate() throws org.exolab.castor.xml.ValidationException
261   {
262     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
263     validator.validate(this);
264   }
265
266 }