X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FScore.java;h=8448198457ffb2cf7581d849bd74e25db52e206a;hb=261406f42435f46617fb9efe7c5472b5f670ff42;hp=bb00fa452c37429b120f63dc39a0223141d5da2b;hpb=a06295cc0912455e0bc53b26cb4e0134e6759d0f;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/Score.java b/src/uk/ac/vamsas/objects/core/Score.java index bb00fa4..8448198 100644 --- a/src/uk/ac/vamsas/objects/core/Score.java +++ b/src/uk/ac/vamsas/objects/core/Score.java @@ -1,6 +1,6 @@ /* * This class was automatically generated with - * Castor 0.9.9M2, using an XML + * Castor 1.1, using an XML * Schema. * $Id$ */ @@ -11,15 +11,8 @@ package uk.ac.vamsas.objects.core; //- Imported classes and packages -/ //---------------------------------/ -import java.io.IOException; -import java.io.Reader; -import java.io.Serializable; -import java.io.Writer; -import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; -import org.exolab.castor.xml.ValidationException; -import org.xml.sax.ContentHandler; /** * Ordered set of optionally named float values for the @@ -47,7 +40,7 @@ implements java.io.Serializable private boolean _has_content; /** - * Field _name + * Field _name. */ private java.lang.String _name = "score"; @@ -56,11 +49,10 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public Score() - { + public Score() { super(); setName("score"); - } //-- uk.ac.vamsas.objects.core.Score() + } //-----------/ @@ -68,22 +60,20 @@ implements java.io.Serializable //-----------/ /** - * Method deleteContent - * */ - public void deleteContent() - { + public void deleteContent( + ) { this._has_content= false; - } //-- void deleteContent() + } /** - * Note: hashCode() has not been overriden + * Overrides the java.lang.Object.equals method. * * @param obj - * @return boolean + * @return true if the objects are equal. */ - public boolean equals(java.lang.Object obj) - { + public boolean equals( + final java.lang.Object obj) { if ( this == obj ) return true; @@ -107,88 +97,106 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'content'. The field 'content' * has the following description: internal content storage * - * @return float - * @return the value of field 'content'. + * @return the value of field 'Content'. */ - public float getContent() - { + public float getContent( + ) { return this._content; - } //-- float getContent() + } /** * Returns the value of field 'name'. * - * @return String - * @return the value of field 'name'. + * @return the value of field 'Name'. */ - public java.lang.String getName() - { + public java.lang.String getName( + ) { return this._name; - } //-- java.lang.String getName() + } /** - * Method hasContent - * - * + * Method hasContent. * - * @return boolean + * @return true if at least one Content has been added */ - public boolean hasContent() - { + public boolean hasContent( + ) { return this._has_content; - } //-- boolean hasContent() + } /** - * Method isValid - * + * Overrides the java.lang.Object.hashCode method. + *

+ * The following steps came from Effective Java Programming + * Language Guide by Joshua Bloch, Chapter 3 * + * @return a hash code value for the object. + */ + public int hashCode( + ) { + int result = super.hashCode(); + + long tmp; + result = 37 * result + java.lang.Float.floatToIntBits(_content); + if (_name != null) { + result = 37 * result + _name.hashCode(); + } + + return result; + } + + /** + * Method isValid. * - * @return boolean + * @return true if this object is valid according to the schema */ - public boolean isValid() - { + public boolean isValid( + ) { try { validate(); - } - catch (org.exolab.castor.xml.ValidationException vex) { + } catch (org.exolab.castor.xml.ValidationException vex) { return false; } return true; - } //-- boolean isValid() + } /** - * Method marshal - * * * * @param out + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void marshal(java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, out); - } //-- void marshal(java.io.Writer) + } /** - * Method marshal - * * * * @param handler + * @throws java.io.IOException if an IOException occurs during + * marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling */ - public void marshal(org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { - + public void marshal( + final org.xml.sax.ContentHandler handler) + throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { Marshaller.marshal(this, handler); - } //-- void marshal(org.xml.sax.ContentHandler) + } /** * Sets the value of field 'content'. The field 'content' has @@ -196,45 +204,49 @@ implements java.io.Serializable * * @param content the value of field 'content'. */ - public void setContent(float content) - { + public void setContent( + final float content) { this._content = content; this._has_content = true; - } //-- void setContent(float) + } /** * Sets the value of field 'name'. * * @param name the value of field 'name'. */ - public void setName(java.lang.String name) - { + public void setName( + final java.lang.String name) { this._name = name; - } //-- void setName(java.lang.String) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return Score + * @throws org.exolab.castor.xml.MarshalException if object is + * null or if any SAXException is thrown during marshaling + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema + * @return the unmarshaled uk.ac.vamsas.objects.core.Score */ - public static uk.ac.vamsas.objects.core.Score unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.Score unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.Score) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Score.class, reader); - } //-- uk.ac.vamsas.objects.core.Score unmarshal(java.io.Reader) + } /** - * Method validate * + * + * @throws org.exolab.castor.xml.ValidationException if this + * object is an invalid instance according to the schema */ - public void validate() - throws org.exolab.castor.xml.ValidationException - { + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); validator.validate(this); - } //-- void validate() + } }