JAL-3120 preserve feature colour/mincolour/maxcolour while modifying,
[jalview.git] / src / jalview / schemabinding / version2 / AnnotationElement.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class AnnotationElement.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class AnnotationElement implements java.io.Serializable
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _position.
31    */
32   private int _position;
33
34   /**
35    * keeps track of state for field: _position
36    */
37   private boolean _has_position;
38
39   /**
40    * Field _colour.
41    */
42   private int _colour;
43
44   /**
45    * keeps track of state for field: _colour
46    */
47   private boolean _has_colour;
48
49   /**
50    * Field _displayCharacter.
51    */
52   private java.lang.String _displayCharacter;
53
54   /**
55    * Field _description.
56    */
57   private java.lang.String _description;
58
59   /**
60    * Field _secondaryStructure.
61    */
62   private java.lang.String _secondaryStructure;
63
64   /**
65    * Field _value.
66    */
67   private float _value;
68
69   /**
70    * keeps track of state for field: _value
71    */
72   private boolean _has_value;
73
74   // ----------------/
75   // - Constructors -/
76   // ----------------/
77
78   public AnnotationElement()
79   {
80     super();
81   }
82
83   // -----------/
84   // - Methods -/
85   // -----------/
86
87   /**
88      */
89   public void deleteColour()
90   {
91     this._has_colour = false;
92   }
93
94   /**
95      */
96   public void deletePosition()
97   {
98     this._has_position = false;
99   }
100
101   /**
102      */
103   public void deleteValue()
104   {
105     this._has_value = false;
106   }
107
108   /**
109    * Returns the value of field 'colour'.
110    * 
111    * @return the value of field 'Colour'.
112    */
113   public int getColour()
114   {
115     return this._colour;
116   }
117
118   /**
119    * Returns the value of field 'description'.
120    * 
121    * @return the value of field 'Description'.
122    */
123   public java.lang.String getDescription()
124   {
125     return this._description;
126   }
127
128   /**
129    * Returns the value of field 'displayCharacter'.
130    * 
131    * @return the value of field 'DisplayCharacter'.
132    */
133   public java.lang.String getDisplayCharacter()
134   {
135     return this._displayCharacter;
136   }
137
138   /**
139    * Returns the value of field 'position'.
140    * 
141    * @return the value of field 'Position'.
142    */
143   public int getPosition()
144   {
145     return this._position;
146   }
147
148   /**
149    * Returns the value of field 'secondaryStructure'.
150    * 
151    * @return the value of field 'SecondaryStructure'.
152    */
153   public java.lang.String getSecondaryStructure()
154   {
155     return this._secondaryStructure;
156   }
157
158   /**
159    * Returns the value of field 'value'.
160    * 
161    * @return the value of field 'Value'.
162    */
163   public float getValue()
164   {
165     return this._value;
166   }
167
168   /**
169    * Method hasColour.
170    * 
171    * @return true if at least one Colour has been added
172    */
173   public boolean hasColour()
174   {
175     return this._has_colour;
176   }
177
178   /**
179    * Method hasPosition.
180    * 
181    * @return true if at least one Position has been added
182    */
183   public boolean hasPosition()
184   {
185     return this._has_position;
186   }
187
188   /**
189    * Method hasValue.
190    * 
191    * @return true if at least one Value has been added
192    */
193   public boolean hasValue()
194   {
195     return this._has_value;
196   }
197
198   /**
199    * Method isValid.
200    * 
201    * @return true if this object is valid according to the schema
202    */
203   public boolean isValid()
204   {
205     try
206     {
207       validate();
208     } catch (org.exolab.castor.xml.ValidationException vex)
209     {
210       return false;
211     }
212     return true;
213   }
214
215   /**
216    * 
217    * 
218    * @param out
219    * @throws org.exolab.castor.xml.MarshalException
220    *           if object is null or if any SAXException is thrown during
221    *           marshaling
222    * @throws org.exolab.castor.xml.ValidationException
223    *           if this object is an invalid instance according to the schema
224    */
225   public void marshal(final java.io.Writer out)
226           throws org.exolab.castor.xml.MarshalException,
227           org.exolab.castor.xml.ValidationException
228   {
229     Marshaller.marshal(this, out);
230   }
231
232   /**
233    * 
234    * 
235    * @param handler
236    * @throws java.io.IOException
237    *           if an IOException occurs during marshaling
238    * @throws org.exolab.castor.xml.ValidationException
239    *           if this object is an invalid instance according to the schema
240    * @throws org.exolab.castor.xml.MarshalException
241    *           if object is null or if any SAXException is thrown during
242    *           marshaling
243    */
244   public void marshal(final org.xml.sax.ContentHandler handler)
245           throws java.io.IOException,
246           org.exolab.castor.xml.MarshalException,
247           org.exolab.castor.xml.ValidationException
248   {
249     Marshaller.marshal(this, handler);
250   }
251
252   /**
253    * Sets the value of field 'colour'.
254    * 
255    * @param colour
256    *          the value of field 'colour'.
257    */
258   public void setColour(final int colour)
259   {
260     this._colour = colour;
261     this._has_colour = true;
262   }
263
264   /**
265    * Sets the value of field 'description'.
266    * 
267    * @param description
268    *          the value of field 'description'.
269    */
270   public void setDescription(final java.lang.String description)
271   {
272     this._description = description;
273   }
274
275   /**
276    * Sets the value of field 'displayCharacter'.
277    * 
278    * @param displayCharacter
279    *          the value of field 'displayCharacter'
280    */
281   public void setDisplayCharacter(final java.lang.String displayCharacter)
282   {
283     this._displayCharacter = displayCharacter;
284   }
285
286   /**
287    * Sets the value of field 'position'.
288    * 
289    * @param position
290    *          the value of field 'position'.
291    */
292   public void setPosition(final int position)
293   {
294     this._position = position;
295     this._has_position = true;
296   }
297
298   /**
299    * Sets the value of field 'secondaryStructure'.
300    * 
301    * @param secondaryStructure
302    *          the value of field 'secondaryStructure'.
303    */
304   public void setSecondaryStructure(
305           final java.lang.String secondaryStructure)
306   {
307     this._secondaryStructure = secondaryStructure;
308   }
309
310   /**
311    * Sets the value of field 'value'.
312    * 
313    * @param value
314    *          the value of field 'value'.
315    */
316   public void setValue(final float value)
317   {
318     this._value = value;
319     this._has_value = true;
320   }
321
322   /**
323    * Method unmarshal.
324    * 
325    * @param reader
326    * @throws org.exolab.castor.xml.MarshalException
327    *           if object is null or if any SAXException is thrown during
328    *           marshaling
329    * @throws org.exolab.castor.xml.ValidationException
330    *           if this object is an invalid instance according to the schema
331    * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
332    */
333   public static jalview.schemabinding.version2.AnnotationElement unmarshal(
334           final java.io.Reader reader)
335           throws org.exolab.castor.xml.MarshalException,
336           org.exolab.castor.xml.ValidationException
337   {
338     return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
339             .unmarshal(
340                     jalview.schemabinding.version2.AnnotationElement.class,
341                     reader);
342   }
343
344   /**
345    * 
346    * 
347    * @throws org.exolab.castor.xml.ValidationException
348    *           if this object is an invalid instance according to the schema
349    */
350   public void validate() throws org.exolab.castor.xml.ValidationException
351   {
352     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
353     validator.validate(this);
354   }
355
356 }