root / tags / Root_v061 / applications / appCatalogYNomenclatorClient / src / es / gva / cit / gazetteer / querys / Query.java @ 4812
History | View | Annotate | Download (6.69 KB)
1 |
|
---|---|
2 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
3 |
*
|
4 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* Generalitat Valenciana
|
23 |
* Conselleria d'Infraestructures i Transport
|
24 |
* Av. Blasco Ib??ez, 50
|
25 |
* 46010 VALENCIA
|
26 |
* SPAIN
|
27 |
*
|
28 |
* +34 963862235
|
29 |
* gvsig@gva.es
|
30 |
* www.gvsig.gva.es
|
31 |
*
|
32 |
* or
|
33 |
*
|
34 |
* IVER T.I. S.A
|
35 |
* Salamanca 50
|
36 |
* 46005 Valencia
|
37 |
* Spain
|
38 |
*
|
39 |
* +34 963163400
|
40 |
* dac@iver.es
|
41 |
*/
|
42 |
package es.gva.cit.gazetteer.querys; |
43 |
import es.gva.cit.catalogClient.querys.Coordinates; |
44 |
import es.gva.cit.catalogClient.traductor.ITranslator; |
45 |
|
46 |
/**
|
47 |
* This class contains all the queryable fields that the user interface
|
48 |
* supports.
|
49 |
*
|
50 |
*
|
51 |
* @author Jorge Piera Llodra (piera_jor@gva.es)
|
52 |
*/
|
53 |
public class Query { |
54 |
|
55 |
/**
|
56 |
*
|
57 |
*
|
58 |
*/
|
59 |
private String name; |
60 |
|
61 |
/**
|
62 |
*
|
63 |
*
|
64 |
*/
|
65 |
private String nameFilter; |
66 |
|
67 |
/**
|
68 |
*
|
69 |
*
|
70 |
*/
|
71 |
private String fieldAttribute; |
72 |
|
73 |
/**
|
74 |
*
|
75 |
*
|
76 |
*/
|
77 |
private int recsByPage; |
78 |
/**
|
79 |
*
|
80 |
*
|
81 |
*/
|
82 |
private Coordinates coordinates;
|
83 |
|
84 |
/**
|
85 |
*
|
86 |
*
|
87 |
*/
|
88 |
private String coordinatesFilter; |
89 |
|
90 |
/**
|
91 |
*
|
92 |
*
|
93 |
*/
|
94 |
private boolean isCoordinatesClicked; |
95 |
|
96 |
/**
|
97 |
*
|
98 |
*
|
99 |
*/
|
100 |
private GazetteerOptions options;
|
101 |
|
102 |
|
103 |
/**
|
104 |
*
|
105 |
*
|
106 |
*/
|
107 |
public java.util.Collection thesaurusName = new java.util.ArrayList(); |
108 |
/**
|
109 |
*
|
110 |
*
|
111 |
*/
|
112 |
private ITranslator translator;
|
113 |
|
114 |
/**
|
115 |
*
|
116 |
*
|
117 |
*
|
118 |
* @param name
|
119 |
* @param nameFilter
|
120 |
* @param feature
|
121 |
* @param fieldAttribute
|
122 |
* @param recsByPage
|
123 |
* @param coordinates
|
124 |
* @param coordinatesFilter
|
125 |
*/
|
126 |
public Query(String name, String nameFilter, ThesaurusName[] feature, String fieldAttribute, int recsByPage, Coordinates coordinates, String coordinatesFilter) { |
127 |
super();
|
128 |
this.name = name;
|
129 |
this.nameFilter = nameFilter;
|
130 |
setFeatures(feature); |
131 |
this.fieldAttribute = fieldAttribute;
|
132 |
this.recsByPage = recsByPage;
|
133 |
this.coordinates = coordinates;
|
134 |
this.coordinatesFilter = coordinatesFilter;
|
135 |
options = new GazetteerOptions();
|
136 |
} |
137 |
|
138 |
/**
|
139 |
*
|
140 |
*
|
141 |
*/
|
142 |
public Query() { |
143 |
super();
|
144 |
options = new GazetteerOptions();
|
145 |
} |
146 |
|
147 |
/**
|
148 |
* To search a place by name
|
149 |
*
|
150 |
*
|
151 |
* @param name Place name
|
152 |
* @param description Thesaurus description
|
153 |
*/
|
154 |
public Query(String name, String description) { |
155 |
ThesaurusName[] thesaurus = new ThesaurusName[1]; |
156 |
thesaurus[0] = new ThesaurusName(); |
157 |
thesaurus[0].setName(description);
|
158 |
this.name = name;
|
159 |
this.nameFilter = "Y"; |
160 |
setFeatures(thesaurus); |
161 |
this.recsByPage = 100; |
162 |
this.coordinates = null; |
163 |
this.coordinatesFilter = null; |
164 |
|
165 |
|
166 |
} |
167 |
|
168 |
/**
|
169 |
*
|
170 |
*
|
171 |
*
|
172 |
* @return Returns the coordinates.
|
173 |
*/
|
174 |
public Coordinates getCoordinates() {
|
175 |
return coordinates;
|
176 |
} |
177 |
|
178 |
/**
|
179 |
*
|
180 |
*
|
181 |
*
|
182 |
* @param coordinates The coordinates to set.
|
183 |
*/
|
184 |
public void setCoordinates(Coordinates coordinates) { |
185 |
this.coordinates = coordinates;
|
186 |
} |
187 |
|
188 |
/**
|
189 |
*
|
190 |
*
|
191 |
*
|
192 |
* @return Returns the coordinatesFilter.
|
193 |
*/
|
194 |
public String getCoordinatesFilter() { |
195 |
return coordinatesFilter;
|
196 |
} |
197 |
|
198 |
/**
|
199 |
*
|
200 |
*
|
201 |
*
|
202 |
* @param coordinatesFilter The coordinatesFilter to set.
|
203 |
*/
|
204 |
public void setCoordinatesFilter(String coordinatesFilter) { |
205 |
this.coordinatesFilter = coordinatesFilter;
|
206 |
} |
207 |
|
208 |
/**
|
209 |
*
|
210 |
*
|
211 |
*
|
212 |
* @return Returns the feature.
|
213 |
*/
|
214 |
public ThesaurusName[] getFeatures() { |
215 |
ThesaurusName[] aux = new ThesaurusName[thesaurusName.size()]; |
216 |
for (int i=0 ; i<aux.length ; i++){ |
217 |
aux[i] = (ThesaurusName)thesaurusName.toArray()[i]; |
218 |
} |
219 |
return aux;
|
220 |
} |
221 |
|
222 |
/**
|
223 |
* @param feature The feature to set.
|
224 |
*
|
225 |
*
|
226 |
* @param features The feature to set.
|
227 |
*/
|
228 |
public void setFeatures(ThesaurusName[] features) { |
229 |
this.thesaurusName = new java.util.ArrayList(); |
230 |
if (features == null){ |
231 |
return;
|
232 |
} |
233 |
for (int i=0 ; i<features.length ; i++){ |
234 |
this.thesaurusName.add(features[i]);
|
235 |
} |
236 |
} |
237 |
|
238 |
/**
|
239 |
*
|
240 |
*
|
241 |
*
|
242 |
* @return Returns the name.
|
243 |
*/
|
244 |
public String getName() { |
245 |
return name;
|
246 |
} |
247 |
|
248 |
/**
|
249 |
*
|
250 |
*
|
251 |
*
|
252 |
* @param name The name to set.
|
253 |
*/
|
254 |
public void setName(String name) { |
255 |
this.name = name;
|
256 |
} |
257 |
|
258 |
/**
|
259 |
*
|
260 |
*
|
261 |
*
|
262 |
* @return Returns the nameFilter.
|
263 |
*/
|
264 |
public String getNameFilter() { |
265 |
return nameFilter;
|
266 |
} |
267 |
|
268 |
/**
|
269 |
*
|
270 |
*
|
271 |
*
|
272 |
* @param nameFilter The nameFilter to set.
|
273 |
*/
|
274 |
public void setNameFilter(String nameFilter) { |
275 |
this.nameFilter = nameFilter;
|
276 |
} |
277 |
|
278 |
/**
|
279 |
*
|
280 |
*
|
281 |
*
|
282 |
* @return Returns the recsByPage.
|
283 |
*/
|
284 |
public int getRecsByPage() { |
285 |
return recsByPage;
|
286 |
} |
287 |
|
288 |
/**
|
289 |
*
|
290 |
*
|
291 |
*
|
292 |
* @param recsByPage The recsByPage to set.
|
293 |
*/
|
294 |
public void setRecsByPage(int recsByPage) { |
295 |
this.recsByPage = recsByPage;
|
296 |
} |
297 |
|
298 |
/**
|
299 |
*
|
300 |
*
|
301 |
*
|
302 |
* @return Returns the fieldAttribute.
|
303 |
*/
|
304 |
public String getFieldAttribute() { |
305 |
return fieldAttribute;
|
306 |
} |
307 |
|
308 |
/**
|
309 |
*
|
310 |
*
|
311 |
*
|
312 |
* @param fieldAttribute The fieldAttribute to set.
|
313 |
*/
|
314 |
public void setFieldAttribute(String fieldAttribute) { |
315 |
this.fieldAttribute = fieldAttribute;
|
316 |
} |
317 |
|
318 |
/**
|
319 |
*
|
320 |
*
|
321 |
*
|
322 |
* @return Returns the isCoordinatesClicked.
|
323 |
*/
|
324 |
public boolean isCoordinatesClicked() { |
325 |
return isCoordinatesClicked;
|
326 |
} |
327 |
|
328 |
/**
|
329 |
*
|
330 |
*
|
331 |
*
|
332 |
* @param isCoordinatesClicked The isCoordinatesClicked to set.
|
333 |
*/
|
334 |
public void setCoordinatesClicked(boolean isCoordinatesClicked) { |
335 |
this.isCoordinatesClicked = isCoordinatesClicked;
|
336 |
} |
337 |
|
338 |
|
339 |
/**
|
340 |
*
|
341 |
*
|
342 |
*
|
343 |
* @return Returns the translator.
|
344 |
*/
|
345 |
public ITranslator getTranslator() {
|
346 |
return translator;
|
347 |
} |
348 |
|
349 |
/**
|
350 |
*
|
351 |
*
|
352 |
*
|
353 |
* @param translator The translator to set.
|
354 |
*/
|
355 |
public void setTranslator(ITranslator translator) { |
356 |
this.translator = translator;
|
357 |
} |
358 |
|
359 |
public GazetteerOptions getOptions() {
|
360 |
return options;
|
361 |
} |
362 |
|
363 |
public void setOptions(GazetteerOptions options) { |
364 |
this.options = options;
|
365 |
} |
366 |
|
367 |
|
368 |
|
369 |
} |