795318742e1b5e6098f45fdb60bb522cab595dc0
[jalview.git] / src / jalview / schemabinding / version2 / AnnotationElement.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $(date) 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 /*
22  * This class was automatically generated with 
23  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
24  * Schema.
25  * $Id$
26  */
27
28 package jalview.schemabinding.version2;
29
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
33
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
36
37 /**
38  * Class AnnotationElement.
39  * 
40  * @version $Revision$ $Date$
41  */
42 public class AnnotationElement implements java.io.Serializable
43 {
44
45   // --------------------------/
46   // - Class/Member Variables -/
47   // --------------------------/
48
49   /**
50    * Field _position.
51    */
52   private int _position;
53
54   /**
55    * keeps track of state for field: _position
56    */
57   private boolean _has_position;
58
59   /**
60    * Field _colour.
61    */
62   private int _colour;
63
64   /**
65    * keeps track of state for field: _colour
66    */
67   private boolean _has_colour;
68
69   /**
70    * Field _displayCharacter.
71    */
72   private java.lang.String _displayCharacter;
73
74   /**
75    * Field _description.
76    */
77   private java.lang.String _description;
78
79   /**
80    * Field _secondaryStructure.
81    */
82   private java.lang.String _secondaryStructure;
83
84   /**
85    * Field _value.
86    */
87   private float _value;
88
89   /**
90    * keeps track of state for field: _value
91    */
92   private boolean _has_value;
93
94   // ----------------/
95   // - Constructors -/
96   // ----------------/
97
98   public AnnotationElement()
99   {
100     super();
101   }
102
103   // -----------/
104   // - Methods -/
105   // -----------/
106
107   /**
108      */
109   public void deleteColour()
110   {
111     this._has_colour = false;
112   }
113
114   /**
115      */
116   public void deletePosition()
117   {
118     this._has_position = false;
119   }
120
121   /**
122      */
123   public void deleteValue()
124   {
125     this._has_value = false;
126   }
127
128   /**
129    * Returns the value of field 'colour'.
130    * 
131    * @return the value of field 'Colour'.
132    */
133   public int getColour()
134   {
135     return this._colour;
136   }
137
138   /**
139    * Returns the value of field 'description'.
140    * 
141    * @return the value of field 'Description'.
142    */
143   public java.lang.String getDescription()
144   {
145     return this._description;
146   }
147
148   /**
149    * Returns the value of field 'displayCharacter'.
150    * 
151    * @return the value of field 'DisplayCharacter'.
152    */
153   public java.lang.String getDisplayCharacter()
154   {
155     return this._displayCharacter;
156   }
157
158   /**
159    * Returns the value of field 'position'.
160    * 
161    * @return the value of field 'Position'.
162    */
163   public int getPosition()
164   {
165     return this._position;
166   }
167
168   /**
169    * Returns the value of field 'secondaryStructure'.
170    * 
171    * @return the value of field 'SecondaryStructure'.
172    */
173   public java.lang.String getSecondaryStructure()
174   {
175     return this._secondaryStructure;
176   }
177
178   /**
179    * Returns the value of field 'value'.
180    * 
181    * @return the value of field 'Value'.
182    */
183   public float getValue()
184   {
185     return this._value;
186   }
187
188   /**
189    * Method hasColour.
190    * 
191    * @return true if at least one Colour has been added
192    */
193   public boolean hasColour()
194   {
195     return this._has_colour;
196   }
197
198   /**
199    * Method hasPosition.
200    * 
201    * @return true if at least one Position has been added
202    */
203   public boolean hasPosition()
204   {
205     return this._has_position;
206   }
207
208   /**
209    * Method hasValue.
210    * 
211    * @return true if at least one Value has been added
212    */
213   public boolean hasValue()
214   {
215     return this._has_value;
216   }
217
218   /**
219    * Method isValid.
220    * 
221    * @return true if this object is valid according to the schema
222    */
223   public boolean isValid()
224   {
225     try
226     {
227       validate();
228     } catch (org.exolab.castor.xml.ValidationException vex)
229     {
230       return false;
231     }
232     return true;
233   }
234
235   /**
236    * 
237    * 
238    * @param out
239    * @throws org.exolab.castor.xml.MarshalException
240    *           if object is null or if any SAXException is thrown during
241    *           marshaling
242    * @throws org.exolab.castor.xml.ValidationException
243    *           if this object is an invalid instance according to the schema
244    */
245   public void marshal(final java.io.Writer out)
246           throws org.exolab.castor.xml.MarshalException,
247           org.exolab.castor.xml.ValidationException
248   {
249     Marshaller.marshal(this, out);
250   }
251
252   /**
253    * 
254    * 
255    * @param handler
256    * @throws java.io.IOException
257    *           if an IOException occurs during marshaling
258    * @throws org.exolab.castor.xml.ValidationException
259    *           if this object is an invalid instance according to the schema
260    * @throws org.exolab.castor.xml.MarshalException
261    *           if object is null or if any SAXException is thrown during
262    *           marshaling
263    */
264   public void marshal(final org.xml.sax.ContentHandler handler)
265           throws java.io.IOException,
266           org.exolab.castor.xml.MarshalException,
267           org.exolab.castor.xml.ValidationException
268   {
269     Marshaller.marshal(this, handler);
270   }
271
272   /**
273    * Sets the value of field 'colour'.
274    * 
275    * @param colour
276    *          the value of field 'colour'.
277    */
278   public void setColour(final int colour)
279   {
280     this._colour = colour;
281     this._has_colour = true;
282   }
283
284   /**
285    * Sets the value of field 'description'.
286    * 
287    * @param description
288    *          the value of field 'description'.
289    */
290   public void setDescription(final java.lang.String description)
291   {
292     this._description = description;
293   }
294
295   /**
296    * Sets the value of field 'displayCharacter'.
297    * 
298    * @param displayCharacter
299    *          the value of field 'displayCharacter'
300    */
301   public void setDisplayCharacter(final java.lang.String displayCharacter)
302   {
303     this._displayCharacter = displayCharacter;
304   }
305
306   /**
307    * Sets the value of field 'position'.
308    * 
309    * @param position
310    *          the value of field 'position'.
311    */
312   public void setPosition(final int position)
313   {
314     this._position = position;
315     this._has_position = true;
316   }
317
318   /**
319    * Sets the value of field 'secondaryStructure'.
320    * 
321    * @param secondaryStructure
322    *          the value of field 'secondaryStructure'.
323    */
324   public void setSecondaryStructure(
325           final java.lang.String secondaryStructure)
326   {
327     this._secondaryStructure = secondaryStructure;
328   }
329
330   /**
331    * Sets the value of field 'value'.
332    * 
333    * @param value
334    *          the value of field 'value'.
335    */
336   public void setValue(final float value)
337   {
338     this._value = value;
339     this._has_value = true;
340   }
341
342   /**
343    * Method unmarshal.
344    * 
345    * @param reader
346    * @throws org.exolab.castor.xml.MarshalException
347    *           if object is null or if any SAXException is thrown during
348    *           marshaling
349    * @throws org.exolab.castor.xml.ValidationException
350    *           if this object is an invalid instance according to the schema
351    * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
352    */
353   public static jalview.schemabinding.version2.AnnotationElement unmarshal(
354           final java.io.Reader reader)
355           throws org.exolab.castor.xml.MarshalException,
356           org.exolab.castor.xml.ValidationException
357   {
358     return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
359             .unmarshal(
360                     jalview.schemabinding.version2.AnnotationElement.class,
361                     reader);
362   }
363
364   /**
365    * 
366    * 
367    * @throws org.exolab.castor.xml.ValidationException
368    *           if this object is an invalid instance according to the schema
369    */
370   public void validate() throws org.exolab.castor.xml.ValidationException
371   {
372     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
373     validator.validate(this);
374   }
375
376 }