Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / querys / Query.java @ 2658

History | View | Annotate | Download (4.63 KB)

1
package es.gva.cit.catalogClient.querys;
2

    
3

    
4

    
5
/**
6
 * @author Jorge
7
 *
8
 * TODO This class represents a 'query'. Its atributes are all the fields that 
9
 * exist in the search form
10
 * 
11
 */
12
public class Query {
13
    private String title;
14
    private String titleFilter;
15
    private String abstract_;   
16
    private String themeKey;
17
    private String topic;
18
    private String scale;
19
    private String provider;
20
    private String DateFrom;
21
    private String DateTo;
22
    private Coordinates coordinates;
23
    private String coordinatesFilter;
24
          
25
    /**
26
         * @param title
27
         * @param titleFilter
28
         * @param abstract_
29
         * @param themeKey
30
         * @param topic
31
         * @param scale
32
         * @param provider
33
         * @param dateFrom
34
         * @param dateTo
35
         * @param coordinates
36
         * @param coordinatesFilter
37
         */
38
        public Query(String title,
39
                        String titleFilter,
40
                        String abstract_,
41
                        String themeKey,
42
                        String topic, 
43
                        String scale,
44
                        String provider,
45
                        String dateFrom,
46
                        String dateTo,
47
                        Coordinates coordinates,
48
                        String coordinatesFilter) {
49
                super();
50
                this.title = title;
51
                this.titleFilter = titleFilter;
52
                this.abstract_ = abstract_;
53
                this.themeKey = themeKey;
54
                this.topic = topic;
55
                this.scale = scale;
56
                this.provider = provider;
57
                //Date
58
                this.DateFrom = dateFrom;
59
                this.DateTo = dateTo;
60
                //Coordinates
61
                this.coordinates = coordinates;
62
                if (this.coordinates != null){
63
                        if (this.coordinates.getUlx().equals("") || 
64
                                this.coordinates.getUlx().equals("") ||
65
                                this.coordinates.getBrx().equals("") ||
66
                                this.coordinates.getBry().equals(""))
67
                                this.coordinates = null;
68
                        else{
69
                                try{
70
                                        Double.parseDouble(this.coordinates.getUlx());
71
                                        Double.parseDouble(this.coordinates.getUlx());
72
                                        Double.parseDouble(this.coordinates.getBrx());
73
                                        Double.parseDouble(this.coordinates.getBry());
74
                                        this.coordinates = coordinates;
75
                                }catch(Exception e){
76
                                        this.coordinates = null;
77
                                        System.out.println("JJ");
78
                                }
79
                        }
80
                }
81
                this.coordinatesFilter = coordinatesFilter;
82
        }
83

    
84
    
85
        /**
86
         * Return logic operators
87
         * 
88
         * @param titleKeys
89
         *                 E,A o Y --> Exact, All, anY
90
         * @return String
91
         *                 
92
         */
93
        public String getOperator(String concordancia){
94
                if (concordancia.equals("Y"))
95
                        return "Or";
96
                else
97
                        return "And";
98
        }
99
        /**
100
         * @return Returns the abstract_.
101
         */
102
        public String getAbstract() {
103
                return abstract_;
104
        }
105
        /**
106
         * @param abstract_ The abstract_ to set.
107
         */
108
        public void setAbstract(String abstract_) {
109
                this.abstract_ = abstract_;
110
        }
111
        /**
112
         * @return Returns the coordinates.
113
         */
114
        public Coordinates getCoordenates() {
115
                return coordinates;
116
        }
117
        /**
118
         * @param coordenates The coordinates to set.
119
         */
120
        public void setCoordenates(Coordinates coordenates) {
121
                this.coordinates = coordenates;
122
        }
123
        /**
124
         * @return Returns the coordinatesFilter.
125
         */
126
        public String getCoordenatesFilter() {
127
                return coordinatesFilter;
128
        }
129
        /**
130
         * @param coordenatesFilter The coordenatesFilter to set.
131
         */
132
        public void setCoordenatesFilter(String coordenatesFilter) {
133
                this.coordinatesFilter = coordenatesFilter;
134
        }
135
        /**
136
         * @return Returns the dateFrom.
137
         */
138
        public String getDateFrom() {
139
                return DateFrom;
140
        }
141
        /**
142
         * @param dateFrom The dateFrom to set.
143
         */
144
        public void setDateFrom(String dateFrom) {
145
                DateFrom = dateFrom;
146
        }
147
        /**
148
         * @return Returns the dateTo.
149
         */
150
        public String getDateTo() {
151
                return DateTo;
152
        }
153
        /**
154
         * @param dateTo The dateTo to set.
155
         */
156
        public void setDateTo(String dateTo) {
157
                DateTo = dateTo;
158
        }
159
        /**
160
         * @return Returns the provider.
161
         */
162
        public String getProvider() {
163
                return provider;
164
        }
165
        /**
166
         * @param provider The provider to set.
167
         */
168
        public void setProvider(String provider) {
169
                this.provider = provider;
170
        }
171
        /**
172
         * @return Returns the scale.
173
         */
174
        public String getScale() {
175
                return scale;
176
        }
177
        /**
178
         * @param scale The scale to set.
179
         */
180
        public void setScale(String scale) {
181
                this.scale = scale;
182
        }
183
        /**
184
         * @return Returns the themeKey.
185
         */
186
        public String getThemeKey() {
187
                return themeKey;
188
        }
189
        /**
190
         * @param themeKey The themeKey to set.
191
         */
192
        public void setThemeKey(String themeKey) {
193
                this.themeKey = themeKey;
194
        }
195
        /**
196
         * @return Returns the title.
197
         */
198
        public String getTitle() {
199
                return title;
200
        }
201
        /**
202
         * @param title The title to set.
203
         */
204
        public void setTitle(String title) {
205
                this.title = title;
206
        }
207
        /**
208
         * @return Returns the titleFilter.
209
         */
210
        public String getTitleFilter() {
211
                return titleFilter;
212
        }
213
        /**
214
         * @param titleFilter The titleFilter to set.
215
         */
216
        public void setTitleFilter(String titleFilter) {
217
                this.titleFilter = titleFilter;
218
        }
219
        /**
220
         * @return Returns the topic.
221
         */
222
        public String getTopic() {
223
                return topic;
224
        }
225
        /**
226
         * @param topic The topic to set.
227
         */
228
        public void setTopic(String topic) {
229
                this.topic = topic;
230
        }
231
        
232
        }