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