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
79 if (this._content != null) {
\r
80 if (temp._content == null) return false;
\r
81 else if (!(this._content.equals(temp._content)))
\r
84 else if (temp._content != null)
\r
86 if (this._dict != null) {
\r
87 if (temp._dict == null) return false;
\r
88 else if (!(this._dict.equals(temp._dict)))
\r
91 else if (temp._dict != null)
\r
99 * Returns the value of field 'content'. The field 'content'
\r
100 * has the following description: internal content storage
\r
102 * @return the value of field 'Content'.
\r
104 public java.lang.String getContent(
\r
106 return this._content;
\r
110 * Returns the value of field 'dict'. The field 'dict' has the
\r
111 * following description: specifies the symbol dictionary for
\r
113 * glyph - eg utf8 (the default), aasecstr_3 or
\r
114 * kd_hydrophobicity - the content is not validated so
\r
115 * applications must ensure they gracefully deal with
\r
116 * invalid entries here
\r
118 * @return the value of field 'Dict'.
\r
120 public java.lang.String getDict(
\r
126 * Overrides the java.lang.Object.hashCode method.
\r
128 * The following steps came from <b>Effective Java Programming
\r
129 * Language Guide</b> by Joshua Bloch, Chapter 3
\r
131 * @return a hash code value for the object.
\r
133 public int hashCode(
\r
135 int result = super.hashCode();
\r
138 if (_content != null) {
\r
139 result = 37 * result + _content.hashCode();
\r
141 if (_dict != null) {
\r
142 result = 37 * result + _dict.hashCode();
\r
151 * @return true if this object is valid according to the schema
\r
153 public boolean isValid(
\r
157 } catch (org.exolab.castor.xml.ValidationException vex) {
\r
167 * @throws org.exolab.castor.xml.MarshalException if object is
\r
168 * null or if any SAXException is thrown during marshaling
\r
169 * @throws org.exolab.castor.xml.ValidationException if this
\r
170 * object is an invalid instance according to the schema
\r
172 public void marshal(
\r
173 final java.io.Writer out)
\r
174 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
175 Marshaller.marshal(this, out);
\r
182 * @throws java.io.IOException if an IOException occurs during
\r
184 * @throws org.exolab.castor.xml.ValidationException if this
\r
185 * object is an invalid instance according to the schema
\r
186 * @throws org.exolab.castor.xml.MarshalException if object is
\r
187 * null or if any SAXException is thrown during marshaling
\r
189 public void marshal(
\r
190 final org.xml.sax.ContentHandler handler)
\r
191 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
192 Marshaller.marshal(this, handler);
\r
196 * Sets the value of field 'content'. The field 'content' has
\r
197 * the following description: internal content storage
\r
199 * @param content the value of field 'content'.
\r
201 public void setContent(
\r
202 final java.lang.String content) {
\r
203 this._content = content;
\r
207 * Sets the value of field 'dict'. The field 'dict' has the
\r
208 * following description: specifies the symbol dictionary for
\r
210 * glyph - eg utf8 (the default), aasecstr_3 or
\r
211 * kd_hydrophobicity - the content is not validated so
\r
212 * applications must ensure they gracefully deal with
\r
213 * invalid entries here
\r
215 * @param dict the value of field 'dict'.
\r
217 public void setDict(
\r
218 final java.lang.String dict) {
\r
223 * Method unmarshal.
\r
226 * @throws org.exolab.castor.xml.MarshalException if object is
\r
227 * null or if any SAXException is thrown during marshaling
\r
228 * @throws org.exolab.castor.xml.ValidationException if this
\r
229 * object is an invalid instance according to the schema
\r
230 * @return the unmarshaled uk.ac.vamsas.objects.core.Glyph
\r
232 public static uk.ac.vamsas.objects.core.Glyph unmarshal(
\r
233 final java.io.Reader reader)
\r
234 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
\r
235 return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader);
\r
241 * @throws org.exolab.castor.xml.ValidationException if this
\r
242 * object is an invalid instance according to the schema
\r
244 public void validate(
\r
246 throws org.exolab.castor.xml.ValidationException {
\r
247 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
\r
248 validator.validate(this);
\r