X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FMapList.java;fp=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2Fcore%2FMapList.java;h=af7ebb61a876c0619ba5911631897c7b821b680e;hb=ac12127b5cf22bb34b6042e543d506894164a94c;hp=63d6a1e094a5ee951acdbcc82b60f6fb38d30cfe;hpb=7a32f8e2e264be51d0b3de6a3a599c15c82c58cd;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/core/MapList.java b/src/uk/ac/vamsas/objects/core/MapList.java index 63d6a1e..af7ebb6 100644 --- a/src/uk/ac/vamsas/objects/core/MapList.java +++ b/src/uk/ac/vamsas/objects/core/MapList.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; /** * Class MapList. @@ -40,7 +33,7 @@ implements java.io.Serializable * start * position on 'onto' maps to */ - private int _from = 0; + private long _from = 0; /** * keeps track of state for field: _from @@ -51,7 +44,7 @@ implements java.io.Serializable * Offset to last position in dataset sequence record that end * position on 'onto' maps to */ - private int _to = 0; + private long _to = 0; /** * keeps track of state for field: _to @@ -63,7 +56,7 @@ implements java.io.Serializable * offset) * position in sequence maps to */ - private int _start; + private long _start; /** * keeps track of state for field: _start @@ -74,7 +67,7 @@ implements java.io.Serializable * Offset to last position in database entry that last (offset) * position in sequence maps to */ - private int _end; + private long _end; /** * keeps track of state for field: _end @@ -86,10 +79,9 @@ implements java.io.Serializable //- Constructors -/ //----------------/ - public MapList() - { + public MapList() { super(); - } //-- uk.ac.vamsas.objects.core.MapList() + } //-----------/ @@ -97,49 +89,41 @@ implements java.io.Serializable //-----------/ /** - * Method deleteEnd - * */ - public void deleteEnd() - { + public void deleteEnd( + ) { this._has_end= false; - } //-- void deleteEnd() + } /** - * Method deleteFrom - * */ - public void deleteFrom() - { + public void deleteFrom( + ) { this._has_from= false; - } //-- void deleteFrom() + } /** - * Method deleteStart - * */ - public void deleteStart() - { + public void deleteStart( + ) { this._has_start= false; - } //-- void deleteStart() + } /** - * Method deleteTo - * */ - public void deleteTo() - { + public void deleteTo( + ) { this._has_to= false; - } //-- void deleteTo() + } /** - * 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; @@ -168,7 +152,7 @@ implements java.io.Serializable return true; } return false; - } //-- boolean equals(java.lang.Object) + } /** * Returns the value of field 'end'. The field 'end' has the @@ -176,13 +160,12 @@ implements java.io.Serializable * entry that last (offset) * position in sequence maps to * - * @return int - * @return the value of field 'end'. + * @return the value of field 'End'. */ - public int getEnd() - { + public long getEnd( + ) { return this._end; - } //-- int getEnd() + } /** * Returns the value of field 'from'. The field 'from' has the @@ -190,13 +173,12 @@ implements java.io.Serializable * sequence record that start * position on 'onto' maps to * - * @return int - * @return the value of field 'from'. + * @return the value of field 'From'. */ - public int getFrom() - { + public long getFrom( + ) { return this._from; - } //-- int getFrom() + } /** * Returns the value of field 'start'. The field 'start' has @@ -204,13 +186,12 @@ implements java.io.Serializable * database entry that first (or offset) * position in sequence maps to * - * @return int - * @return the value of field 'start'. + * @return the value of field 'Start'. */ - public int getStart() - { + public long getStart( + ) { return this._start; - } //-- int getStart() + } /** * Returns the value of field 'to'. The field 'to' has the @@ -218,107 +199,120 @@ implements java.io.Serializable * sequence record that end * position on 'onto' maps to * - * @return int - * @return the value of field 'to'. + * @return the value of field 'To'. */ - public int getTo() - { + public long getTo( + ) { return this._to; - } //-- int getTo() + } /** - * Method hasEnd + * Method hasEnd. * - * - * - * @return boolean + * @return true if at least one End has been added */ - public boolean hasEnd() - { + public boolean hasEnd( + ) { return this._has_end; - } //-- boolean hasEnd() + } /** - * Method hasFrom - * + * Method hasFrom. * - * - * @return boolean + * @return true if at least one From has been added */ - public boolean hasFrom() - { + public boolean hasFrom( + ) { return this._has_from; - } //-- boolean hasFrom() + } /** - * Method hasStart - * - * + * Method hasStart. * - * @return boolean + * @return true if at least one Start has been added */ - public boolean hasStart() - { + public boolean hasStart( + ) { return this._has_start; - } //-- boolean hasStart() + } /** - * Method hasTo + * Method hasTo. * - * - * - * @return boolean + * @return true if at least one To has been added */ - public boolean hasTo() - { + public boolean hasTo( + ) { return this._has_to; - } //-- boolean hasTo() + } /** - * 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 + (int)(_from^(_from>>>32)); + result = 37 * result + (int)(_to^(_to>>>32)); + result = 37 * result + (int)(_start^(_start>>>32)); + result = 37 * result + (int)(_end^(_end>>>32)); + + 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 'end'. The field 'end' has the @@ -328,11 +322,11 @@ implements java.io.Serializable * * @param end the value of field 'end'. */ - public void setEnd(int end) - { + public void setEnd( + final long end) { this._end = end; this._has_end = true; - } //-- void setEnd(int) + } /** * Sets the value of field 'from'. The field 'from' has the @@ -342,11 +336,11 @@ implements java.io.Serializable * * @param from the value of field 'from'. */ - public void setFrom(int from) - { + public void setFrom( + final long from) { this._from = from; this._has_from = true; - } //-- void setFrom(int) + } /** * Sets the value of field 'start'. The field 'start' has the @@ -356,11 +350,11 @@ implements java.io.Serializable * * @param start the value of field 'start'. */ - public void setStart(int start) - { + public void setStart( + final long start) { this._start = start; this._has_start = true; - } //-- void setStart(int) + } /** * Sets the value of field 'to'. The field 'to' has the @@ -370,35 +364,39 @@ implements java.io.Serializable * * @param to the value of field 'to'. */ - public void setTo(int to) - { + public void setTo( + final long to) { this._to = to; this._has_to = true; - } //-- void setTo(int) + } /** - * Method unmarshal - * - * + * Method unmarshal. * * @param reader - * @return MapList + * @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.MapList */ - public static uk.ac.vamsas.objects.core.MapList unmarshal(java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException - { + public static uk.ac.vamsas.objects.core.MapList unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (uk.ac.vamsas.objects.core.MapList) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapList.class, reader); - } //-- uk.ac.vamsas.objects.core.MapList 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() + } }