1
2
3
4
5
6
7
8 package org.astrogrid.registry.beans.v10.resource.conesearch;
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 capabilities of a Cone Search implementation. It includes
26 * the listing of the columns that appear in image query
27 * output VOTable and Cone Search-specific metadata.
28 *
29 *
30 * @version $Revision: 1.2 $ $Date: 2007/01/04 16:26:33 $
31 */
32 public class ConeSearchCapability extends org.astrogrid.registry.beans.v10.resource.conesearch.CSCapRestriction
33 implements java.io.Serializable
34 {
35
36
37
38
39
40
41 /***
42 * The largest search radius, in degrees, that will be
43 * accepted by the service without returning an error
44 * condition.
45 *
46 */
47 private float _maxSR;
48
49 /***
50 * keeps track of state for field: _maxSR
51 */
52 private boolean _has_maxSR;
53
54 /***
55 * The largest number of records that the service will
56 * return.
57 *
58 */
59 private int _maxRecords;
60
61 /***
62 * keeps track of state for field: _maxRecords
63 */
64 private boolean _has_maxRecords;
65
66 /***
67 * True if the service supports the VERB keyword;
68 * false, otherwise.
69 *
70 */
71 private boolean _verbosity;
72
73 /***
74 * keeps track of state for field: _verbosity
75 */
76 private boolean _has_verbosity;
77
78
79
80
81
82
83 public ConeSearchCapability() {
84 super();
85 }
86
87
88
89
90
91
92 /***
93 * Note: hashCode() has not been overriden
94 *
95 * @param obj
96 */
97 public boolean equals(java.lang.Object obj)
98 {
99 if ( this == obj )
100 return true;
101
102 if (super.equals(obj)==false)
103 return false;
104
105 if (obj instanceof ConeSearchCapability) {
106
107 ConeSearchCapability temp = (ConeSearchCapability)obj;
108 if (this._maxSR != temp._maxSR)
109 return false;
110 if (this._has_maxSR != temp._has_maxSR)
111 return false;
112 if (this._maxRecords != temp._maxRecords)
113 return false;
114 if (this._has_maxRecords != temp._has_maxRecords)
115 return false;
116 if (this._verbosity != temp._verbosity)
117 return false;
118 if (this._has_verbosity != temp._has_verbosity)
119 return false;
120 return true;
121 }
122 return false;
123 }
124
125 /***
126 * Returns the value of field 'maxRecords'. The field
127 * 'maxRecords' has the following description: The largest
128 * number of records that the service will
129 * return.
130 *
131 *
132 * @return the value of field 'maxRecords'.
133 */
134 public int getMaxRecords()
135 {
136 return this._maxRecords;
137 }
138
139 /***
140 * Returns the value of field 'maxSR'. The field 'maxSR' has
141 * the following description: The largest search radius, in
142 * degrees, that will be
143 * accepted by the service without returning an error
144 * condition.
145 *
146 *
147 * @return the value of field 'maxSR'.
148 */
149 public float getMaxSR()
150 {
151 return this._maxSR;
152 }
153
154 /***
155 * Returns the value of field 'verbosity'. The field
156 * 'verbosity' has the following description: True if the
157 * service supports the VERB keyword;
158 * false, otherwise.
159 *
160 *
161 * @return the value of field 'verbosity'.
162 */
163 public boolean getVerbosity()
164 {
165 return this._verbosity;
166 }
167
168 /***
169 * Method hasMaxRecords
170 */
171 public boolean hasMaxRecords()
172 {
173 return this._has_maxRecords;
174 }
175
176 /***
177 * Method hasMaxSR
178 */
179 public boolean hasMaxSR()
180 {
181 return this._has_maxSR;
182 }
183
184 /***
185 * Method hasVerbosity
186 */
187 public boolean hasVerbosity()
188 {
189 return this._has_verbosity;
190 }
191
192 /***
193 * Method isValid
194 */
195 public boolean isValid()
196 {
197 try {
198 validate();
199 }
200 catch (org.exolab.castor.xml.ValidationException vex) {
201 return false;
202 }
203 return true;
204 }
205
206 /***
207 * Method marshal
208 *
209 * @param out
210 */
211 public void marshal(java.io.Writer out)
212 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
213 {
214
215 Marshaller.marshal(this, out);
216 }
217
218 /***
219 * Method marshal
220 *
221 * @param handler
222 */
223 public void marshal(org.xml.sax.ContentHandler handler)
224 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
225 {
226
227 Marshaller.marshal(this, handler);
228 }
229
230 /***
231 * Sets the value of field 'maxRecords'. The field 'maxRecords'
232 * has the following description: The largest number of records
233 * that the service will
234 * return.
235 *
236 *
237 * @param maxRecords the value of field 'maxRecords'.
238 */
239 public void setMaxRecords(int maxRecords)
240 {
241 this._maxRecords = maxRecords;
242 this._has_maxRecords = true;
243 }
244
245 /***
246 * Sets the value of field 'maxSR'. The field 'maxSR' has the
247 * following description: The largest search radius, in
248 * degrees, that will be
249 * accepted by the service without returning an error
250 * condition.
251 *
252 *
253 * @param maxSR the value of field 'maxSR'.
254 */
255 public void setMaxSR(float maxSR)
256 {
257 this._maxSR = maxSR;
258 this._has_maxSR = true;
259 }
260
261 /***
262 * Sets the value of field 'verbosity'. The field 'verbosity'
263 * has the following description: True if the service supports
264 * the VERB keyword;
265 * false, otherwise.
266 *
267 *
268 * @param verbosity the value of field 'verbosity'.
269 */
270 public void setVerbosity(boolean verbosity)
271 {
272 this._verbosity = verbosity;
273 this._has_verbosity = true;
274 }
275
276 /***
277 * Method unmarshalConeSearchCapability
278 *
279 * @param reader
280 */
281 public static org.astrogrid.registry.beans.v10.resource.conesearch.ConeSearchCapability unmarshalConeSearchCapability(java.io.Reader reader)
282 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
283 {
284 return (org.astrogrid.registry.beans.v10.resource.conesearch.ConeSearchCapability) Unmarshaller.unmarshal(org.astrogrid.registry.beans.v10.resource.conesearch.ConeSearchCapability.class, reader);
285 }
286
287 /***
288 * Method validate
289 */
290 public void validate()
291 throws org.exolab.castor.xml.ValidationException
292 {
293 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
294 validator.validate(this);
295 }
296
297 }