refactored org to uk
[vamsas.git] / src / org / vamsas / objects / core / Score.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package org.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import org.exolab.castor.xml.MarshalException;\r
19 import org.exolab.castor.xml.Marshaller;\r
20 import org.exolab.castor.xml.Unmarshaller;\r
21 import org.exolab.castor.xml.ValidationException;\r
22 import org.xml.sax.ContentHandler;\r
23 \r
24 /**\r
25  * Ordered set of optionally named float values for the\r
26  *  whole annotation \r
27  * \r
28  * @version $Revision$ $Date$\r
29  */\r
30 public class Score extends uk.ac.vamsas.client.Vobject \r
31 implements java.io.Serializable\r
32 {\r
33 \r
34 \r
35       //--------------------------/\r
36      //- Class/Member Variables -/\r
37     //--------------------------/\r
38 \r
39     /**\r
40      * internal content storage\r
41      */\r
42     private float _content;\r
43 \r
44     /**\r
45      * keeps track of state for field: _content\r
46      */\r
47     private boolean _has_content;\r
48 \r
49     /**\r
50      * Field _name\r
51      */\r
52     private java.lang.String _name = "score";\r
53 \r
54 \r
55       //----------------/\r
56      //- Constructors -/\r
57     //----------------/\r
58 \r
59     public Score() \r
60      {\r
61         super();\r
62         setName("score");\r
63     } //-- org.vamsas.objects.core.Score()\r
64 \r
65 \r
66       //-----------/\r
67      //- Methods -/\r
68     //-----------/\r
69 \r
70     /**\r
71      * Method deleteContent\r
72      * \r
73      */\r
74     public void deleteContent()\r
75     {\r
76         this._has_content= false;\r
77     } //-- void deleteContent() \r
78 \r
79     /**\r
80      * Note: hashCode() has not been overriden\r
81      * \r
82      * @param obj\r
83      * @return boolean\r
84      */\r
85     public boolean equals(java.lang.Object obj)\r
86     {\r
87         if ( this == obj )\r
88             return true;\r
89         \r
90         if (super.equals(obj)==false)\r
91             return false;\r
92         \r
93         if (obj instanceof Score) {\r
94         \r
95             Score temp = (Score)obj;\r
96             if (this._content != temp._content)\r
97                 return false;\r
98             if (this._has_content != temp._has_content)\r
99                 return false;\r
100             if (this._name != null) {\r
101                 if (temp._name == null) return false;\r
102                 else if (!(this._name.equals(temp._name))) \r
103                     return false;\r
104             }\r
105             else if (temp._name != null)\r
106                 return false;\r
107             return true;\r
108         }\r
109         return false;\r
110     } //-- boolean equals(java.lang.Object) \r
111 \r
112     /**\r
113      * Returns the value of field 'content'. The field 'content'\r
114      * has the following description: internal content storage\r
115      * \r
116      * @return float\r
117      * @return the value of field 'content'.\r
118      */\r
119     public float getContent()\r
120     {\r
121         return this._content;\r
122     } //-- float getContent() \r
123 \r
124     /**\r
125      * Returns the value of field 'name'.\r
126      * \r
127      * @return String\r
128      * @return the value of field 'name'.\r
129      */\r
130     public java.lang.String getName()\r
131     {\r
132         return this._name;\r
133     } //-- java.lang.String getName() \r
134 \r
135     /**\r
136      * Method hasContent\r
137      * \r
138      * \r
139      * \r
140      * @return boolean\r
141      */\r
142     public boolean hasContent()\r
143     {\r
144         return this._has_content;\r
145     } //-- boolean hasContent() \r
146 \r
147     /**\r
148      * Method isValid\r
149      * \r
150      * \r
151      * \r
152      * @return boolean\r
153      */\r
154     public boolean isValid()\r
155     {\r
156         try {\r
157             validate();\r
158         }\r
159         catch (org.exolab.castor.xml.ValidationException vex) {\r
160             return false;\r
161         }\r
162         return true;\r
163     } //-- boolean isValid() \r
164 \r
165     /**\r
166      * Method marshal\r
167      * \r
168      * \r
169      * \r
170      * @param out\r
171      */\r
172     public void marshal(java.io.Writer out)\r
173         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
174     {\r
175         \r
176         Marshaller.marshal(this, out);\r
177     } //-- void marshal(java.io.Writer) \r
178 \r
179     /**\r
180      * Method marshal\r
181      * \r
182      * \r
183      * \r
184      * @param handler\r
185      */\r
186     public void marshal(org.xml.sax.ContentHandler handler)\r
187         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
188     {\r
189         \r
190         Marshaller.marshal(this, handler);\r
191     } //-- void marshal(org.xml.sax.ContentHandler) \r
192 \r
193     /**\r
194      * Sets the value of field 'content'. The field 'content' has\r
195      * the following description: internal content storage\r
196      * \r
197      * @param content the value of field 'content'.\r
198      */\r
199     public void setContent(float content)\r
200     {\r
201         this._content = content;\r
202         this._has_content = true;\r
203     } //-- void setContent(float) \r
204 \r
205     /**\r
206      * Sets the value of field 'name'.\r
207      * \r
208      * @param name the value of field 'name'.\r
209      */\r
210     public void setName(java.lang.String name)\r
211     {\r
212         this._name = name;\r
213     } //-- void setName(java.lang.String) \r
214 \r
215     /**\r
216      * Method unmarshal\r
217      * \r
218      * \r
219      * \r
220      * @param reader\r
221      * @return Score\r
222      */\r
223     public static org.vamsas.objects.core.Score unmarshal(java.io.Reader reader)\r
224         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
225     {\r
226         return (org.vamsas.objects.core.Score) Unmarshaller.unmarshal(org.vamsas.objects.core.Score.class, reader);\r
227     } //-- org.vamsas.objects.core.Score unmarshal(java.io.Reader) \r
228 \r
229     /**\r
230      * Method validate\r
231      * \r
232      */\r
233     public void validate()\r
234         throws org.exolab.castor.xml.ValidationException\r
235     {\r
236         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
237         validator.validate(this);\r
238     } //-- void validate() \r
239 \r
240 }\r