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 * Discrete symbol - possibly graphically represented
\r
21 * @version $Revision$ $Date$
\r
23 public class Glyph extends uk.ac.vamsas.client.Vobject
\r
24 implements java.io.Serializable
\r
28 //--------------------------/
\r
29 //- Class/Member Variables -/
\r
30 //--------------------------/
\r
33 * internal content storage
\r
35 private java.lang.String _content = "";
\r
38 * specifies the symbol dictionary for this
\r
39 * glyph - eg utf8 (the default), aasecstr_3 or
\r
40 * kd_hydrophobicity - the content is not validated so
\r
41 * applications must ensure they gracefully deal with
\r
42 * invalid entries here
\r
44 private java.lang.String _dict = "utf8";
\r
63 * Overrides the java.lang.Object.equals method.
\r
66 * @return true if the objects are equal.
\r
68 public boolean equals(
\r
69 final java.lang.Object obj) {
\r
73 if (super.equals(obj)==false)
\r
76 if (obj instanceof Glyph) {
\r
78 Glyph temp = (Glyph)obj;
\r
81 if (this._content != null) {
\r
82 if (temp._content == null) return false;
\r
83 if (this._content != temp._content) {
\r
84 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._content);
\r
85 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._content);
\r
86 if (thcycle!=tmcycle) {
\r
87 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._content); };
\r
88 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._content); };
\r
92 if (!this._content.equals(temp._content)) {
\r
93 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
94 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
97 org.castor.util.CycleBreaker.releaseCycleHandle(this._content);
\r
98 org.castor.util.CycleBreaker.releaseCycleHandle(temp._content);
\r
101 } else if (temp._content != null)
\r
103 if (this._dict != null) {
\r
104 if (temp._dict == null) return false;
\r
105 if (this._dict != temp._dict) {
\r
106 thcycle=org.castor.util.CycleBreaker.startingToCycle(this._dict);
\r
107 tmcycle=org.castor.util.CycleBreaker.startingToCycle(temp._dict);
\r
108 if (thcycle!=tmcycle) {
\r
109 if (!thcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(this._dict); };
\r
110 if (!tmcycle) { org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict); };
\r
114 if (!this._dict.equals(temp._dict)) {
\r
115 org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
\r
116 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
\r
119 org.castor.util.CycleBreaker.releaseCycleHandle(this._dict);
\r
120 org.castor.util.CycleBreaker.releaseCycleHandle(temp._dict);
\r
123 } else if (temp._dict != null)
\r
131 * Returns the value of field 'content'. The field 'content'
\r
132 * has the following description: internal content storage
\r
134 * @return the value of field 'Content'.
\r
136 public java.lang.String getContent(
\r
138 return this._content;
\r
142 * Returns the value of field 'dict'. The field 'dict' has the
\r
143 * following description: specifies the symbol dictionary for
\r
145 * glyph - eg utf8 (the default), aasecstr_3 or
\r
146 * kd_hydrophobicity - the content is not validated so
\r
147 * applications must ensure they gracefully deal with
\r
148 * invalid entries here
\r
150 * @return the value of field 'Dict'.
\r
152 public java.lang.String getDict(
\r
158 * Overrides the java.lang.Object.hashCode method.
\r
160 * The following steps came from <b>Effective Java Programming
\r
161 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
163 * @return a hash code value for the object.
\r
165 public int hashCode(
\r
167 int result = super.hashCode();
\r
170 if (_content != null
\r
171 && !org.castor.util.CycleBreaker.startingToCycle(_content)) {
\r
172 result = 37 * result + _content.hashCode();
\r
173 org.castor.util.CycleBreaker.releaseCycleHandle(_content);
\r
176 && !org.castor.util.CycleBreaker.startingToCycle(_dict)) {
\r
177 result = 37 * result + _dict.hashCode();
\r
178 org.castor.util.CycleBreaker.releaseCycleHandle(_dict);
\r
187 * @return true if this object is valid according to the schema
\r
189 public boolean isValid(
\r
193 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
203 * @throws org.exolab.castor.xml.MarshalException if object is
\r
204 * null or if any SAXException is thrown during marshaling
\r
205 * @throws org.exolab.castor.xml.ValidationException if this
\r
206 * object is an invalid instance according to the schema
\r
208 public void marshal(
\r
209 final java.io.Writer out)
\r
210 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
211 Marshaller.marshal(this, out);
\r
218 * @throws java.io.IOException if an IOException occurs during
\r
220 * @throws org.exolab.castor.xml.ValidationException if this
\r
221 * object is an invalid instance according to the schema
\r
222 * @throws org.exolab.castor.xml.MarshalException if object is
\r
223 * null or if any SAXException is thrown during marshaling
\r
225 public void marshal(
\r
226 final org.xml.sax.ContentHandler handler)
\r
227 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
228 Marshaller.marshal(this, handler);
\r
232 * Sets the value of field 'content'. The field 'content' has
\r
233 * the following description: internal content storage
\r
235 * @param content the value of field 'content'.
\r
237 public void setContent(
\r
238 final java.lang.String content) {
\r
239 this._content = content;
\r
243 * Sets the value of field 'dict'. The field 'dict' has the
\r
244 * following description: specifies the symbol dictionary for
\r
246 * glyph - eg utf8 (the default), aasecstr_3 or
\r
247 * kd_hydrophobicity - the content is not validated so
\r
248 * applications must ensure they gracefully deal with
\r
249 * invalid entries here
\r
251 * @param dict the value of field 'dict'.
\r
253 public void setDict(
\r
254 final java.lang.String dict) {
\r
259 * Method unmarshal.
\r
262 * @throws org.exolab.castor.xml.MarshalException if object is
\r
263 * null or if any SAXException is thrown during marshaling
\r
264 * @throws org.exolab.castor.xml.ValidationException if this
\r
265 * object is an invalid instance according to the schema
\r
266 * @return the unmarshaled uk.ac.vamsas.objects.core.Glyph
\r
268 public static uk.ac.vamsas.objects.core.Glyph unmarshal(
\r
269 final java.io.Reader reader)
\r
270 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
271 return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader);
\r
277 * @throws org.exolab.castor.xml.ValidationException if this
\r
278 * object is an invalid instance according to the schema
\r
280 public void validate(
\r
282 throws org.exolab.castor.xml.ValidationException {
\r
283 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
284 validator.validate(this);
\r