23d4f8204b0bcecba7da95a82968d589ba138126
[vamsas.git] / src / uk / ac / vamsas / objects / core / Newick.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package uk.ac.vamsas.objects.core;
9
10   //---------------------------------/
11  //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.xml.Marshaller;
15 import org.exolab.castor.xml.Unmarshaller;
16
17 /**
18  * Class Newick.
19  * 
20  * @version $Revision$ $Date$
21  */
22 public class Newick extends uk.ac.vamsas.client.Vobject 
23 implements java.io.Serializable
24 {
25
26
27       //--------------------------/
28      //- Class/Member Variables -/
29     //--------------------------/
30
31     /**
32      * internal content storage
33      */
34     private java.lang.String _content = "";
35
36     /**
37      * Field _title.
38      */
39     private java.lang.String _title;
40
41     /**
42      * Primary Key for vamsas object referencing
43      *  
44      */
45     private java.lang.String _id;
46
47     /**
48      * Field _modifiable.
49      */
50     private java.lang.String _modifiable;
51
52
53       //----------------/
54      //- Constructors -/
55     //----------------/
56
57     public Newick() {
58         super();
59         setContent("");
60     }
61
62
63       //-----------/
64      //- Methods -/
65     //-----------/
66
67     /**
68      * Overrides the java.lang.Object.equals method.
69      * 
70      * @param obj
71      * @return true if the objects are equal.
72      */
73     public boolean equals(
74             final java.lang.Object obj) {
75         if ( this == obj )
76             return true;
77         
78         if (super.equals(obj)==false)
79             return false;
80         
81         if (obj instanceof Newick) {
82         
83             Newick temp = (Newick)obj;
84             if (this._content != null) {
85                 if (temp._content == null) return false;
86                 else if (!(this._content.equals(temp._content))) 
87                     return false;
88             }
89             else if (temp._content != null)
90                 return false;
91             if (this._title != null) {
92                 if (temp._title == null) return false;
93                 else if (!(this._title.equals(temp._title))) 
94                     return false;
95             }
96             else if (temp._title != null)
97                 return false;
98             if (this._id != null) {
99                 if (temp._id == null) return false;
100                 else if (!(this._id.equals(temp._id))) 
101                     return false;
102             }
103             else if (temp._id != null)
104                 return false;
105             if (this._modifiable != null) {
106                 if (temp._modifiable == null) return false;
107                 else if (!(this._modifiable.equals(temp._modifiable))) 
108                     return false;
109             }
110             else if (temp._modifiable != null)
111                 return false;
112             return true;
113         }
114         return false;
115     }
116
117     /**
118      * Returns the value of field 'content'. The field 'content'
119      * has the following description: internal content storage
120      * 
121      * @return the value of field 'Content'.
122      */
123     public java.lang.String getContent(
124     ) {
125         return this._content;
126     }
127
128     /**
129      * Returns the value of field 'id'. The field 'id' has the
130      * following description: Primary Key for vamsas object
131      * referencing
132      *  
133      * 
134      * @return the value of field 'Id'.
135      */
136     public java.lang.String getId(
137     ) {
138         return this._id;
139     }
140
141     /**
142      * Returns the value of field 'modifiable'.
143      * 
144      * @return the value of field 'Modifiable'.
145      */
146     public java.lang.String getModifiable(
147     ) {
148         return this._modifiable;
149     }
150
151     /**
152      * Returns the value of field 'title'.
153      * 
154      * @return the value of field 'Title'.
155      */
156     public java.lang.String getTitle(
157     ) {
158         return this._title;
159     }
160
161     /**
162      * Overrides the java.lang.Object.hashCode method.
163      * <p>
164      * The following steps came from <b>Effective Java Programming
165      * Language Guide</b> by Joshua Bloch, Chapter 3
166      * 
167      * @return a hash code value for the object.
168      */
169     public int hashCode(
170     ) {
171         int result = super.hashCode();
172         
173         long tmp;
174         if (_content != null) {
175            result = 37 * result + _content.hashCode();
176         }
177         if (_title != null) {
178            result = 37 * result + _title.hashCode();
179         }
180         if (_id != null) {
181            result = 37 * result + _id.hashCode();
182         }
183         if (_modifiable != null) {
184            result = 37 * result + _modifiable.hashCode();
185         }
186         
187         return result;
188     }
189
190     /**
191      * Method isValid.
192      * 
193      * @return true if this object is valid according to the schema
194      */
195     public boolean isValid(
196     ) {
197         try {
198             validate();
199         } catch (org.exolab.castor.xml.ValidationException vex) {
200             return false;
201         }
202         return true;
203     }
204
205     /**
206      * 
207      * 
208      * @param out
209      * @throws org.exolab.castor.xml.MarshalException if object is
210      * null or if any SAXException is thrown during marshaling
211      * @throws org.exolab.castor.xml.ValidationException if this
212      * object is an invalid instance according to the schema
213      */
214     public void marshal(
215             final java.io.Writer out)
216     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
217         Marshaller.marshal(this, out);
218     }
219
220     /**
221      * 
222      * 
223      * @param handler
224      * @throws java.io.IOException if an IOException occurs during
225      * marshaling
226      * @throws org.exolab.castor.xml.ValidationException if this
227      * object is an invalid instance according to the schema
228      * @throws org.exolab.castor.xml.MarshalException if object is
229      * null or if any SAXException is thrown during marshaling
230      */
231     public void marshal(
232             final org.xml.sax.ContentHandler handler)
233     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
234         Marshaller.marshal(this, handler);
235     }
236
237     /**
238      * Sets the value of field 'content'. The field 'content' has
239      * the following description: internal content storage
240      * 
241      * @param content the value of field 'content'.
242      */
243     public void setContent(
244             final java.lang.String content) {
245         this._content = content;
246     }
247
248     /**
249      * Sets the value of field 'id'. The field 'id' has the
250      * following description: Primary Key for vamsas object
251      * referencing
252      *  
253      * 
254      * @param id the value of field 'id'.
255      */
256     public void setId(
257             final java.lang.String id) {
258         this._id = id;
259     }
260
261     /**
262      * Sets the value of field 'modifiable'.
263      * 
264      * @param modifiable the value of field 'modifiable'.
265      */
266     public void setModifiable(
267             final java.lang.String modifiable) {
268         this._modifiable = modifiable;
269     }
270
271     /**
272      * Sets the value of field 'title'.
273      * 
274      * @param title the value of field 'title'.
275      */
276     public void setTitle(
277             final java.lang.String title) {
278         this._title = title;
279     }
280
281     /**
282      * Method unmarshal.
283      * 
284      * @param reader
285      * @throws org.exolab.castor.xml.MarshalException if object is
286      * null or if any SAXException is thrown during marshaling
287      * @throws org.exolab.castor.xml.ValidationException if this
288      * object is an invalid instance according to the schema
289      * @return the unmarshaled uk.ac.vamsas.objects.core.Newick
290      */
291     public static uk.ac.vamsas.objects.core.Newick unmarshal(
292             final java.io.Reader reader)
293     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
294         return (uk.ac.vamsas.objects.core.Newick) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Newick.class, reader);
295     }
296
297     /**
298      * 
299      * 
300      * @throws org.exolab.castor.xml.ValidationException if this
301      * object is an invalid instance according to the schema
302      */
303     public void validate(
304     )
305     throws org.exolab.castor.xml.ValidationException {
306         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
307         validator.validate(this);
308     }
309
310 }