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 * the local mapType maps from the parent
\r
19 * sequence coordinate frame to the reference
\r
20 * frame defined by the dbRef element.
\r
21 * The mapped mapType is the mapped range defined
\r
22 * on the dbRef element's reference frame.
\r
23 * Conventionally, the unit attribute defaults to 1, or
\r
24 * will be inferred from the local sequence's
\r
25 * dictionary type and any dictionary type associated
\r
26 * with the database being mapped to.
\r
27 * However, it may be used to avoid ambiguity.
\r
30 * @version $Revision$ $Date$
\r
32 public class Map extends uk.ac.vamsas.objects.core.MapType
\r
33 implements java.io.Serializable
\r
37 //--------------------------/
\r
38 //- Class/Member Variables -/
\r
39 //--------------------------/
\r
44 private java.lang.String _id;
\r
61 * Overrides the java.lang.Object.equals method.
\r
64 * @return true if the objects are equal.
\r
66 public boolean equals(
\r
67 final java.lang.Object obj) {
\r
71 if (super.equals(obj)==false)
\r
74 if (obj instanceof Map) {
\r
76 Map temp = (Map)obj;
\r
79 if (this._id != null) {
\r
80 if (temp._id == null) return false;
\r
81 if (this._id != temp._id) {
\r
82 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
\r
83 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
\r
84 if (thcycle!=tmcycle) {
\r
85 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
\r
86 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
\r
90 if (!this._id.equals(temp._id)) {
\r
91 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
\r
92 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
\r
95 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
\r
96 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
\r
99 } else if (temp._id != null)
\r
107 * Returns the value of field 'id'.
\r
109 * @return the value of field 'Id'.
\r
111 public java.lang.String getId(
\r
117 * Overrides the java.lang.Object.hashCode method.
\r
119 * The following steps came from <b>Effective Java Programming
\r
120 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
122 * @return a hash code value for the object.
\r
124 public int hashCode(
\r
126 int result = super.hashCode();
\r
130 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
\r
131 result = 37 * result + _id.hashCode();
\r
132 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
\r
141 * @return true if this object is valid according to the schema
\r
143 public boolean isValid(
\r
147 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
157 * @throws org.exolab.castor.xml.MarshalException if object is
\r
158 * null or if any SAXException is thrown during marshaling
\r
159 * @throws org.exolab.castor.xml.ValidationException if this
\r
160 * object is an invalid instance according to the schema
\r
162 public void marshal(
\r
163 final java.io.Writer out)
\r
164 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
165 Marshaller.marshal(this, out);
\r
172 * @throws java.io.IOException if an IOException occurs during
\r
174 * @throws org.exolab.castor.xml.ValidationException if this
\r
175 * object is an invalid instance according to the schema
\r
176 * @throws org.exolab.castor.xml.MarshalException if object is
\r
177 * null or if any SAXException is thrown during marshaling
\r
179 public void marshal(
\r
180 final org.xml.sax.ContentHandler handler)
\r
181 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
182 Marshaller.marshal(this, handler);
\r
186 * Sets the value of field 'id'.
\r
188 * @param id the value of field 'id'.
\r
191 final java.lang.String id) {
\r
196 * Method unmarshal.
\r
199 * @throws org.exolab.castor.xml.MarshalException if object is
\r
200 * null or if any SAXException is thrown during marshaling
\r
201 * @throws org.exolab.castor.xml.ValidationException if this
\r
202 * object is an invalid instance according to the schema
\r
203 * @return the unmarshaled uk.ac.vamsas.objects.core.MapType
\r
205 public static uk.ac.vamsas.objects.core.MapType unmarshal(
\r
206 final java.io.Reader reader)
\r
207 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
208 return (uk.ac.vamsas.objects.core.MapType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Map.class, reader);
\r
214 * @throws org.exolab.castor.xml.ValidationException if this
\r
215 * object is an invalid instance according to the schema
\r
217 public void validate(
\r
219 throws org.exolab.castor.xml.ValidationException {
\r
220 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
221 validator.validate(this);
\r