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