5d8b2b3e776e5e8dca2c58e4b5ff4fa95609a82a
[vamsas.git] / src / uk / ac / vamsas / objects / core / Input.java
1 /*\r
2  * This class was automatically generated with \r
3  * <a href="http://www.castor.org">Castor 1.1</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 org.exolab.castor.xml.Marshaller;\r
15 import org.exolab.castor.xml.Unmarshaller;\r
16 \r
17 /**\r
18  * Class Input.\r
19  * \r
20  * @version $Revision$ $Date$\r
21  */\r
22 public class Input extends uk.ac.vamsas.objects.core.RangeType \r
23 implements java.io.Serializable\r
24 {\r
25 \r
26 \r
27       //--------------------------/\r
28      //- Class/Member Variables -/\r
29     //--------------------------/\r
30 \r
31     /**\r
32      * Field _name.\r
33      */\r
34     private java.lang.String _name;\r
35 \r
36     /**\r
37      * Reference Frame for rangeType specfication\r
38      *  \r
39      */\r
40     private java.lang.Object _objRef;\r
41 \r
42 \r
43       //----------------/\r
44      //- Constructors -/\r
45     //----------------/\r
46 \r
47     public Input() {\r
48         super();\r
49     }\r
50 \r
51 \r
52       //-----------/\r
53      //- Methods -/\r
54     //-----------/\r
55 \r
56     /**\r
57      * Overrides the java.lang.Object.equals method.\r
58      * \r
59      * @param obj\r
60      * @return true if the objects are equal.\r
61      */\r
62     public boolean equals(\r
63             final java.lang.Object obj) {\r
64         if ( this == obj )\r
65             return true;\r
66         \r
67         if (super.equals(obj)==false)\r
68             return false;\r
69         \r
70         if (obj instanceof Input) {\r
71         \r
72             Input temp = (Input)obj;\r
73             if (this._name != null) {\r
74                 if (temp._name == null) return false;\r
75                 else if (!(this._name.equals(temp._name))) \r
76                     return false;\r
77             }\r
78             else if (temp._name != null)\r
79                 return false;\r
80             if (this._objRef != null) {\r
81                 if (temp._objRef == null) return false;\r
82                 else if (!(this._objRef.equals(temp._objRef))) \r
83                     return false;\r
84             }\r
85             else if (temp._objRef != null)\r
86                 return false;\r
87             return true;\r
88         }\r
89         return false;\r
90     }\r
91 \r
92     /**\r
93      * Returns the value of field 'name'.\r
94      * \r
95      * @return the value of field 'Name'.\r
96      */\r
97     public java.lang.String getName(\r
98     ) {\r
99         return this._name;\r
100     }\r
101 \r
102     /**\r
103      * Returns the value of field 'objRef'. The field 'objRef' has\r
104      * the following description: Reference Frame for rangeType\r
105      * specfication\r
106      *  \r
107      * \r
108      * @return the value of field 'ObjRef'.\r
109      */\r
110     public java.lang.Object getObjRef(\r
111     ) {\r
112         return this._objRef;\r
113     }\r
114 \r
115     /**\r
116      * Overrides the java.lang.Object.hashCode method.\r
117      * <p>\r
118      * The following steps came from <b>Effective Java Programming\r
119      * Language Guide</b> by Joshua Bloch, Chapter 3\r
120      * \r
121      * @return a hash code value for the object.\r
122      */\r
123     public int hashCode(\r
124     ) {\r
125         int result = super.hashCode();\r
126         \r
127         long tmp;\r
128         if (_name != null) {\r
129            result = 37 * result + _name.hashCode();\r
130         }\r
131         if (_objRef != null) {\r
132            result = 37 * result + _objRef.hashCode();\r
133         }\r
134         \r
135         return result;\r
136     }\r
137 \r
138     /**\r
139      * Method isValid.\r
140      * \r
141      * @return true if this object is valid according to the schema\r
142      */\r
143     public boolean isValid(\r
144     ) {\r
145         try {\r
146             validate();\r
147         } catch (org.exolab.castor.xml.ValidationException vex) {\r
148             return false;\r
149         }\r
150         return true;\r
151     }\r
152 \r
153     /**\r
154      * \r
155      * \r
156      * @param out\r
157      * @throws org.exolab.castor.xml.MarshalException if object is\r
158      * null or if any SAXException is thrown during marshaling\r
159      * @throws org.exolab.castor.xml.ValidationException if this\r
160      * object is an invalid instance according to the schema\r
161      */\r
162     public void marshal(\r
163             final java.io.Writer out)\r
164     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
165         Marshaller.marshal(this, out);\r
166     }\r
167 \r
168     /**\r
169      * \r
170      * \r
171      * @param handler\r
172      * @throws java.io.IOException if an IOException occurs during\r
173      * marshaling\r
174      * @throws org.exolab.castor.xml.ValidationException if this\r
175      * object is an invalid instance according to the schema\r
176      * @throws org.exolab.castor.xml.MarshalException if object is\r
177      * null or if any SAXException is thrown during marshaling\r
178      */\r
179     public void marshal(\r
180             final org.xml.sax.ContentHandler handler)\r
181     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
182         Marshaller.marshal(this, handler);\r
183     }\r
184 \r
185     /**\r
186      * Sets the value of field 'name'.\r
187      * \r
188      * @param name the value of field 'name'.\r
189      */\r
190     public void setName(\r
191             final java.lang.String name) {\r
192         this._name = name;\r
193     }\r
194 \r
195     /**\r
196      * Sets the value of field 'objRef'. The field 'objRef' has the\r
197      * following description: Reference Frame for rangeType\r
198      * specfication\r
199      *  \r
200      * \r
201      * @param objRef the value of field 'objRef'.\r
202      */\r
203     public void setObjRef(\r
204             final java.lang.Object objRef) {\r
205         this._objRef = objRef;\r
206     }\r
207 \r
208     /**\r
209      * Method unmarshal.\r
210      * \r
211      * @param reader\r
212      * @throws org.exolab.castor.xml.MarshalException if object is\r
213      * null or if any SAXException is thrown during marshaling\r
214      * @throws org.exolab.castor.xml.ValidationException if this\r
215      * object is an invalid instance according to the schema\r
216      * @return the unmarshaled uk.ac.vamsas.objects.core.RangeType\r
217      */\r
218     public static uk.ac.vamsas.objects.core.RangeType unmarshal(\r
219             final java.io.Reader reader)\r
220     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {\r
221         return (uk.ac.vamsas.objects.core.RangeType) Unmarshaller.unmarshal(uk.ac.vamsas.objects.core.Input.class, reader);\r
222     }\r
223 \r
224     /**\r
225      * \r
226      * \r
227      * @throws org.exolab.castor.xml.ValidationException if this\r
228      * object is an invalid instance according to the schema\r
229      */\r
230     public void validate(\r
231     )\r
232     throws org.exolab.castor.xml.ValidationException {\r
233         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
234         validator.validate(this);\r
235     }\r
236 \r
237 }\r