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 * Two sets of ranges defined between objects - usually sequences,
\r
20 * regions on each are mapped.
\r
22 * @version $Revision$ $Date$
\r
24 public class MapType extends uk.ac.vamsas.client.Vobject
\r
25 implements java.io.Serializable
\r
29 //--------------------------/
\r
30 //- Class/Member Variables -/
\r
31 //--------------------------/
\r
35 private uk.ac.vamsas.objects.core.Local _local;
\r
39 private uk.ac.vamsas.objects.core.Mapped _mapped;
\r
56 * Overrides the java.lang.Object.equals method.
\r
59 * @return true if the objects are equal.
\r
61 public boolean equals(
\r
62 final java.lang.Object obj) {
\r
66 if (super.equals(obj)==false)
\r
69 if (obj instanceof MapType) {
\r
71 MapType temp = (MapType)obj;
\r
74 if (this._local != null) {
\r
75 if (temp._local == null) return false;
\r
76 if (this._local != temp._local) {
\r
77 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._local);
\r
78 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._local);
\r
79 if (thcycle!=tmcycle) {
\r
80 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._local); };
\r
81 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._local); };
\r
85 if (!this._local.equals(temp._local)) {
\r
86 org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
\r
87 org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
\r
90 org.castor.util.CycleBreaker.releaseCycleHandle(this._local);
\r
91 org.castor.util.CycleBreaker.releaseCycleHandle(temp._local);
\r
94 } else if (temp._local != null)
\r
96 if (this._mapped != null) {
\r
97 if (temp._mapped == null) return false;
\r
98 if (this._mapped != temp._mapped) {
\r
99 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._mapped);
\r
100 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._mapped);
\r
101 if (thcycle!=tmcycle) {
\r
102 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped); };
\r
103 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped); };
\r
107 if (!this._mapped.equals(temp._mapped)) {
\r
108 org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
\r
109 org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
\r
112 org.castor.util.CycleBreaker.releaseCycleHandle(this._mapped);
\r
113 org.castor.util.CycleBreaker.releaseCycleHandle(temp._mapped);
\r
116 } else if (temp._mapped != null)
\r
124 * Returns the value of field 'local'.
\r
126 * @return the value of field 'Local'.
\r
128 public uk.ac.vamsas.objects.core.Local getLocal(
\r
130 return this._local;
\r
134 * Returns the value of field 'mapped'.
\r
136 * @return the value of field 'Mapped'.
\r
138 public uk.ac.vamsas.objects.core.Mapped getMapped(
\r
140 return this._mapped;
\r
144 * Overrides the java.lang.Object.hashCode method.
\r
146 * The following steps came from <b>Effective Java Programming
\r
147 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
149 * @return a hash code value for the object.
\r
151 public int hashCode(
\r
153 int result = super.hashCode();
\r
157 && !org.castor.util.CycleBreaker.startingToCycle(_local)) {
\r
158 result = 37 * result + _local.hashCode();
\r
159 org.castor.util.CycleBreaker.releaseCycleHandle(_local);
\r
161 if (_mapped != null
\r
162 && !org.castor.util.CycleBreaker.startingToCycle(_mapped)) {
\r
163 result = 37 * result + _mapped.hashCode();
\r
164 org.castor.util.CycleBreaker.releaseCycleHandle(_mapped);
\r
173 * @return true if this object is valid according to the schema
\r
175 public boolean isValid(
\r
179 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
189 * @throws org.exolab.castor.xml.MarshalException if object is
\r
190 * null or if any SAXException is thrown during marshaling
\r
191 * @throws org.exolab.castor.xml.ValidationException if this
\r
192 * object is an invalid instance according to the schema
\r
194 public void marshal(
\r
195 final java.io.Writer out)
\r
196 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
197 Marshaller.marshal(this, out);
\r
204 * @throws java.io.IOException if an IOException occurs during
\r
206 * @throws org.exolab.castor.xml.ValidationException if this
\r
207 * object is an invalid instance according to the schema
\r
208 * @throws org.exolab.castor.xml.MarshalException if object is
\r
209 * null or if any SAXException is thrown during marshaling
\r
211 public void marshal(
\r
212 final org.xml.sax.ContentHandler handler)
\r
213 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
214 Marshaller.marshal(this, handler);
\r
218 * Sets the value of field 'local'.
\r
220 * @param local the value of field 'local'.
\r
222 public void setLocal(
\r
223 final uk.ac.vamsas.objects.core.Local local) {
\r
224 this._local = local;
\r
228 * Sets the value of field 'mapped'.
\r
230 * @param mapped the value of field 'mapped'.
\r
232 public void setMapped(
\r
233 final uk.ac.vamsas.objects.core.Mapped mapped) {
\r
234 this._mapped = mapped;
\r
238 * Method unmarshal.
\r
241 * @throws org.exolab.castor.xml.MarshalException if object is
\r
242 * null or if any SAXException is thrown during marshaling
\r
243 * @throws org.exolab.castor.xml.ValidationException if this
\r
244 * object is an invalid instance according to the schema
\r
245 * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
\r
247 public static uk.ac.vamsas.objects.core.MapType unmarshal(
\r
248 final java.io.Reader reader)
\r
249 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
250 return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.MapType.class, reader);
\r
256 * @throws org.exolab.castor.xml.ValidationException if this
\r
257 * object is an invalid instance according to the schema
\r
259 public void validate(
\r
261 throws org.exolab.castor.xml.ValidationException {
\r
262 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
263 validator.validate(this);
\r