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