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
20 * @version $Revision$ $Date$
\r
22 public class Link extends uk.ac.vamsas.client.Vobject
\r
23 implements java.io.Serializable
\r
27 //--------------------------/
\r
28 //- Class/Member Variables -/
\r
29 //--------------------------/
\r
32 * internal content storage
\r
34 private java.lang.String _content = "";
\r
39 private java.lang.String _href;
\r
57 * Overrides the java.lang.Object.equals method.
\r
60 * @return true if the objects are equal.
\r
62 public boolean equals(
\r
63 final java.lang.Object obj) {
\r
67 if (super.equals(obj)==false)
\r
70 if (obj instanceof Link) {
\r
72 Link temp = (Link)obj;
\r
75 if (this._content != null) {
\r
76 if (temp._content == null) return false;
\r
77 if (this._content != temp._content) {
\r
78 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
\r
79 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
\r
80 if (thcycle!=tmcycle) {
\r
81 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
\r
82 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
\r
86 if (!this._content.equals(temp._content)) {
\r
87 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
88 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
91 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
92 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
95 } else if (temp._content != null)
\r
97 if (this._href != null) {
\r
98 if (temp._href == null) return false;
\r
99 if (this._href != temp._href) {
\r
100 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._href);
\r
101 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._href);
\r
102 if (thcycle!=tmcycle) {
\r
103 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._href); };
\r
104 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._href); };
\r
108 if (!this._href.equals(temp._href)) {
\r
109 org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
\r
110 org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
\r
113 org.castor.util.CycleBreaker.releaseCycleHandle(this._href);
\r
114 org.castor.util.CycleBreaker.releaseCycleHandle(temp._href);
\r
117 } else if (temp._href != null)
\r
125 * Returns the value of field 'content'. The field 'content'
\r
126 * has the following description: internal content storage
\r
128 * @return the value of field 'Content'.
\r
130 public java.lang.String getContent(
\r
132 return this._content;
\r
136 * Returns the value of field 'href'. The field 'href' has the
\r
137 * following description: The URI
\r
139 * @return the value of field 'Href'.
\r
141 public java.lang.String getHref(
\r
147 * Overrides the java.lang.Object.hashCode method.
\r
149 * The following steps came from <b>Effective Java Programming
\r
150 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
152 * @return a hash code value for the object.
\r
154 public int hashCode(
\r
156 int result = super.hashCode();
\r
159 if (_content != null
\r
160 && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
\r
161 result = 37 * result + _content.hashCode();
\r
162 org.castor.util.CycleBreaker.releaseCycleHandle(_content);
\r
165 && !org.castor.util.CycleBreaker.startingToCycle(_href)) {
\r
166 result = 37 * result + _href.hashCode();
\r
167 org.castor.util.CycleBreaker.releaseCycleHandle(_href);
\r
176 * @return true if this object is valid according to the schema
\r
178 public boolean isValid(
\r
182 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
192 * @throws org.exolab.castor.xml.MarshalException if object is
\r
193 * null or if any SAXException is thrown during marshaling
\r
194 * @throws org.exolab.castor.xml.ValidationException if this
\r
195 * object is an invalid instance according to the schema
\r
197 public void marshal(
\r
198 final java.io.Writer out)
\r
199 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
200 Marshaller.marshal(this, out);
\r
207 * @throws java.io.IOException if an IOException occurs during
\r
209 * @throws org.exolab.castor.xml.ValidationException if this
\r
210 * object is an invalid instance according to the schema
\r
211 * @throws org.exolab.castor.xml.MarshalException if object is
\r
212 * null or if any SAXException is thrown during marshaling
\r
214 public void marshal(
\r
215 final org.xml.sax.ContentHandler handler)
\r
216 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
217 Marshaller.marshal(this, handler);
\r
221 * Sets the value of field 'content'. The field 'content' has
\r
222 * the following description: internal content storage
\r
224 * @param content the value of field 'content'.
\r
226 public void setContent(
\r
227 final java.lang.String content) {
\r
228 this._content = content;
\r
232 * Sets the value of field 'href'. The field 'href' has the
\r
233 * following description: The URI
\r
235 * @param href the value of field 'href'.
\r
237 public void setHref(
\r
238 final java.lang.String href) {
\r
243 * Method unmarshal.
\r
246 * @throws org.exolab.castor.xml.MarshalException if object is
\r
247 * null or if any SAXException is thrown during marshaling
\r
248 * @throws org.exolab.castor.xml.ValidationException if this
\r
249 * object is an invalid instance according to the schema
\r
250 * @return the unmarshaled uk.ac.vamsas.objects.core.Link
\r
252 public static uk.ac.vamsas.objects.core.Link unmarshal(
\r
253 final java.io.Reader reader)
\r
254 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
255 return (uk.ac.vamsas.objects.core.Link) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Link.class, reader);
\r
261 * @throws org.exolab.castor.xml.ValidationException if this
\r
262 * object is an invalid instance according to the schema
\r
264 public void validate(
\r
266 throws org.exolab.castor.xml.ValidationException {
\r
267 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
268 validator.validate(this);
\r