2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import org.exolab.castor.xml.Marshaller;
\r
15 import org.exolab.castor.xml.Unmarshaller;
\r
18 * Ordered set of optionally named float values for the
\r
21 * @version $Revision$ $Date$
\r
23 public class Score extends uk.ac.vamsas.client.Vobject
\r
24 implements java.io.Serializable
\r
28 //--------------------------/
\r
29 //- Class/Member Variables -/
\r
30 //--------------------------/
\r
33 * internal content storage
\r
35 private float _content;
\r
38 * keeps track of state for field: _content
\r
40 private boolean _has_content;
\r
45 private java.lang.String _name = "score";
\r
64 public void deleteContent(
\r
66 this._has_content= false;
\r
70 * Overrides the java.lang.Object.equals method.
\r
73 * @return true if the objects are equal.
\r
75 public boolean equals(
\r
76 final java.lang.Object obj) {
\r
80 if (super.equals(obj)==false)
\r
83 if (obj instanceof Score) {
\r
85 Score temp = (Score)obj;
\r
86 if (this._content != temp._content)
\r
88 if (this._has_content != temp._has_content)
\r
90 if (this._name != null) {
\r
91 if (temp._name == null) return false;
\r
92 else if (!(this._name.equals(temp._name)))
\r
95 else if (temp._name != null)
\r
103 * Returns the value of field 'content'. The field 'content'
\r
104 * has the following description: internal content storage
\r
106 * @return the value of field 'Content'.
\r
108 public float getContent(
\r
110 return this._content;
\r
114 * Returns the value of field 'name'.
\r
116 * @return the value of field 'Name'.
\r
118 public java.lang.String getName(
\r
124 * Method hasContent.
\r
126 * @return true if at least one Content has been added
\r
128 public boolean hasContent(
\r
130 return this._has_content;
\r
134 * Overrides the java.lang.Object.hashCode method.
\r
136 * The following steps came from <b>Effective Java Programming
\r
137 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
139 * @return a hash code value for the object.
\r
141 public int hashCode(
\r
143 int result = super.hashCode();
\r
146 result = 37 * result + java.lang.Float.floatToIntBits(_content);
\r
147 if (_name != null) {
\r
148 result = 37 * result + _name.hashCode();
\r
157 * @return true if this object is valid according to the schema
\r
159 public boolean isValid(
\r
163 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
173 * @throws org.exolab.castor.xml.MarshalException if object is
\r
174 * null or if any SAXException is thrown during marshaling
\r
175 * @throws org.exolab.castor.xml.ValidationException if this
\r
176 * object is an invalid instance according to the schema
\r
178 public void marshal(
\r
179 final java.io.Writer out)
\r
180 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
181 Marshaller.marshal(this, out);
\r
188 * @throws java.io.IOException if an IOException occurs during
\r
190 * @throws org.exolab.castor.xml.ValidationException if this
\r
191 * object is an invalid instance according to the schema
\r
192 * @throws org.exolab.castor.xml.MarshalException if object is
\r
193 * null or if any SAXException is thrown during marshaling
\r
195 public void marshal(
\r
196 final org.xml.sax.ContentHandler handler)
\r
197 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
198 Marshaller.marshal(this, handler);
\r
202 * Sets the value of field 'content'. The field 'content' has
\r
203 * the following description: internal content storage
\r
205 * @param content the value of field 'content'.
\r
207 public void setContent(
\r
208 final float content) {
\r
209 this._content = content;
\r
210 this._has_content = true;
\r
214 * Sets the value of field 'name'.
\r
216 * @param name the value of field 'name'.
\r
218 public void setName(
\r
219 final java.lang.String name) {
\r
224 * Method unmarshal.
\r
227 * @throws org.exolab.castor.xml.MarshalException if object is
\r
228 * null or if any SAXException is thrown during marshaling
\r
229 * @throws org.exolab.castor.xml.ValidationException if this
\r
230 * object is an invalid instance according to the schema
\r
231 * @return the unmarshaled uk.ac.vamsas.objects.core.Score
\r
233 public static uk.ac.vamsas.objects.core.Score unmarshal(
\r
234 final java.io.Reader reader)
\r
235 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
236 return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader);
\r
242 * @throws org.exolab.castor.xml.ValidationException if this
\r
243 * object is an invalid instance according to the schema
\r
245 public void validate(
\r
247 throws org.exolab.castor.xml.ValidationException {
\r
248 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
249 validator.validate(this);
\r