2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import org.exolab.castor.xml.Marshaller;
\r
26 import org.exolab.castor.xml.Unmarshaller;
\r
29 * Class AnnotationElement.
\r
31 * @version $Revision$ $Date$
\r
33 public class AnnotationElement implements java.io.Serializable {
\r
36 //--------------------------/
\r
37 //- Class/Member Variables -/
\r
38 //--------------------------/
\r
43 private int _position;
\r
46 * keeps track of state for field: _position
\r
48 private boolean _has_position;
\r
53 private int _colour;
\r
56 * keeps track of state for field: _colour
\r
58 private boolean _has_colour;
\r
61 * Field _displayCharacter.
\r
63 private java.lang.String _displayCharacter;
\r
66 * Field _description.
\r
68 private java.lang.String _description;
\r
71 * Field _secondaryStructure.
\r
73 private java.lang.String _secondaryStructure;
\r
78 private float _value;
\r
81 * keeps track of state for field: _value
\r
83 private boolean _has_value;
\r
90 public AnnotationElement() {
\r
101 public void deleteColour(
\r
103 this._has_colour= false;
\r
108 public void deletePosition(
\r
110 this._has_position= false;
\r
115 public void deleteValue(
\r
117 this._has_value= false;
\r
121 * Returns the value of field 'colour'.
\r
123 * @return the value of field 'Colour'.
\r
125 public int getColour(
\r
127 return this._colour;
\r
131 * Returns the value of field 'description'.
\r
133 * @return the value of field 'Description'.
\r
135 public java.lang.String getDescription(
\r
137 return this._description;
\r
141 * Returns the value of field 'displayCharacter'.
\r
143 * @return the value of field 'DisplayCharacter'.
\r
145 public java.lang.String getDisplayCharacter(
\r
147 return this._displayCharacter;
\r
151 * Returns the value of field 'position'.
\r
153 * @return the value of field 'Position'.
\r
155 public int getPosition(
\r
157 return this._position;
\r
161 * Returns the value of field 'secondaryStructure'.
\r
163 * @return the value of field 'SecondaryStructure'.
\r
165 public java.lang.String getSecondaryStructure(
\r
167 return this._secondaryStructure;
\r
171 * Returns the value of field 'value'.
\r
173 * @return the value of field 'Value'.
\r
175 public float getValue(
\r
177 return this._value;
\r
181 * Method hasColour.
\r
183 * @return true if at least one Colour has been added
\r
185 public boolean hasColour(
\r
187 return this._has_colour;
\r
191 * Method hasPosition.
\r
193 * @return true if at least one Position has been added
\r
195 public boolean hasPosition(
\r
197 return this._has_position;
\r
203 * @return true if at least one Value has been added
\r
205 public boolean hasValue(
\r
207 return this._has_value;
\r
213 * @return true if this object is valid according to the schema
\r
215 public boolean isValid(
\r
219 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
229 * @throws org.exolab.castor.xml.MarshalException if object is
\r
230 * null or if any SAXException is thrown during marshaling
\r
231 * @throws org.exolab.castor.xml.ValidationException if this
\r
232 * object is an invalid instance according to the schema
\r
234 public void marshal(
\r
235 final java.io.Writer out)
\r
236 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
237 Marshaller.marshal(this, out);
\r
244 * @throws java.io.IOException if an IOException occurs during
\r
246 * @throws org.exolab.castor.xml.ValidationException if this
\r
247 * object is an invalid instance according to the schema
\r
248 * @throws org.exolab.castor.xml.MarshalException if object is
\r
249 * null or if any SAXException is thrown during marshaling
\r
251 public void marshal(
\r
252 final org.xml.sax.ContentHandler handler)
\r
253 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
254 Marshaller.marshal(this, handler);
\r
258 * Sets the value of field 'colour'.
\r
260 * @param colour the value of field 'colour'.
\r
262 public void setColour(
\r
263 final int colour) {
\r
264 this._colour = colour;
\r
265 this._has_colour = true;
\r
269 * Sets the value of field 'description'.
\r
271 * @param description the value of field 'description'.
\r
273 public void setDescription(
\r
274 final java.lang.String description) {
\r
275 this._description = description;
\r
279 * Sets the value of field 'displayCharacter'.
\r
281 * @param displayCharacter the value of field 'displayCharacter'
\r
283 public void setDisplayCharacter(
\r
284 final java.lang.String displayCharacter) {
\r
285 this._displayCharacter = displayCharacter;
\r
289 * Sets the value of field 'position'.
\r
291 * @param position the value of field 'position'.
\r
293 public void setPosition(
\r
294 final int position) {
\r
295 this._position = position;
\r
296 this._has_position = true;
\r
300 * Sets the value of field 'secondaryStructure'.
\r
302 * @param secondaryStructure the value of field
\r
303 * 'secondaryStructure'.
\r
305 public void setSecondaryStructure(
\r
306 final java.lang.String secondaryStructure) {
\r
307 this._secondaryStructure = secondaryStructure;
\r
311 * Sets the value of field 'value'.
\r
313 * @param value the value of field 'value'.
\r
315 public void setValue(
\r
316 final float value) {
\r
317 this._value = value;
\r
318 this._has_value = true;
\r
322 * Method unmarshal.
\r
325 * @throws org.exolab.castor.xml.MarshalException if object is
\r
326 * null or if any SAXException is thrown during marshaling
\r
327 * @throws org.exolab.castor.xml.ValidationException if this
\r
328 * object is an invalid instance according to the schema
\r
329 * @return the unmarshaled
\r
330 * jalview.schemabinding.version2.AnnotationElement
\r
332 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
\r
333 final java.io.Reader reader)
\r
334 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
335 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationElement.class, reader);
\r
341 * @throws org.exolab.castor.xml.ValidationException if this
\r
342 * object is an invalid instance according to the schema
\r
344 public void validate(
\r
346 throws org.exolab.castor.xml.ValidationException {
\r
347 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
348 validator.validate(this);
\r