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