refactored org to uk
[vamsas.git] / src / uk / ac / vamsas / objects / core / Glyph.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 0.9.9M2</a>, using an XML\r
4  * Schema.\r
5  * $Id$\r
6  */\r
7 \r
8 package uk.ac.vamsas.objects.core;\r
9 \r
10   //---------------------------------/\r
11  //- Imported classes and packages -/\r
12 //---------------------------------/\r
13 \r
14 import java.io.IOException;\r
15 import java.io.Reader;\r
16 import java.io.Serializable;\r
17 import java.io.Writer;\r
18 import org.exolab.castor.xml.MarshalException;\r
19 import org.exolab.castor.xml.Marshaller;\r
20 import org.exolab.castor.xml.Unmarshaller;\r
21 import org.exolab.castor.xml.ValidationException;\r
22 import org.xml.sax.ContentHandler;\r
23 \r
24 /**\r
25  * Discrete symbol - possibly graphically represented\r
26  *  \r
27  * \r
28  * @version $Revision$ $Date$\r
29  */\r
30 public class Glyph extends uk.ac.vamsas.client.Vobject \r
31 implements java.io.Serializable\r
32 {\r
33 \r
34 \r
35       //--------------------------/\r
36      //- Class/Member Variables -/\r
37     //--------------------------/\r
38 \r
39     /**\r
40      * internal content storage\r
41      */\r
42     private java.lang.String _content = "";\r
43 \r
44     /**\r
45      * specifies the symbol dictionary for this\r
46      *  glyph - eg utf8 (the default), aasecstr_3 or\r
47      *  kd_hydrophobicity - the content is not validated so\r
48      *  applications must ensure they gracefully deal with\r
49      *  invalid entries here \r
50      */\r
51     private java.lang.String _dict = "utf8";\r
52 \r
53 \r
54       //----------------/\r
55      //- Constructors -/\r
56     //----------------/\r
57 \r
58     public Glyph() \r
59      {\r
60         super();\r
61         setContent("");\r
62         setDict("utf8");\r
63     } //-- uk.ac.vamsas.objects.core.Glyph()\r
64 \r
65 \r
66       //-----------/\r
67      //- Methods -/\r
68     //-----------/\r
69 \r
70     /**\r
71      * Note: hashCode() has not been overriden\r
72      * \r
73      * @param obj\r
74      * @return boolean\r
75      */\r
76     public boolean equals(java.lang.Object obj)\r
77     {\r
78         if ( this == obj )\r
79             return true;\r
80         \r
81         if (super.equals(obj)==false)\r
82             return false;\r
83         \r
84         if (obj instanceof Glyph) {\r
85         \r
86             Glyph temp = (Glyph)obj;\r
87             if (this._content != null) {\r
88                 if (temp._content == null) return false;\r
89                 else if (!(this._content.equals(temp._content))) \r
90                     return false;\r
91             }\r
92             else if (temp._content != null)\r
93                 return false;\r
94             if (this._dict != null) {\r
95                 if (temp._dict == null) return false;\r
96                 else if (!(this._dict.equals(temp._dict))) \r
97                     return false;\r
98             }\r
99             else if (temp._dict != null)\r
100                 return false;\r
101             return true;\r
102         }\r
103         return false;\r
104     } //-- boolean equals(java.lang.Object) \r
105 \r
106     /**\r
107      * Returns the value of field 'content'. The field 'content'\r
108      * has the following description: internal content storage\r
109      * \r
110      * @return String\r
111      * @return the value of field 'content'.\r
112      */\r
113     public java.lang.String getContent()\r
114     {\r
115         return this._content;\r
116     } //-- java.lang.String getContent() \r
117 \r
118     /**\r
119      * Returns the value of field 'dict'. The field 'dict' has the\r
120      * following description: specifies the symbol dictionary for\r
121      * this\r
122      *  glyph - eg utf8 (the default), aasecstr_3 or\r
123      *  kd_hydrophobicity - the content is not validated so\r
124      *  applications must ensure they gracefully deal with\r
125      *  invalid entries here \r
126      * \r
127      * @return String\r
128      * @return the value of field 'dict'.\r
129      */\r
130     public java.lang.String getDict()\r
131     {\r
132         return this._dict;\r
133     } //-- java.lang.String getDict() \r
134 \r
135     /**\r
136      * Method isValid\r
137      * \r
138      * \r
139      * \r
140      * @return boolean\r
141      */\r
142     public boolean isValid()\r
143     {\r
144         try {\r
145             validate();\r
146         }\r
147         catch (org.exolab.castor.xml.ValidationException vex) {\r
148             return false;\r
149         }\r
150         return true;\r
151     } //-- boolean isValid() \r
152 \r
153     /**\r
154      * Method marshal\r
155      * \r
156      * \r
157      * \r
158      * @param out\r
159      */\r
160     public void marshal(java.io.Writer out)\r
161         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
162     {\r
163         \r
164         Marshaller.marshal(this, out);\r
165     } //-- void marshal(java.io.Writer) \r
166 \r
167     /**\r
168      * Method marshal\r
169      * \r
170      * \r
171      * \r
172      * @param handler\r
173      */\r
174     public void marshal(org.xml.sax.ContentHandler handler)\r
175         throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
176     {\r
177         \r
178         Marshaller.marshal(this, handler);\r
179     } //-- void marshal(org.xml.sax.ContentHandler) \r
180 \r
181     /**\r
182      * Sets the value of field 'content'. The field 'content' has\r
183      * the following description: internal content storage\r
184      * \r
185      * @param content the value of field 'content'.\r
186      */\r
187     public void setContent(java.lang.String content)\r
188     {\r
189         this._content = content;\r
190     } //-- void setContent(java.lang.String) \r
191 \r
192     /**\r
193      * Sets the value of field 'dict'. The field 'dict' has the\r
194      * following description: specifies the symbol dictionary for\r
195      * this\r
196      *  glyph - eg utf8 (the default), aasecstr_3 or\r
197      *  kd_hydrophobicity - the content is not validated so\r
198      *  applications must ensure they gracefully deal with\r
199      *  invalid entries here \r
200      * \r
201      * @param dict the value of field 'dict'.\r
202      */\r
203     public void setDict(java.lang.String dict)\r
204     {\r
205         this._dict = dict;\r
206     } //-- void setDict(java.lang.String) \r
207 \r
208     /**\r
209      * Method unmarshal\r
210      * \r
211      * \r
212      * \r
213      * @param reader\r
214      * @return Glyph\r
215      */\r
216     public static uk.ac.vamsas.objects.core.Glyph unmarshal(java.io.Reader reader)\r
217         throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException\r
218     {\r
219         return (uk.ac.vamsas.objects.core.Glyph) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Glyph.class, reader);\r
220     } //-- uk.ac.vamsas.objects.core.Glyph unmarshal(java.io.Reader) \r
221 \r
222     /**\r
223      * Method validate\r
224      * \r
225      */\r
226     public void validate()\r
227         throws org.exolab.castor.xml.ValidationException\r
228     {\r
229         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
230         validator.validate(this);\r
231     } //-- void validate() \r
232 \r
233 }\r