Copyright test
[jalview.git] / src / jalview / binding / 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.binding;
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 _displayCharacter.
61    */
62   private java.lang.String _displayCharacter;
63
64   /**
65    * Field _description.
66    */
67   private java.lang.String _description;
68
69   /**
70    * Field _secondaryStructure.
71    */
72   private java.lang.String _secondaryStructure;
73
74   /**
75    * Field _value.
76    */
77   private float _value;
78
79   /**
80    * keeps track of state for field: _value
81    */
82   private boolean _has_value;
83
84   // ----------------/
85   // - Constructors -/
86   // ----------------/
87
88   public AnnotationElement()
89   {
90     super();
91   }
92
93   // -----------/
94   // - Methods -/
95   // -----------/
96
97   /**
98      */
99   public void deletePosition()
100   {
101     this._has_position = false;
102   }
103
104   /**
105      */
106   public void deleteValue()
107   {
108     this._has_value = false;
109   }
110
111   /**
112    * Returns the value of field 'description'.
113    * 
114    * @return the value of field 'Description'.
115    */
116   public java.lang.String getDescription()
117   {
118     return this._description;
119   }
120
121   /**
122    * Returns the value of field 'displayCharacter'.
123    * 
124    * @return the value of field 'DisplayCharacter'.
125    */
126   public java.lang.String getDisplayCharacter()
127   {
128     return this._displayCharacter;
129   }
130
131   /**
132    * Returns the value of field 'position'.
133    * 
134    * @return the value of field 'Position'.
135    */
136   public int getPosition()
137   {
138     return this._position;
139   }
140
141   /**
142    * Returns the value of field 'secondaryStructure'.
143    * 
144    * @return the value of field 'SecondaryStructure'.
145    */
146   public java.lang.String getSecondaryStructure()
147   {
148     return this._secondaryStructure;
149   }
150
151   /**
152    * Returns the value of field 'value'.
153    * 
154    * @return the value of field 'Value'.
155    */
156   public float getValue()
157   {
158     return this._value;
159   }
160
161   /**
162    * Method hasPosition.
163    * 
164    * @return true if at least one Position has been added
165    */
166   public boolean hasPosition()
167   {
168     return this._has_position;
169   }
170
171   /**
172    * Method hasValue.
173    * 
174    * @return true if at least one Value has been added
175    */
176   public boolean hasValue()
177   {
178     return this._has_value;
179   }
180
181   /**
182    * Method isValid.
183    * 
184    * @return true if this object is valid according to the schema
185    */
186   public boolean isValid()
187   {
188     try
189     {
190       validate();
191     } catch (org.exolab.castor.xml.ValidationException vex)
192     {
193       return false;
194     }
195     return true;
196   }
197
198   /**
199    * 
200    * 
201    * @param out
202    * @throws org.exolab.castor.xml.MarshalException
203    *           if object is null or if any SAXException is thrown during
204    *           marshaling
205    * @throws org.exolab.castor.xml.ValidationException
206    *           if this object is an invalid instance according to the schema
207    */
208   public void marshal(final java.io.Writer out)
209           throws org.exolab.castor.xml.MarshalException,
210           org.exolab.castor.xml.ValidationException
211   {
212     Marshaller.marshal(this, out);
213   }
214
215   /**
216    * 
217    * 
218    * @param handler
219    * @throws java.io.IOException
220    *           if an IOException occurs during marshaling
221    * @throws org.exolab.castor.xml.ValidationException
222    *           if this object is an invalid instance according to the schema
223    * @throws org.exolab.castor.xml.MarshalException
224    *           if object is null or if any SAXException is thrown during
225    *           marshaling
226    */
227   public void marshal(final org.xml.sax.ContentHandler handler)
228           throws java.io.IOException,
229           org.exolab.castor.xml.MarshalException,
230           org.exolab.castor.xml.ValidationException
231   {
232     Marshaller.marshal(this, handler);
233   }
234
235   /**
236    * Sets the value of field 'description'.
237    * 
238    * @param description
239    *          the value of field 'description'.
240    */
241   public void setDescription(final java.lang.String description)
242   {
243     this._description = description;
244   }
245
246   /**
247    * Sets the value of field 'displayCharacter'.
248    * 
249    * @param displayCharacter
250    *          the value of field 'displayCharacter'
251    */
252   public void setDisplayCharacter(final java.lang.String displayCharacter)
253   {
254     this._displayCharacter = displayCharacter;
255   }
256
257   /**
258    * Sets the value of field 'position'.
259    * 
260    * @param position
261    *          the value of field 'position'.
262    */
263   public void setPosition(final int position)
264   {
265     this._position = position;
266     this._has_position = true;
267   }
268
269   /**
270    * Sets the value of field 'secondaryStructure'.
271    * 
272    * @param secondaryStructure
273    *          the value of field 'secondaryStructure'.
274    */
275   public void setSecondaryStructure(
276           final java.lang.String secondaryStructure)
277   {
278     this._secondaryStructure = secondaryStructure;
279   }
280
281   /**
282    * Sets the value of field 'value'.
283    * 
284    * @param value
285    *          the value of field 'value'.
286    */
287   public void setValue(final float value)
288   {
289     this._value = value;
290     this._has_value = true;
291   }
292
293   /**
294    * Method unmarshal.
295    * 
296    * @param reader
297    * @throws org.exolab.castor.xml.MarshalException
298    *           if object is null or if any SAXException is thrown during
299    *           marshaling
300    * @throws org.exolab.castor.xml.ValidationException
301    *           if this object is an invalid instance according to the schema
302    * @return the unmarshaled jalview.binding.AnnotationElement
303    */
304   public static jalview.binding.AnnotationElement unmarshal(
305           final java.io.Reader reader)
306           throws org.exolab.castor.xml.MarshalException,
307           org.exolab.castor.xml.ValidationException
308   {
309     return (jalview.binding.AnnotationElement) Unmarshaller
310             .unmarshal(jalview.binding.AnnotationElement.class, reader);
311   }
312
313   /**
314    * 
315    * 
316    * @throws org.exolab.castor.xml.ValidationException
317    *           if this object is an invalid instance according to the schema
318    */
319   public void validate() throws org.exolab.castor.xml.ValidationException
320   {
321     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
322     validator.validate(this);
323   }
324
325 }