1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource.sia;
9
10
11
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 * Class SkySize.
26 *
27 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:30 $
28 */
29 public class SkySize extends org.astrogrid.common.bean.BaseBean
30 implements java.io.Serializable
31 {
32
33
34
35
36
37
38 /***
39 * The maximum size in the longitude (R.A.) direction
40 *
41 */
42 private float _long;
43
44 /***
45 * keeps track of state for field: _long
46 */
47 private boolean _has_long;
48
49 /***
50 * The maximum size in the latitdude (Dec.) direction
51 *
52 */
53 private float _lat;
54
55 /***
56 * keeps track of state for field: _lat
57 */
58 private boolean _has_lat;
59
60
61
62
63
64
65 public SkySize() {
66 super();
67 }
68
69
70
71
72
73
74 /***
75 * Note: hashCode() has not been overriden
76 *
77 * @param obj
78 */
79 public boolean equals(java.lang.Object obj)
80 {
81 if ( this == obj )
82 return true;
83
84 if (super.equals(obj)==false)
85 return false;
86
87 if (obj instanceof SkySize) {
88
89 SkySize temp = (SkySize)obj;
90 if (this._long != temp._long)
91 return false;
92 if (this._has_long != temp._has_long)
93 return false;
94 if (this._lat != temp._lat)
95 return false;
96 if (this._has_lat != temp._has_lat)
97 return false;
98 return true;
99 }
100 return false;
101 }
102
103 /***
104 * Returns the value of field 'lat'. The field 'lat' has the
105 * following description: The maximum size in the latitdude
106 * (Dec.) direction
107 *
108 *
109 * @return the value of field 'lat'.
110 */
111 public float getLat()
112 {
113 return this._lat;
114 }
115
116 /***
117 * Returns the value of field 'long'. The field 'long' has the
118 * following description: The maximum size in the longitude
119 * (R.A.) direction
120 *
121 *
122 * @return the value of field 'long'.
123 */
124 public float getLong()
125 {
126 return this._long;
127 }
128
129 /***
130 * Method hasLat
131 */
132 public boolean hasLat()
133 {
134 return this._has_lat;
135 }
136
137 /***
138 * Method hasLong
139 */
140 public boolean hasLong()
141 {
142 return this._has_long;
143 }
144
145 /***
146 * Method isValid
147 */
148 public boolean isValid()
149 {
150 try {
151 validate();
152 }
153 catch (org.exolab.castor.xml.ValidationException vex) {
154 return false;
155 }
156 return true;
157 }
158
159 /***
160 * Method marshal
161 *
162 * @param out
163 */
164 public void marshal(java.io.Writer out)
165 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
166 {
167
168 Marshaller.marshal(this, out);
169 }
170
171 /***
172 * Method marshal
173 *
174 * @param handler
175 */
176 public void marshal(org.xml.sax.ContentHandler handler)
177 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
178 {
179
180 Marshaller.marshal(this, handler);
181 }
182
183 /***
184 * Sets the value of field 'lat'. The field 'lat' has the
185 * following description: The maximum size in the latitdude
186 * (Dec.) direction
187 *
188 *
189 * @param lat the value of field 'lat'.
190 */
191 public void setLat(float lat)
192 {
193 this._lat = lat;
194 this._has_lat = true;
195 }
196
197 /***
198 * Sets the value of field 'long'. The field 'long' has the
199 * following description: The maximum size in the longitude
200 * (R.A.) direction
201 *
202 *
203 * @param _long
204 * @param long the value of field 'long'.
205 */
206 public void setLong(float _long)
207 {
208 this._long = _long;
209 this._has_long = true;
210 }
211
212 /***
213 * Method unmarshalSkySize
214 *
215 * @param reader
216 */
217 public static org.astrogrid.registry.beans.v10.resource.sia.SkySize unmarshalSkySize(java.io.Reader reader)
218 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
219 {
220 return (org.astrogrid.registry.beans.v10.resource.sia.SkySize) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.sia.SkySize.class, reader);
221 }
222
223 /***
224 * Method validate
225 */
226 public void validate()
227 throws org.exolab.castor.xml.ValidationException
228 {
229 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
230 validator.validate(this);
231 }
232
233 }