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