Statistics
| Revision:

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

History | View | Annotate | Download (6.07 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22

    
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 {DiSiD Technologies}  {Create Parameter object to define FeatureCollections queries}
26
 */
27
package org.gvsig.fmap.dal.feature;
28

    
29
import org.gvsig.fmap.dal.DataQuery;
30
import org.gvsig.tools.evaluator.Evaluator;
31
import org.gvsig.tools.lang.Cloneable;
32

    
33
/**
34
 * Defines the properties of a collection of Features, as a result of a query
35
 * through a FeatureStore.
36
 * <p>
37
 * A FeatureQuery is always defined by a FeatureType, or by the list of
38
 * attribute names of the FeatureStore to return.
39
 * </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
 * The scale parameter can be used by the FeatureStore as a hint about the
50
 * quality or resolution of the data needed to view or operate with the data
51
 * returned. As an example, the FeatureStore may use the scale to return only a
52
 * 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
 * 
61
 * @author 2009- <a href="cordinyana@gvsig.org">C?sar Ordi?ana</a> - gvSIG team
62
 */
63
public interface FeatureQuery extends DataQuery, Cloneable {
64

    
65
        /**
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

    
72
        /**
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

    
80
        /**
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

    
90
        /**
91
         * 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
         */
95
        String getFeatureTypeId();
96

    
97
        /**
98
         * 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
         */
104
        void setFeatureTypeId(String featureTypeId);
105

    
106
        /**
107
         * Returns the filter to apply to the {@link Feature}s to load.
108
         * 
109
         * @return the filter
110
         */
111
        Evaluator getFilter();
112

    
113
        /**
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

    
121
        /**
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

    
128
        /**
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

    
135
        /**
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

    
143
        /**
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

    
150
        /**
151
         * @deprecated to be removed in gvSIG 2.0
152
         * @see #clone()
153
         */
154
        FeatureQuery getCopy();
155

    
156
        /**
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

    
168
        /**
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

    
181
        /**
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
}