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