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