2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
\r
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
\r
5 * This file is part of Jalview.
\r
7 * Jalview is free software: you can redistribute it and/or
\r
8 * modify it under the terms of the GNU General Public License
\r
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
\r
11 * Jalview is distributed in the hope that it will be useful, but
\r
12 * WITHOUT ANY WARRANTY; without even the implied warranty
\r
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
\r
14 * PURPOSE. See the GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
\r
18 package jalview.schemabinding.version2;
\r
20 //---------------------------------/
\r
21 //- Imported classes and packages -/
\r
22 //---------------------------------/
\r
24 import org.exolab.castor.xml.Marshaller;
\r
25 import org.exolab.castor.xml.Unmarshaller;
\r
28 * Class AnnotationElement.
\r
30 * @version $Revision$ $Date$
\r
32 public class AnnotationElement implements java.io.Serializable
\r
35 // --------------------------/
\r
36 // - Class/Member Variables -/
\r
37 // --------------------------/
\r
42 private int _position;
\r
45 * keeps track of state for field: _position
\r
47 private boolean _has_position;
\r
52 private int _colour;
\r
55 * keeps track of state for field: _colour
\r
57 private boolean _has_colour;
\r
60 * Field _displayCharacter.
\r
62 private java.lang.String _displayCharacter;
\r
65 * Field _description.
\r
67 private java.lang.String _description;
\r
70 * Field _secondaryStructure.
\r
72 private java.lang.String _secondaryStructure;
\r
77 private float _value;
\r
80 * keeps track of state for field: _value
\r
82 private boolean _has_value;
\r
84 // ----------------/
\r
85 // - Constructors -/
\r
86 // ----------------/
\r
88 public AnnotationElement()
\r
99 public void deleteColour()
\r
101 this._has_colour = false;
\r
106 public void deletePosition()
\r
108 this._has_position = false;
\r
113 public void deleteValue()
\r
115 this._has_value = false;
\r
119 * Returns the value of field 'colour'.
\r
121 * @return the value of field 'Colour'.
\r
123 public int getColour()
\r
125 return this._colour;
\r
129 * Returns the value of field 'description'.
\r
131 * @return the value of field 'Description'.
\r
133 public java.lang.String getDescription()
\r
135 return this._description;
\r
139 * Returns the value of field 'displayCharacter'.
\r
141 * @return the value of field 'DisplayCharacter'.
\r
143 public java.lang.String getDisplayCharacter()
\r
145 return this._displayCharacter;
\r
149 * Returns the value of field 'position'.
\r
151 * @return the value of field 'Position'.
\r
153 public int getPosition()
\r
155 return this._position;
\r
159 * Returns the value of field 'secondaryStructure'.
\r
161 * @return the value of field 'SecondaryStructure'.
\r
163 public java.lang.String getSecondaryStructure()
\r
165 return this._secondaryStructure;
\r
169 * Returns the value of field 'value'.
\r
171 * @return the value of field 'Value'.
\r
173 public float getValue()
\r
175 return this._value;
\r
179 * Method hasColour.
\r
181 * @return true if at least one Colour has been added
\r
183 public boolean hasColour()
\r
185 return this._has_colour;
\r
189 * Method hasPosition.
\r
191 * @return true if at least one Position has been added
\r
193 public boolean hasPosition()
\r
195 return this._has_position;
\r
201 * @return true if at least one Value has been added
\r
203 public boolean hasValue()
\r
205 return this._has_value;
\r
211 * @return true if this object is valid according to the schema
\r
213 public boolean isValid()
\r
218 } catch (org.exolab.castor.xml.ValidationException vex)
\r
229 * @throws org.exolab.castor.xml.MarshalException
\r
230 * if object is null or if any SAXException is thrown during
\r
232 * @throws org.exolab.castor.xml.ValidationException
\r
233 * if this object is an invalid instance according to the schema
\r
235 public void marshal(final java.io.Writer out)
\r
236 throws org.exolab.castor.xml.MarshalException,
\r
237 org.exolab.castor.xml.ValidationException
\r
239 Marshaller.marshal(this, out);
\r
246 * @throws java.io.IOException
\r
247 * if an IOException occurs during marshaling
\r
248 * @throws org.exolab.castor.xml.ValidationException
\r
249 * if this object is an invalid instance according to the schema
\r
250 * @throws org.exolab.castor.xml.MarshalException
\r
251 * if object is null or if any SAXException is thrown during
\r
254 public void marshal(final org.xml.sax.ContentHandler handler)
\r
255 throws java.io.IOException,
\r
256 org.exolab.castor.xml.MarshalException,
\r
257 org.exolab.castor.xml.ValidationException
\r
259 Marshaller.marshal(this, handler);
\r
263 * Sets the value of field 'colour'.
\r
266 * the value of field 'colour'.
\r
268 public void setColour(final int colour)
\r
270 this._colour = colour;
\r
271 this._has_colour = true;
\r
275 * Sets the value of field 'description'.
\r
277 * @param description
\r
278 * the value of field 'description'.
\r
280 public void setDescription(final java.lang.String description)
\r
282 this._description = description;
\r
286 * Sets the value of field 'displayCharacter'.
\r
288 * @param displayCharacter
\r
289 * the value of field 'displayCharacter'
\r
291 public void setDisplayCharacter(final java.lang.String displayCharacter)
\r
293 this._displayCharacter = displayCharacter;
\r
297 * Sets the value of field 'position'.
\r
300 * the value of field 'position'.
\r
302 public void setPosition(final int position)
\r
304 this._position = position;
\r
305 this._has_position = true;
\r
309 * Sets the value of field 'secondaryStructure'.
\r
311 * @param secondaryStructure
\r
312 * the value of field 'secondaryStructure'.
\r
314 public void setSecondaryStructure(
\r
315 final java.lang.String secondaryStructure)
\r
317 this._secondaryStructure = secondaryStructure;
\r
321 * Sets the value of field 'value'.
\r
324 * the value of field 'value'.
\r
326 public void setValue(final float value)
\r
328 this._value = value;
\r
329 this._has_value = true;
\r
333 * Method unmarshal.
\r
336 * @throws org.exolab.castor.xml.MarshalException
\r
337 * if object is null or if any SAXException is thrown during
\r
339 * @throws org.exolab.castor.xml.ValidationException
\r
340 * if this object is an invalid instance according to the schema
\r
341 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
\r
343 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
\r
344 final java.io.Reader reader)
\r
345 throws org.exolab.castor.xml.MarshalException,
\r
346 org.exolab.castor.xml.ValidationException
\r
348 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
\r
350 jalview.schemabinding.version2.AnnotationElement.class,
\r
357 * @throws org.exolab.castor.xml.ValidationException
\r
358 * if this object is an invalid instance according to the schema
\r
360 public void validate() throws org.exolab.castor.xml.ValidationException
\r
362 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
363 validator.validate(this);
\r