2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package uk.ac.vamsas.objects.core;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
20 * @version $Revision$ $Date$
22 public class Newick extends uk.ac.vamsas.client.Vobject
23 implements java.io.Serializable
27 //--------------------------/
28 //- Class/Member Variables -/
29 //--------------------------/
32 * internal content storage
34 private java.lang.String _content = "";
39 private java.lang.String _title;
42 * Primary Key for vamsas object referencing
45 private java.lang.String _id;
50 private java.lang.String _modifiable;
68 * Overrides the java.lang.Object.equals method.
71 * @return true if the objects are equal.
73 public boolean equals(
74 final java.lang.Object obj) {
78 if (super.equals(obj)==false)
81 if (obj instanceof Newick) {
83 Newick temp = (Newick)obj;
86 if (this._content != null) {
87 if (temp._content == null) return false;
88 if (this._content != temp._content) {
89 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
90 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
91 if (thcycle!=tmcycle) {
92 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
93 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
97 if (!this._content.equals(temp._content)) {
98 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
99 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
102 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
103 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
106 } else if (temp._content != null)
108 if (this._title != null) {
109 if (temp._title == null) return false;
110 if (this._title != temp._title) {
111 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._title);
112 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._title);
113 if (thcycle!=tmcycle) {
114 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._title); };
115 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._title); };
119 if (!this._title.equals(temp._title)) {
120 org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
121 org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
124 org.castor.util.CycleBreaker.releaseCycleHandle(this._title);
125 org.castor.util.CycleBreaker.releaseCycleHandle(temp._title);
128 } else if (temp._title != null)
130 if (this._id != null) {
131 if (temp._id == null) return false;
132 if (this._id != temp._id) {
133 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._id);
134 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._id);
135 if (thcycle!=tmcycle) {
136 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._id); };
137 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._id); };
141 if (!this._id.equals(temp._id)) {
142 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
143 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
146 org.castor.util.CycleBreaker.releaseCycleHandle(this._id);
147 org.castor.util.CycleBreaker.releaseCycleHandle(temp._id);
150 } else if (temp._id != null)
152 if (this._modifiable != null) {
153 if (temp._modifiable == null) return false;
154 if (this._modifiable != temp._modifiable) {
155 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._modifiable);
156 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._modifiable);
157 if (thcycle!=tmcycle) {
158 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable); };
159 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable); };
163 if (!this._modifiable.equals(temp._modifiable)) {
164 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
165 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
168 org.castor.util.CycleBreaker.releaseCycleHandle(this._modifiable);
169 org.castor.util.CycleBreaker.releaseCycleHandle(temp._modifiable);
172 } else if (temp._modifiable != null)
180 * Returns the value of field 'content'. The field 'content'
181 * has the following description: internal content storage
183 * @return the value of field 'Content'.
185 public java.lang.String getContent(
187 return this._content;
191 * Returns the value of field 'id'. The field 'id' has the
192 * following description: Primary Key for vamsas object
196 * @return the value of field 'Id'.
198 public java.lang.String getId(
204 * Returns the value of field 'modifiable'.
206 * @return the value of field 'Modifiable'.
208 public java.lang.String getModifiable(
210 return this._modifiable;
214 * Returns the value of field 'title'.
216 * @return the value of field 'Title'.
218 public java.lang.String getTitle(
224 * Overrides the java.lang.Object.hashCode method.
226 * The following steps came from <b>Effective Java Programming
227 * Language Guide</b> by Joshua Bloch, Chapter 3
229 * @return a hash code value for the object.
233 int result = super.hashCode();
237 && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
238 result = 37 * result + _content.hashCode();
239 org.castor.util.CycleBreaker.releaseCycleHandle(_content);
242 && !org.castor.util.CycleBreaker.startingToCycle(_title)) {
243 result = 37 * result + _title.hashCode();
244 org.castor.util.CycleBreaker.releaseCycleHandle(_title);
247 && !org.castor.util.CycleBreaker.startingToCycle(_id)) {
248 result = 37 * result + _id.hashCode();
249 org.castor.util.CycleBreaker.releaseCycleHandle(_id);
251 if (_modifiable != null
252 && !org.castor.util.CycleBreaker.startingToCycle(_modifiable)) {
253 result = 37 * result + _modifiable.hashCode();
254 org.castor.util.CycleBreaker.releaseCycleHandle(_modifiable);
263 * @return true if this object is valid according to the schema
265 public boolean isValid(
269 } catch (org.exolab.castor.xml.ValidationException vex) {
279 * @throws org.exolab.castor.xml.MarshalException if object is
280 * null or if any SAXException is thrown during marshaling
281 * @throws org.exolab.castor.xml.ValidationException if this
282 * object is an invalid instance according to the schema
285 final java.io.Writer out)
286 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
287 Marshaller.marshal(this, out);
294 * @throws java.io.IOException if an IOException occurs during
296 * @throws org.exolab.castor.xml.ValidationException if this
297 * object is an invalid instance according to the schema
298 * @throws org.exolab.castor.xml.MarshalException if object is
299 * null or if any SAXException is thrown during marshaling
302 final org.xml.sax.ContentHandler handler)
303 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
304 Marshaller.marshal(this, handler);
308 * Sets the value of field 'content'. The field 'content' has
309 * the following description: internal content storage
311 * @param content the value of field 'content'.
313 public void setContent(
314 final java.lang.String content) {
315 this._content = content;
319 * Sets the value of field 'id'. The field 'id' has the
320 * following description: Primary Key for vamsas object
324 * @param id the value of field 'id'.
327 final java.lang.String id) {
332 * Sets the value of field 'modifiable'.
334 * @param modifiable the value of field 'modifiable'.
336 public void setModifiable(
337 final java.lang.String modifiable) {
338 this._modifiable = modifiable;
342 * Sets the value of field 'title'.
344 * @param title the value of field 'title'.
346 public void setTitle(
347 final java.lang.String title) {
355 * @throws org.exolab.castor.xml.MarshalException if object is
356 * null or if any SAXException is thrown during marshaling
357 * @throws org.exolab.castor.xml.ValidationException if this
358 * object is an invalid instance according to the schema
359 * @return the unmarshaled uk.ac.vamsas.objects.core.Newick
361 public static uk.ac.vamsas.objects.core.Newick unmarshal(
362 final java.io.Reader reader)
363 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
364 return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Newick.class, reader);
370 * @throws org.exolab.castor.xml.ValidationException if this
371 * object is an invalid instance according to the schema
373 public void validate(
375 throws org.exolab.castor.xml.ValidationException {
376 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
377 validator.validate(this);