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