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