Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureQuery.java @ 38608

History | View | Annotate | Download (6.58 KB)

1 23380 cordinyana
/* gvSIG. Geographic Information System of the Valencian Government
2 31126 cordinyana
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4 31544 cordinyana
 * of the Valencian Government (CIT)
5 31126 cordinyana
 *
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22 23380 cordinyana
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 {DiSiD Technologies}  {Create Parameter object to define FeatureCollections queries}
26
 */
27 24496 jmvivo
package org.gvsig.fmap.dal.feature;
28 23380 cordinyana
29 24496 jmvivo
import org.gvsig.fmap.dal.DataQuery;
30 23754 jjdelcerro
import org.gvsig.tools.evaluator.Evaluator;
31 31126 cordinyana
import org.gvsig.tools.lang.Cloneable;
32 23380 cordinyana
33
/**
34
 * Defines the properties of a collection of Features, as a result of a query
35
 * through a FeatureStore.
36
 * <p>
37 23754 jjdelcerro
 * A FeatureQuery is always defined by a FeatureType, or by the list of
38
 * attribute names of the FeatureStore to return.
39 23380 cordinyana
 * </p>
40
 * <p>
41
 * The filter allows to select Features whose properties have values with the
42
 * characteristics defined by the filter.
43
 * </p>
44
 * <p>
45
 * The order is used to set the order of the result FeatureCollection, based on
46
 * the values of the properties of the Features.
47
 * </p>
48
 * <p>
49 24868 jiyarza
 * The scale parameter can be used by the FeatureStore as a hint about the
50 23380 cordinyana
 * quality or resolution of the data needed to view or operate with the data
51 24868 jiyarza
 * returned. As an example, the FeatureStore may use the scale to return only a
52 23380 cordinyana
 * representative subset of the data, or maybe to return Features with less
53
 * detail, like a point or a line instead of a polygon.
54
 * </p>
55
 * <p>
56
 * If an implementation of FeatureStore is able to get other parameters to
57
 * customize the behavior of the getDataCollection methods, there is an option
58
 * to set more parameters through the setAttribute method.
59
 * </p>
60 31126 cordinyana
 *
61
 * @author 2009- <a href="cordinyana@gvsig.org">C?sar Ordi?ana</a> - gvSIG team
62 23380 cordinyana
 */
63 31126 cordinyana
public interface FeatureQuery extends DataQuery, Cloneable {
64 23754 jjdelcerro
65 31126 cordinyana
        /**
66
         * Returns the names of the attributes to load from each {@link Feature}.
67
         *
68
         * @return the attribute names to load
69
         */
70
        String[] getAttributeNames();
71 23380 cordinyana
72 31126 cordinyana
        /**
73
         * Sets the names of the attributes to load from each {@link Feature}.
74
         *
75
         * @param attributeNames
76
         *            the attribute names to load
77
         */
78
        void setAttributeNames(String[] attributeNames);
79 35328 jpiera
80
        /**
81
         * Adds the name of an attribute that has to be used to load each
82
         * {@link Feature}.
83
         *
84
         * @param attributeName
85
         *             the attribute name to load
86
         */
87
        void addAttributeName(String attributeName);
88 23380 cordinyana
89 31126 cordinyana
        /**
90
         * Sets the {@link FeatureType} of the {@link Feature}s to load. It may be
91
         * used as an alternative way to set a subset of the list of attribute names
92
         * to load, by creating a sub-FeatureType.
93
         *
94
         * @param featureType
95
         *            the feature type of the data to load
96
         */
97
        void setFeatureType(FeatureType featureType);
98 27234 jmvivo
99 23754 jjdelcerro
        /**
100 31126 cordinyana
         * Returns the {@link FeatureType} id of the {@link Feature}s to load.
101
         *
102
         * @return the {@link FeatureType} id of the {@link Feature}s to load
103 23754 jjdelcerro
         */
104 31126 cordinyana
        String getFeatureTypeId();
105 23380 cordinyana
106 23754 jjdelcerro
        /**
107 31126 cordinyana
         * Sets the {@link FeatureType} id of the {@link Feature}s to load. This way
108
         * all {@link Feature} attributes will be loaded.
109
         *
110
         * @param featureTypeId
111
         *            the {@link FeatureType} id of the {@link Feature}s to load
112 23754 jjdelcerro
         */
113 31126 cordinyana
        void setFeatureTypeId(String featureTypeId);
114 23380 cordinyana
115 31126 cordinyana
        /**
116
         * Returns the filter to apply to the {@link Feature}s to load.
117
         *
118
         * @return the filter
119
         */
120
        Evaluator getFilter();
121 23380 cordinyana
122 31126 cordinyana
        /**
123
         * Sets the filter to apply to the {@link Feature}s to load.
124
         *
125
         * @param filter
126
         *            the filter to apply to the {@link Feature}s to load
127
         */
128
        void setFilter(Evaluator filter);
129 35198 jpiera
130
        /**
131
         * Adds a filter to apply to the {@link Feature}s to load. A query
132
         * can have more that one filter and all of them are applied when
133
         * the query is applied.
134
         *
135
         * @param filter
136
         *             a filter to apply to the {@link Feature}s to load
137
         */
138
        void addFilter(Evaluator filter);
139 23380 cordinyana
140 31126 cordinyana
        /**
141
         * Returns if a filter has been defined for the query.
142
         *
143
         * @return if a filter has been defined for the query
144
         */
145
        boolean hasFilter();
146 23380 cordinyana
147 31126 cordinyana
        /**
148
         * Returns the order of the {@link Feature}s to load.
149
         *
150
         * @return the order of the {@link Feature}s to load
151
         */
152
        FeatureQueryOrder getOrder();
153 25834 jmvivo
154 31126 cordinyana
        /**
155
         * Sets the order of the {@link Feature}s to load.
156
         *
157
         * @param order
158
         *            the order of the {@link Feature}s to load
159
         */
160
        void setOrder(FeatureQueryOrder order);
161 23820 jjdelcerro
162 31126 cordinyana
        /**
163
         * Returns if an order has been set for the elements returned by the query.
164
         *
165
         * @return if an order has been set for the elements returned by the query
166
         */
167
        boolean hasOrder();
168 23820 jjdelcerro
169 31126 cordinyana
        /**
170
         * @deprecated to be removed in gvSIG 2.0
171
         * @see #clone()
172
         */
173
        FeatureQuery getCopy();
174 25917 jmvivo
175 31126 cordinyana
        /**
176
         * Returns the maximum number of elements to return with this query.
177
         * <p>
178
         * <strong>NOTE:</strong> this value may be ignored by the underlying data
179
         * source, or only used as a hint, so don't rely on it being used, as you
180
         * may actually get more values than the limit.
181
         * </p>
182
         *
183
         * @return the maximum number of elements to return with this query
184
         */
185
        long getLimit();
186 25917 jmvivo
187 31126 cordinyana
        /**
188
         * Sets the maximum number of elements to return with this query.
189
         * <p>
190
         * <strong>NOTE:</strong> this value may be ignored by the underlying data
191
         * source, or only used as a hint, so don't rely on it being used, as you
192
         * may actually get more values than the limit.
193
         * </p>
194
         *
195
         * @param limit
196
         *            the maximum number of elements to return with this query
197
         */
198
        void setLimit(long limit);
199 25917 jmvivo
200 31126 cordinyana
        /**
201
         * Returns the load page size, as the number of elements to be retrieved in
202
         * block by the data source. This value is only used as a hint to the
203
         * underlying data source, as a way to tell how many Features may be read in
204
         * a block.
205
         *
206
         * @return the load page size
207
         */
208
        long getPageSize();
209
210
        /**
211
         * Sets the load page size, as the number of elements to be retrieved in
212
         * block by the data source. This value is only used as a hint to the
213
         * underlying data source, as a way to tell how many Features may be read in
214
         * a block.
215
         *
216
         * @param pageSize
217
         *            the load page size
218
         */
219
        void setPageSize(long pageSize);
220 23380 cordinyana
}