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 * Class MapRangeType.
\r
20 * @version $Revision$ $Date$
\r
22 public class MapRangeType extends uk.ac.vamsas.objects.core.RangeType
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * number of dictionary symbol widths involved in each
\r
33 * mapped position on this sequence (for example, 3 for a dna
\r
35 * region that is being mapped to a protein sequence). This is
\r
37 * since the unit can be usually be inferred from the
\r
38 * dictionary type of
\r
39 * each sequence involved in the mapping.
\r
44 * keeps track of state for field: _unit
\r
46 private boolean _has_unit;
\r
53 public MapRangeType() {
\r
64 public void deleteUnit(
\r
66 this._has_unit= 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 MapRangeType) {
\r
85 MapRangeType temp = (MapRangeType)obj;
\r
88 if (this._unit != temp._unit)
\r
90 if (this._has_unit != temp._has_unit)
\r
98 * Returns the value of field 'unit'. The field 'unit' has the
\r
99 * following description: number of dictionary symbol widths
\r
101 * mapped position on this sequence (for example, 3 for a dna
\r
103 * region that is being mapped to a protein sequence). This is
\r
105 * since the unit can be usually be inferred from the
\r
106 * dictionary type of
\r
107 * each sequence involved in the mapping.
\r
109 * @return the value of field 'Unit'.
\r
111 public long getUnit(
\r
119 * @return true if at least one Unit has been added
\r
121 public boolean hasUnit(
\r
123 return this._has_unit;
\r
127 * Overrides the java.lang.Object.hashCode method.
\r
129 * The following steps came from <b>Effective Java Programming
\r
130 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
132 * @return a hash code value for the object.
\r
134 public int hashCode(
\r
136 int result = super.hashCode();
\r
139 result = 37 * result + (int)(_unit^(_unit>>>32));
\r
147 * @return true if this object is valid according to the schema
\r
149 public boolean isValid(
\r
153 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
163 * @throws org.exolab.castor.xml.MarshalException if object is
\r
164 * null or if any SAXException is thrown during marshaling
\r
165 * @throws org.exolab.castor.xml.ValidationException if this
\r
166 * object is an invalid instance according to the schema
\r
168 public void marshal(
\r
169 final java.io.Writer out)
\r
170 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
171 Marshaller.marshal(this, out);
\r
178 * @throws java.io.IOException if an IOException occurs during
\r
180 * @throws org.exolab.castor.xml.ValidationException if this
\r
181 * object is an invalid instance according to the schema
\r
182 * @throws org.exolab.castor.xml.MarshalException if object is
\r
183 * null or if any SAXException is thrown during marshaling
\r
185 public void marshal(
\r
186 final org.xml.sax.ContentHandler handler)
\r
187 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
188 Marshaller.marshal(this, handler);
\r
192 * Sets the value of field 'unit'. The field 'unit' has the
\r
193 * following description: number of dictionary symbol widths
\r
195 * mapped position on this sequence (for example, 3 for a dna
\r
197 * region that is being mapped to a protein sequence). This is
\r
199 * since the unit can be usually be inferred from the
\r
200 * dictionary type of
\r
201 * each sequence involved in the mapping.
\r
203 * @param unit the value of field 'unit'.
\r
205 public void setUnit(
\r
208 this._has_unit = true;
\r
212 * Method unmarshal.
\r
215 * @throws org.exolab.castor.xml.MarshalException if object is
\r
216 * null or if any SAXException is thrown during marshaling
\r
217 * @throws org.exolab.castor.xml.ValidationException if this
\r
218 * object is an invalid instance according to the schema
\r
219 * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType
\r
221 public static uk.ac.vamsas.objects.core.RangeType unmarshal(
\r
222 final java.io.Reader reader)
\r
223 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
224 return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapRangeType.class, reader);
\r
230 * @throws org.exolab.castor.xml.ValidationException if this
\r
231 * object is an invalid instance according to the schema
\r
233 public void validate(
\r
235 throws org.exolab.castor.xml.ValidationException {
\r
236 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
237 validator.validate(this);
\r