GPL license added
[jalview.git] / src / jalview / binding / AnnotationElement.java
1 /*\r
2  * This class was automatically generated with\r
3  * <a href="http://www.castor.org">Castor 0.9.6</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 /*\r
9 * Jalview - A Sequence Alignment Editor and Viewer\r
10 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
11 *\r
12 * This program is free software; you can redistribute it and/or\r
13 * modify it under the terms of the GNU General Public License\r
14 * as published by the Free Software Foundation; either version 2\r
15 * of the License, or (at your option) any later version.\r
16 *\r
17 * This program is distributed in the hope that it will be useful,\r
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
20 * GNU General Public License for more details.\r
21 *\r
22 * You should have received a copy of the GNU General Public License\r
23 * along with this program; if not, write to the Free Software\r
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
25 */\r
26 \r
27 package jalview.binding;\r
28 \r
29   //---------------------------------/\r
30  //- Imported classes and packages -/\r
31 //---------------------------------/\r
32 \r
33 import java.io.IOException;\r
34 import java.io.Reader;\r
35 import java.io.Serializable;\r
36 import java.io.Writer;\r
37 import org.exolab.castor.xml.MarshalException;\r
38 import org.exolab.castor.xml.Marshaller;\r
39 import org.exolab.castor.xml.Unmarshaller;\r
40 import org.exolab.castor.xml.ValidationException;\r
41 import org.xml.sax.ContentHandler;\r
42 \r
43 /**\r
44  * Class AnnotationElement.\r
45  *\r
46  * @version $Revision$ $Date$\r
47  */\r
48 public class AnnotationElement implements java.io.Serializable {\r
49 \r
50 \r
51       //--------------------------/\r
52      //- Class/Member Variables -/\r
53     //--------------------------/\r
54 \r
55     /**\r
56      * Field _position\r
57      */\r
58     private int _position;\r
59 \r
60     /**\r
61      * keeps track of state for field: _position\r
62      */\r
63     private boolean _has_position;\r
64 \r
65     /**\r
66      * Field _displayCharacter\r
67      */\r
68     private java.lang.String _displayCharacter;\r
69 \r
70     /**\r
71      * Field _description\r
72      */\r
73     private java.lang.String _description;\r
74 \r
75     /**\r
76      * Field _secondaryStructure\r
77      */\r
78     private java.lang.String _secondaryStructure;\r
79 \r
80     /**\r
81      * Field _value\r
82      */\r
83     private float _value;\r
84 \r
85     /**\r
86      * keeps track of state for field: _value\r
87      */\r
88     private boolean _has_value;\r
89 \r
90 \r
91       //----------------/\r
92      //- Constructors -/\r
93     //----------------/\r
94 \r
95     public AnnotationElement() {\r
96         super();\r
97     } //-- jalview.binding.AnnotationElement()\r
98 \r
99 \r
100       //-----------/\r
101      //- Methods -/\r
102     //-----------/\r
103 \r
104     /**\r
105      * Method deletePosition\r
106      *\r
107      */\r
108     public void deletePosition()\r
109     {\r
110         this._has_position= false;\r
111     } //-- void deletePosition()\r
112 \r
113     /**\r
114      * Method deleteValue\r
115      *\r
116      */\r
117     public void deleteValue()\r
118     {\r
119         this._has_value= false;\r
120     } //-- void deleteValue()\r
121 \r
122     /**\r
123      * Returns the value of field 'description'.\r
124      *\r
125      * @return String\r
126      * @return the value of field 'description'.\r
127      */\r
128     public java.lang.String getDescription()\r
129     {\r
130         return this._description;\r
131     } //-- java.lang.String getDescription()\r
132 \r
133     /**\r
134      * Returns the value of field 'displayCharacter'.\r
135      *\r
136      * @return String\r
137      * @return the value of field 'displayCharacter'.\r
138      */\r
139     public java.lang.String getDisplayCharacter()\r
140     {\r
141         return this._displayCharacter;\r
142     } //-- java.lang.String getDisplayCharacter()\r
143 \r
144     /**\r
145      * Returns the value of field 'position'.\r
146      *\r
147      * @return int\r
148      * @return the value of field 'position'.\r
149      */\r
150     public int getPosition()\r
151     {\r
152         return this._position;\r
153     } //-- int getPosition()\r
154 \r
155     /**\r
156      * Returns the value of field 'secondaryStructure'.\r
157      *\r
158      * @return String\r
159      * @return the value of field 'secondaryStructure'.\r
160      */\r
161     public java.lang.String getSecondaryStructure()\r
162     {\r
163         return this._secondaryStructure;\r
164     } //-- java.lang.String getSecondaryStructure()\r
165 \r
166     /**\r
167      * Returns the value of field 'value'.\r
168      *\r
169      * @return float\r
170      * @return the value of field 'value'.\r
171      */\r
172     public float getValue()\r
173     {\r
174         return this._value;\r
175     } //-- float getValue()\r
176 \r
177     /**\r
178      * Method hasPosition\r
179      *\r
180      *\r
181      *\r
182      * @return boolean\r
183      */\r
184     public boolean hasPosition()\r
185     {\r
186         return this._has_position;\r
187     } //-- boolean hasPosition()\r
188 \r
189     /**\r
190      * Method hasValue\r
191      *\r
192      *\r
193      *\r
194      * @return boolean\r
195      */\r
196     public boolean hasValue()\r
197     {\r
198         return this._has_value;\r
199     } //-- boolean hasValue()\r
200 \r
201     /**\r
202      * Method isValid\r
203      *\r
204      *\r
205      *\r
206      * @return boolean\r
207      */\r
208     public boolean isValid()\r
209     {\r
210         try {\r
211             validate();\r
212         }\r
213         catch (org.exolab.castor.xml.ValidationException vex) {\r
214             return false;\r
215         }\r
216         return true;\r
217     } //-- boolean isValid()\r
218 \r
219     /**\r
220      * Method marshal\r
221      *\r
222      *\r
223      *\r
224      * @param out\r
225      */\r
226     public void marshal(java.io.Writer out)\r
227         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
228     {\r
229 \r
230         Marshaller.marshal(this, out);\r
231     } //-- void marshal(java.io.Writer)\r
232 \r
233     /**\r
234      * Method marshal\r
235      *\r
236      *\r
237      *\r
238      * @param handler\r
239      */\r
240     public void marshal(org.xml.sax.ContentHandler handler)\r
241         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
242     {\r
243 \r
244         Marshaller.marshal(this, handler);\r
245     } //-- void marshal(org.xml.sax.ContentHandler)\r
246 \r
247     /**\r
248      * Sets the value of field 'description'.\r
249      *\r
250      * @param description the value of field 'description'.\r
251      */\r
252     public void setDescription(java.lang.String description)\r
253     {\r
254         this._description = description;\r
255     } //-- void setDescription(java.lang.String)\r
256 \r
257     /**\r
258      * Sets the value of field 'displayCharacter'.\r
259      *\r
260      * @param displayCharacter the value of field 'displayCharacter'\r
261      */\r
262     public void setDisplayCharacter(java.lang.String displayCharacter)\r
263     {\r
264         this._displayCharacter = displayCharacter;\r
265     } //-- void setDisplayCharacter(java.lang.String)\r
266 \r
267     /**\r
268      * Sets the value of field 'position'.\r
269      *\r
270      * @param position the value of field 'position'.\r
271      */\r
272     public void setPosition(int position)\r
273     {\r
274         this._position = position;\r
275         this._has_position = true;\r
276     } //-- void setPosition(int)\r
277 \r
278     /**\r
279      * Sets the value of field 'secondaryStructure'.\r
280      *\r
281      * @param secondaryStructure the value of field\r
282      * 'secondaryStructure'.\r
283      */\r
284     public void setSecondaryStructure(java.lang.String secondaryStructure)\r
285     {\r
286         this._secondaryStructure = secondaryStructure;\r
287     } //-- void setSecondaryStructure(java.lang.String)\r
288 \r
289     /**\r
290      * Sets the value of field 'value'.\r
291      *\r
292      * @param value the value of field 'value'.\r
293      */\r
294     public void setValue(float value)\r
295     {\r
296         this._value = value;\r
297         this._has_value = true;\r
298     } //-- void setValue(float)\r
299 \r
300     /**\r
301      * Method unmarshal\r
302      *\r
303      *\r
304      *\r
305      * @param reader\r
306      * @return Object\r
307      */\r
308     public static java.lang.Object unmarshal(java.io.Reader reader)\r
309         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
310     {\r
311         return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(jalview.binding.AnnotationElement.class, reader);\r
312     } //-- java.lang.Object unmarshal(java.io.Reader)\r
313 \r
314     /**\r
315      * Method validate\r
316      *\r
317      */\r
318     public void validate()\r
319         throws org.exolab.castor.xml.ValidationException\r
320     {\r
321         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
322         validator.validate(this);\r
323     } //-- void validate()\r
324 \r
325 }\r