Statistics
| Revision:

root / trunk / applications / appCatalogAndGazetteerClient / src / es / gva / cit / gazetteer / querys / GazetteerQuery.java @ 15558

History | View | Annotate | Download (5.85 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.catalog.querys.Coordinates;
44
import es.gva.cit.catalog.querys.DiscoveryServiceQuery;
45
import es.gva.cit.catalog.utils.CatalogConstants;
46

    
47
/**
48
 * This class contains all the queryable fields that the user interface
49
 * supports.
50
 * @author Jorge Piera Llodra (piera_jor@gva.es)
51
 */
52
public class GazetteerQuery extends DiscoveryServiceQuery{
53
        private String name;
54
        private String nameFilter;
55
        private String fieldAttribute;
56
        private int recsByPage;
57
        private Coordinates coordinates;
58
        private String coordinatesFilter;
59
        private boolean isCoordinatesClicked;
60
        private GazetteerOptions options;
61
        public java.util.Collection thesaurusName = new java.util.ArrayList();
62
        
63

    
64
        /**
65
         * @param name 
66
         * @param nameFilter 
67
         * @param feature 
68
         * @param fieldAttribute 
69
         * @param recsByPage 
70
         * @param coordinates 
71
         * @param coordinatesFilter 
72
         */
73
        public GazetteerQuery(String name, String nameFilter, FeatureType[] feature, String fieldAttribute, int recsByPage, Coordinates coordinates, String coordinatesFilter) {        
74
                super();
75
                this.name = name;
76
                this.nameFilter = nameFilter;
77
                setFeatures(feature);
78
                this.fieldAttribute = fieldAttribute;
79
                this.recsByPage = recsByPage;
80
                this.coordinates = coordinates;
81
                this.coordinatesFilter = coordinatesFilter;
82
                options = new GazetteerOptions();
83
        } 
84

    
85
        /**
86
         * Constructor
87
         */
88
        public  GazetteerQuery() {        
89
                super();
90
                options = new GazetteerOptions();                
91
        } 
92

    
93
        /**
94
         * To search a place by name
95
         * @param name Place name
96
         * @param description Thesaurus description
97
         */
98
        public  GazetteerQuery(String name, String description) {        
99
                super();
100
                FeatureType[] thesaurus = new FeatureType[1];
101
                thesaurus[0] = new FeatureType();
102
                thesaurus[0].setName(description);
103
                this.name = name;
104
                this.nameFilter = CatalogConstants.ANY_WORD;
105
                setFeatures(thesaurus);
106
                this.recsByPage = 100;
107
                this.coordinates = null;
108
                this.coordinatesFilter = null;                
109
        } 
110

    
111
        /**
112
         * @return Returns the coordinates.
113
         */
114
        public Coordinates getCoordinates() {        
115
                return coordinates;
116
        } 
117

    
118
        /**
119
         * @param coordinates The coordinates to set.
120
         */
121
        public void setCoordinates(Coordinates coordinates) {        
122
                this.coordinates = coordinates;
123
        } 
124

    
125
        /**
126
         * @return Returns the coordinatesFilter.
127
         */
128
        public String getCoordinatesFilter() {        
129
                return coordinatesFilter;
130
        } 
131

    
132
        /**
133
         * @param coordinatesFilter The coordinatesFilter to set.
134
         */
135
        public void setCoordinatesFilter(String coordinatesFilter) {        
136
                this.coordinatesFilter = coordinatesFilter;
137
        } 
138

    
139
        /**
140
         * @return Returns the feature.
141
         */
142
        public FeatureType[] getFeatures() {        
143
                FeatureType[] aux = new FeatureType[thesaurusName.size()];
144
                for (int i=0 ; i<aux.length ; i++){
145
                        aux[i] = (FeatureType)thesaurusName.toArray()[i];
146
                }
147
                return aux;  
148
        } 
149

    
150
        /**
151
         * @param feature The feature to set.
152
         * @param features The feature to set.
153
         */
154
        public void setFeatures(FeatureType[] features) {        
155
                this.thesaurusName = new java.util.ArrayList();
156
                if (features == null){
157
                        return;
158
                }
159
                for (int i=0 ; i<features.length ; i++){
160
                        this.thesaurusName.add(features[i]);
161
                }     
162
        } 
163

    
164
        /**
165
         * @return Returns the name.
166
         */
167
        public String getName() {        
168
                return name;
169
        } 
170

    
171
        /**
172
         * @param name The name to set.
173
         */
174
        public void setName(String name) {        
175
                this.name = name;
176
        } 
177

    
178
        /**
179
         * @return Returns the nameFilter.
180
         */
181
        public String getNameFilter() {        
182
                return nameFilter;
183
        } 
184

    
185
        /**
186
         * @param nameFilter The nameFilter to set.
187
         */
188
        public void setNameFilter(String nameFilter) {        
189
                this.nameFilter = nameFilter;
190
        } 
191

    
192
        /**
193
         * @return Returns the recsByPage.
194
         */
195
        public int getRecsByPage() {        
196
                return recsByPage;
197
        } 
198

    
199
        /**
200
         * @param recsByPage The recsByPage to set.
201
         */
202
        public void setRecsByPage(int recsByPage) {        
203
                this.recsByPage = recsByPage;
204
        } 
205

    
206
        /**
207
         * @return Returns the fieldAttribute.
208
         */
209
        public String getFieldAttribute() {        
210
                return fieldAttribute;
211
        } 
212

    
213
        /**
214
         * @param fieldAttribute The fieldAttribute to set.
215
         */
216
        public void setFieldAttribute(String fieldAttribute) {        
217
                this.fieldAttribute = fieldAttribute;
218
        } 
219

    
220
        /**
221
         * @return Returns the isCoordinatesClicked.
222
         */
223
        public boolean isCoordinatesClicked() {        
224
                return isCoordinatesClicked;
225
        } 
226

    
227
        /**
228
         * @param isCoordinatesClicked The isCoordinatesClicked to set.
229
         */
230
        public void setCoordinatesClicked(boolean isCoordinatesClicked) {        
231
                this.isCoordinatesClicked = isCoordinatesClicked;
232
        }
233

    
234
        /**
235
         * @return the gaazetter options
236
         */        
237
        public GazetteerOptions getOptions() {
238
                return options;
239
        }
240

    
241
        /**
242
         * Set the options
243
         * @param options
244
         */
245
        public void setOptions(GazetteerOptions options) {
246
                this.options = options;
247
        }
248

    
249
}