public interface FeatureQuery extends DataQuery, Cloneable
A FeatureQuery is always defined by a FeatureType, or by the list of attribute names of the FeatureStore to return.
The filter allows to select Features whose properties have values with the characteristics defined by the filter.
The order is used to set the order of the result FeatureCollection, based on the values of the properties of the Features.
The scale parameter can be used by the FeatureStore as a hint about the quality or resolution of the data needed to view or operate with the data returned. As an example, the FeatureStore may use the scale to return only a representative subset of the data, or maybe to return Features with less detail, like a point or a line instead of a polygon.
If an implementation of FeatureStore is able to get other parameters to customize the behavior of the getDataCollection methods, there is an option to set more parameters through the setAttribute method.
Modifier and Type | Method and Description |
---|---|
void |
addAttributeName(String attributeName)
Adds the name of an attribute that has to be used to load each
Feature . |
void |
addConstantAttributeName(String attributeName)
Add an attribute name that will be treated as constant for each
Feature . |
void |
addEssentialAttributeNames(FeatureStore store) |
void |
addFilter(Evaluator filter)
Adds a filter to apply to the
Feature s to load. |
void |
addFilter(String filter) |
void |
addPrimaryKeyAttributeNames(FeatureStore store) |
void |
clearAttributeNames()
Remove all the attribute names specifieds.
|
void |
clearConstantsAttributeNames()
Remove all the names specified as constants attributes.
|
void |
clearFilter() |
String[] |
getAttributeNames()
Returns the names of the attributes to load from each
Feature . |
String[] |
getConstantsAttributeNames()
Returns the names of the attributes that are constants in each
Feature . |
FeatureQuery |
getCopy()
Deprecated.
to be removed in gvSIG 2.0
|
String |
getFeatureTypeId()
Returns the
FeatureType id of the Feature s to load. |
Evaluator |
getFilter()
Returns the filter to apply to the
Feature s to load. |
long |
getLimit()
Returns the maximum number of elements to return with this query.
|
FeatureQueryOrder |
getOrder()
Returns the order of the
Feature s to load. |
long |
getPageSize()
Returns the load page size, as the number of elements to be retrieved in
block by the data source.
|
boolean |
hasAttributeNames()
Return true if has set attribute names
|
boolean |
hasConstantsAttributeNames()
Return true if has set constants attribute names
|
boolean |
hasFilter()
Returns if a filter has been defined for the query.
|
boolean |
hasOrder()
Returns if an order has been set for the elements returned by the query.
|
void |
retrievesAllAttributes() |
void |
setAttributeNames(String[] attributeNames)
Sets the names of the attributes to load from each
Feature . |
void |
setConstantsAttributeNames(String[] attributeNames)
Set of attribute names to be treated as constants for each
Feature . |
void |
setFeatureType(FeatureType featureType)
Sets the
FeatureType of the Feature s to load. |
void |
setFeatureTypeId(String featureTypeId)
Sets the
FeatureType id of the Feature s to load. |
void |
setFilter(Evaluator filter)
Sets the filter to apply to the
Feature s to load. |
void |
setFilter(String filter) |
void |
setLimit(long limit)
Sets the maximum number of elements to return with this query.
|
void |
setOrder(FeatureQueryOrder order)
Sets the order of the
Feature s to load. |
void |
setPageSize(long pageSize)
Sets the load page size, as the number of elements to be retrieved in
block by the data source.
|
getQueryParameter, getScale, setQueryParameter, setScale
loadFromState, saveToState
String[] getAttributeNames()
Feature
.void setAttributeNames(String[] attributeNames)
Feature
.attributeNames
- the attribute names to loadvoid retrievesAllAttributes()
void addAttributeName(String attributeName)
Feature
.attributeName
- the attribute name to loadvoid addPrimaryKeyAttributeNames(FeatureStore store)
void addEssentialAttributeNames(FeatureStore store)
boolean hasAttributeNames()
void clearAttributeNames()
String[] getConstantsAttributeNames()
Feature
.
These attributes will not be charged.void setConstantsAttributeNames(String[] attributeNames)
Feature
.attributeNames
- the attribute names to be constantsvoid addConstantAttributeName(String attributeName)
Feature
.attributeName
- the attribute name to be treated as constantboolean hasConstantsAttributeNames()
void clearConstantsAttributeNames()
void setFeatureType(FeatureType featureType)
FeatureType
of the Feature
s to load. It may be
used as an alternative way to set a subset of the list of attribute names
to load, by creating a sub-FeatureType.featureType
- the feature type of the data to loadString getFeatureTypeId()
FeatureType
id of the Feature
s to load.FeatureType
id of the Feature
s to loadvoid setFeatureTypeId(String featureTypeId)
featureTypeId
- the FeatureType
id of the Feature
s to loadEvaluator getFilter()
Feature
s to load.void setFilter(Evaluator filter)
Feature
s to load.filter
- the filter to apply to the Feature
s to loadvoid setFilter(String filter)
void addFilter(Evaluator filter)
Feature
s to load. A query
can have more that one filter and all of them are applied when
the query is applied.
If filter is null do nothing.filter
- a filter to apply to the Feature
s to loadvoid addFilter(String filter)
void clearFilter()
boolean hasFilter()
FeatureQueryOrder getOrder()
Feature
s to load.Feature
s to loadvoid setOrder(FeatureQueryOrder order)
Feature
s to load.order
- the order of the Feature
s to loadboolean hasOrder()
FeatureQuery getCopy()
Cloneable.clone()
long getLimit()
NOTE: this value may be ignored by the underlying data source, or only used as a hint, so don't rely on it being used, as you may actually get more values than the limit.
void setLimit(long limit)
NOTE: this value may be ignored by the underlying data source, or only used as a hint, so don't rely on it being used, as you may actually get more values than the limit.
limit
- the maximum number of elements to return with this querylong getPageSize()
void setPageSize(long pageSize)
pageSize
- the load page size