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 SequenceMapping.
\r
20 * @version $Revision$ $Date$
\r
22 public class SequenceMapping extends uk.ac.vamsas.objects.core.MapType
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * Object on which the local
\r
33 * range is defined.
\r
35 private java.lang.Object _loc;
\r
38 * Object on which the mapped
\r
39 * range is defined.
\r
41 private java.lang.Object _map;
\r
46 private java.lang.String _id;
\r
49 * Field _provenance.
\r
51 private uk.ac.vamsas.objects.core.Provenance _provenance;
\r
58 public SequenceMapping() {
\r
68 * Overrides the java.lang.Object.equals method.
\r
71 * @return true if the objects are equal.
\r
73 public boolean equals(
\r
74 final java.lang.Object obj) {
\r
78 if (super.equals(obj)==false)
\r
81 if (obj instanceof SequenceMapping) {
\r
83 SequenceMapping temp = (SequenceMapping)obj;
\r
86 if (this._loc != null) {
\r
87 if (temp._loc == null) return false;
\r
88 if (this._loc != temp._loc) {
\r
89 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._loc);
\r
90 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._loc);
\r
91 if (thcycle!=tmcycle) {
\r
92 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._loc); };
\r
93 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc); };
\r
97 if (!this._loc.equals(temp._loc)) {
\r
98 org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
\r
99 org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
\r
102 org.castor.util.CycleBreaker.releaseCycleHandle(this._loc);
\r
103 org.castor.util.CycleBreaker.releaseCycleHandle(temp._loc);
\r
106 } else if (temp._loc != null)
\r
108 if (this._map != null) {
\r
109 if (temp._map == null) return false;
\r
110 if (this._map != temp._map) {
\r
111 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._map);
\r
112 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._map);
\r
113 if (thcycle!=tmcycle) {
\r
114 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._map); };
\r
115 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._map); };
\r
119 if (!this._map.equals(temp._map)) {
\r
120 org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
\r
121 org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
\r
124 org.castor.util.CycleBreaker.releaseCycleHandle(this._map);
\r
125 org.castor.util.CycleBreaker.releaseCycleHandle(temp._map);
\r
128 } else if (temp._map != null)
\r
130 if (this._id != null) {
\r
131 if (temp._id == null) return false;
\r
132 if (this._id != temp._id) {
\r
133 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
\r
134 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
\r
135 if (thcycle!=tmcycle) {
\r
136 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
\r
137 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
\r
141 if (!this._id.equals(temp._id)) {
\r
142 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
\r
143 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
\r
146 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
\r
147 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
\r
150 } else if (temp._id != null)
\r
152 if (this._provenance != null) {
\r
153 if (temp._provenance == null) return false;
\r
154 if (this._provenance != temp._provenance) {
\r
155 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._provenance);
\r
156 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._provenance);
\r
157 if (thcycle!=tmcycle) {
\r
158 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance); };
\r
159 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance); };
\r
163 if (!this._provenance.equals(temp._provenance)) {
\r
164 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
\r
165 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
\r
168 org.castor.util.CycleBreaker.releaseCycleHandle(this._provenance);
\r
169 org.castor.util.CycleBreaker.releaseCycleHandle(temp._provenance);
\r
172 } else if (temp._provenance != null)
\r
180 * Returns the value of field 'id'.
\r
182 * @return the value of field 'Id'.
\r
184 public java.lang.String getId(
\r
190 * Returns the value of field 'loc'. The field 'loc' has the
\r
191 * following description: Object on which the local
\r
192 * range is defined.
\r
194 * @return the value of field 'Loc'.
\r
196 public java.lang.Object getLoc(
\r
202 * Returns the value of field 'map'. The field 'map' has the
\r
203 * following description: Object on which the mapped
\r
204 * range is defined.
\r
206 * @return the value of field 'Map'.
\r
208 public java.lang.Object getMap(
\r
214 * Returns the value of field 'provenance'.
\r
216 * @return the value of field 'Provenance'.
\r
218 public uk.ac.vamsas.objects.core.Provenance getProvenance(
\r
220 return this._provenance;
\r
224 * Overrides the java.lang.Object.hashCode method.
\r
226 * The following steps came from <b>Effective Java Programming
\r
227 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
229 * @return a hash code value for the object.
\r
231 public int hashCode(
\r
233 int result = super.hashCode();
\r
237 && !org.castor.util.CycleBreaker.startingToCycle(_loc)) {
\r
238 result = 37 * result + _loc.hashCode();
\r
239 org.castor.util.CycleBreaker.releaseCycleHandle(_loc);
\r
242 && !org.castor.util.CycleBreaker.startingToCycle(_map)) {
\r
243 result = 37 * result + _map.hashCode();
\r
244 org.castor.util.CycleBreaker.releaseCycleHandle(_map);
\r
247 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
\r
248 result = 37 * result + _id.hashCode();
\r
249 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
\r
251 if (_provenance != null
\r
252 && !org.castor.util.CycleBreaker.startingToCycle(_provenance)) {
\r
253 result = 37 * result + _provenance.hashCode();
\r
254 org.castor.util.CycleBreaker.releaseCycleHandle(_provenance);
\r
263 * @return true if this object is valid according to the schema
\r
265 public boolean isValid(
\r
269 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
279 * @throws org.exolab.castor.xml.MarshalException if object is
\r
280 * null or if any SAXException is thrown during marshaling
\r
281 * @throws org.exolab.castor.xml.ValidationException if this
\r
282 * object is an invalid instance according to the schema
\r
284 public void marshal(
\r
285 final java.io.Writer out)
\r
286 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
287 Marshaller.marshal(this, out);
\r
294 * @throws java.io.IOException if an IOException occurs during
\r
296 * @throws org.exolab.castor.xml.ValidationException if this
\r
297 * object is an invalid instance according to the schema
\r
298 * @throws org.exolab.castor.xml.MarshalException if object is
\r
299 * null or if any SAXException is thrown during marshaling
\r
301 public void marshal(
\r
302 final org.xml.sax.ContentHandler handler)
\r
303 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
304 Marshaller.marshal(this, handler);
\r
308 * Sets the value of field 'id'.
\r
310 * @param id the value of field 'id'.
\r
313 final java.lang.String id) {
\r
318 * Sets the value of field 'loc'. The field 'loc' has the
\r
319 * following description: Object on which the local
\r
320 * range is defined.
\r
322 * @param loc the value of field 'loc'.
\r
324 public void setLoc(
\r
325 final java.lang.Object loc) {
\r
330 * Sets the value of field 'map'. The field 'map' has the
\r
331 * following description: Object on which the mapped
\r
332 * range is defined.
\r
334 * @param map the value of field 'map'.
\r
336 public void setMap(
\r
337 final java.lang.Object map) {
\r
342 * Sets the value of field 'provenance'.
\r
344 * @param provenance the value of field 'provenance'.
\r
346 public void setProvenance(
\r
347 final uk.ac.vamsas.objects.core.Provenance provenance) {
\r
348 this._provenance = provenance;
\r
352 * Method unmarshal.
\r
355 * @throws org.exolab.castor.xml.MarshalException if object is
\r
356 * null or if any SAXException is thrown during marshaling
\r
357 * @throws org.exolab.castor.xml.ValidationException if this
\r
358 * object is an invalid instance according to the schema
\r
359 * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
\r
361 public static uk.ac.vamsas.objects.core.MapType unmarshal(
\r
362 final java.io.Reader reader)
\r
363 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
364 return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.SequenceMapping.class, reader);
\r
370 * @throws org.exolab.castor.xml.ValidationException if this
\r
371 * object is an invalid instance according to the schema
\r
373 public void validate(
\r
375 throws org.exolab.castor.xml.ValidationException {
\r
376 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
377 validator.validate(this);
\r