Statistics
| Revision:

root / branches / dal_time_support / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureQuery.java @ 34628

History | View | Annotate | Download (6.07 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 23380 cordinyana
80 31126 cordinyana
        /**
81
         * Sets the {@link FeatureType} of the {@link Feature}s to load. It may be
82
         * used as an alternative way to set a subset of the list of attribute names
83
         * to load, by creating a sub-FeatureType.
84
         *
85
         * @param featureType
86
         *            the feature type of the data to load
87
         */
88
        void setFeatureType(FeatureType featureType);
89 27234 jmvivo
90 23754 jjdelcerro
        /**
91 31126 cordinyana
         * Returns the {@link FeatureType} id of the {@link Feature}s to load.
92
         *
93
         * @return the {@link FeatureType} id of the {@link Feature}s to load
94 23754 jjdelcerro
         */
95 31126 cordinyana
        String getFeatureTypeId();
96 23380 cordinyana
97 23754 jjdelcerro
        /**
98 31126 cordinyana
         * Sets the {@link FeatureType} id of the {@link Feature}s to load. This way
99
         * all {@link Feature} attributes will be loaded.
100
         *
101
         * @param featureTypeId
102
         *            the {@link FeatureType} id of the {@link Feature}s to load
103 23754 jjdelcerro
         */
104 31126 cordinyana
        void setFeatureTypeId(String featureTypeId);
105 23380 cordinyana
106 31126 cordinyana
        /**
107
         * Returns the filter to apply to the {@link Feature}s to load.
108
         *
109
         * @return the filter
110
         */
111
        Evaluator getFilter();
112 23380 cordinyana
113 31126 cordinyana
        /**
114
         * Sets the filter to apply to the {@link Feature}s to load.
115
         *
116
         * @param filter
117
         *            the filter to apply to the {@link Feature}s to load
118
         */
119
        void setFilter(Evaluator filter);
120 23380 cordinyana
121 31126 cordinyana
        /**
122
         * Returns if a filter has been defined for the query.
123
         *
124
         * @return if a filter has been defined for the query
125
         */
126
        boolean hasFilter();
127 23380 cordinyana
128 31126 cordinyana
        /**
129
         * Returns the order of the {@link Feature}s to load.
130
         *
131
         * @return the order of the {@link Feature}s to load
132
         */
133
        FeatureQueryOrder getOrder();
134 25834 jmvivo
135 31126 cordinyana
        /**
136
         * Sets the order of the {@link Feature}s to load.
137
         *
138
         * @param order
139
         *            the order of the {@link Feature}s to load
140
         */
141
        void setOrder(FeatureQueryOrder order);
142 23820 jjdelcerro
143 31126 cordinyana
        /**
144
         * Returns if an order has been set for the elements returned by the query.
145
         *
146
         * @return if an order has been set for the elements returned by the query
147
         */
148
        boolean hasOrder();
149 23820 jjdelcerro
150 31126 cordinyana
        /**
151
         * @deprecated to be removed in gvSIG 2.0
152
         * @see #clone()
153
         */
154
        FeatureQuery getCopy();
155 25917 jmvivo
156 31126 cordinyana
        /**
157
         * Returns the maximum number of elements to return with this query.
158
         * <p>
159
         * <strong>NOTE:</strong> this value may be ignored by the underlying data
160
         * source, or only used as a hint, so don't rely on it being used, as you
161
         * may actually get more values than the limit.
162
         * </p>
163
         *
164
         * @return the maximum number of elements to return with this query
165
         */
166
        long getLimit();
167 25917 jmvivo
168 31126 cordinyana
        /**
169
         * Sets the maximum number of elements to return with this query.
170
         * <p>
171
         * <strong>NOTE:</strong> this value may be ignored by the underlying data
172
         * source, or only used as a hint, so don't rely on it being used, as you
173
         * may actually get more values than the limit.
174
         * </p>
175
         *
176
         * @param limit
177
         *            the maximum number of elements to return with this query
178
         */
179
        void setLimit(long limit);
180 25917 jmvivo
181 31126 cordinyana
        /**
182
         * Returns the load page size, as the number of elements to be retrieved in
183
         * block by the data source. This value is only used as a hint to the
184
         * underlying data source, as a way to tell how many Features may be read in
185
         * a block.
186
         *
187
         * @return the load page size
188
         */
189
        long getPageSize();
190
191
        /**
192
         * Sets the load page size, as the number of elements to be retrieved in
193
         * block by the data source. This value is only used as a hint to the
194
         * underlying data source, as a way to tell how many Features may be read in
195
         * a block.
196
         *
197
         * @param pageSize
198
         *            the load page size
199
         */
200
        void setPageSize(long pageSize);
201 23380 cordinyana
}