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
88 if (this._content != temp._content)
\r
90 if (this._has_content != temp._has_content)
\r
92 if (this._name != null) {
\r
93 if (temp._name == null) return false;
\r
94 if (this._name != temp._name) {
\r
95 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._name);
\r
96 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._name);
\r
97 if (thcycle!=tmcycle) {
\r
98 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._name); };
\r
99 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._name); };
\r
103 if (!this._name.equals(temp._name)) {
\r
104 org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
\r
105 org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
\r
108 org.castor.util.CycleBreaker.releaseCycleHandle(this._name);
\r
109 org.castor.util.CycleBreaker.releaseCycleHandle(temp._name);
\r
112 } else if (temp._name != null)
\r
120 * Returns the value of field 'content'. The field 'content'
\r
121 * has the following description: internal content storage
\r
123 * @return the value of field 'Content'.
\r
125 public float getContent(
\r
127 return this._content;
\r
131 * Returns the value of field 'name'.
\r
133 * @return the value of field 'Name'.
\r
135 public java.lang.String getName(
\r
141 * Method hasContent.
\r
143 * @return true if at least one Content has been added
\r
145 public boolean hasContent(
\r
147 return this._has_content;
\r
151 * Overrides the java.lang.Object.hashCode method.
\r
153 * The following steps came from <b>Effective Java Programming
\r
154 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
156 * @return a hash code value for the object.
\r
158 public int hashCode(
\r
160 int result = super.hashCode();
\r
163 result = 37 * result + java.lang.Float.floatToIntBits(_content);
\r
165 && !org.castor.util.CycleBreaker.startingToCycle(_name)) {
\r
166 result = 37 * result + _name.hashCode();
\r
167 org.castor.util.CycleBreaker.releaseCycleHandle(_name);
\r
176 * @return true if this object is valid according to the schema
\r
178 public boolean isValid(
\r
182 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
192 * @throws org.exolab.castor.xml.MarshalException if object is
\r
193 * null or if any SAXException is thrown during marshaling
\r
194 * @throws org.exolab.castor.xml.ValidationException if this
\r
195 * object is an invalid instance according to the schema
\r
197 public void marshal(
\r
198 final java.io.Writer out)
\r
199 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
200 Marshaller.marshal(this, out);
\r
207 * @throws java.io.IOException if an IOException occurs during
\r
209 * @throws org.exolab.castor.xml.ValidationException if this
\r
210 * object is an invalid instance according to the schema
\r
211 * @throws org.exolab.castor.xml.MarshalException if object is
\r
212 * null or if any SAXException is thrown during marshaling
\r
214 public void marshal(
\r
215 final org.xml.sax.ContentHandler handler)
\r
216 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
217 Marshaller.marshal(this, handler);
\r
221 * Sets the value of field 'content'. The field 'content' has
\r
222 * the following description: internal content storage
\r
224 * @param content the value of field 'content'.
\r
226 public void setContent(
\r
227 final float content) {
\r
228 this._content = content;
\r
229 this._has_content = true;
\r
233 * Sets the value of field 'name'.
\r
235 * @param name the value of field 'name'.
\r
237 public void setName(
\r
238 final java.lang.String name) {
\r
243 * Method unmarshal.
\r
246 * @throws org.exolab.castor.xml.MarshalException if object is
\r
247 * null or if any SAXException is thrown during marshaling
\r
248 * @throws org.exolab.castor.xml.ValidationException if this
\r
249 * object is an invalid instance according to the schema
\r
250 * @return the unmarshaled uk.ac.vamsas.objects.core.Score
\r
252 public static uk.ac.vamsas.objects.core.Score unmarshal(
\r
253 final java.io.Reader reader)
\r
254 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
255 return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader);
\r
261 * @throws org.exolab.castor.xml.ValidationException if this
\r
262 * object is an invalid instance according to the schema
\r
264 public void validate(
\r
266 throws org.exolab.castor.xml.ValidationException {
\r
267 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
268 validator.validate(this);
\r