Package org.gvsig.fmap.dal.feature.impl
Class DefaultFeatureQuery
java.lang.Object
org.gvsig.fmap.dal.feature.impl.DefaultFeatureQuery
- All Implemented Interfaces:
Cloneable,org.gvsig.fmap.dal.DataQuery,org.gvsig.fmap.dal.feature.FeatureQuery,org.gvsig.json.SupportFromJson,org.gvsig.json.SupportJson,org.gvsig.json.SupportToJson,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
Defines the properties of a collection of Features, as a result of a query
through a FeatureStore.
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.
-
Field Summary
FieldsFields inherited from interface org.gvsig.fmap.dal.feature.FeatureQuery
NO_LIMIT -
Constructor Summary
ConstructorsConstructorDescriptionCreates a FeatureQuery which will load all available Features of a type.DefaultFeatureQuery(String storeName) DefaultFeatureQuery(String[] attributeNames) Creates a FeatureQuery which will load a list of attribute names of all available Features.DefaultFeatureQuery(String[] attributeNames, org.gvsig.tools.evaluator.Evaluator filter) Creates a FeatureQuery with the list of attribute names of feature, a filter and the order for the FeatureCollection.DefaultFeatureQuery(String[] attributeNames, org.gvsig.tools.evaluator.Evaluator filter, double scale) Creates a FeatureQuery with the list of attribute names of feature, a filter, the order for the FeatureCollection and the view scale.DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType) Creates a FeatureQuery which will load all available Features of a type.DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.tools.evaluator.Evaluator filter) Creates a FeatureQuery with the type of features, a filter and the order for the FeatureCollection.DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.tools.evaluator.Evaluator filter, double scale) Creates a FeatureQuery with the type of features, a filter, the order for the FeatureCollection and the view scale. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregate(String funcName, String columnName) voidaddAttributeName(String attributeName) voidaddConstantAttributeName(String attributeName) voidaddEssentialAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store) org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptoraddExtraColumn(String name, int datatype, org.gvsig.expressionevaluator.Expression expression) voidvoidaddFilter(org.gvsig.expressionevaluator.Expression filter) voidaddFilter(org.gvsig.tools.evaluator.Evaluator evaluator) voidaddPrimaryKeyAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store) voidvoidvoidvoidclone()voidcopyFrom(org.gvsig.fmap.dal.feature.FeatureQuery query) voidfromJson(javax.json.JsonObject json) getAggregate(String name) getAggregate(String tableName, String name) getAggregateFunction(String name) String[]String[]org.gvsig.fmap.dal.feature.FeatureQuerygetCopy()org.gvsig.expressionevaluator.Expressionorg.gvsig.fmap.dal.feature.FeatureExtraColumnsDeprecated.org.gvsig.fmap.dal.feature.FeatureExtraColumnsorg.gvsig.tools.evaluator.EvaluatorlonggetLimit()org.gvsig.fmap.dal.feature.FeatureQueryOrdergetOrder()longgetQueryParameter(String name) doublegetScale()org.gvsig.expressionevaluator.MutableSymbolTablebooleanbooleanhasAttributeName(String name) booleanbooleanbooleanbooleanbooleanhasLimit()booleanhasOrder()booleanisAggregate(String name) booleanisAGroupByColumn(String name) booleanvoidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidremoveAggregateFunction(String colname) voidremoveGroupByColumn(String colname) voidvoidsaveToState(org.gvsig.tools.persistence.PersistentState state) static voidfinal voidsetAttributeNames(String[] attributeNames) voidsetConstantsAttributeNames(String[] constantsAttributeNames) final voidsetFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType) voidsetFeatureTypeId(String featureTypeId) voidvoidsetFilter(org.gvsig.expressionevaluator.Expression filter) voidsetFilter(org.gvsig.tools.evaluator.Evaluator filter) voidsetLimit(long limit) voidsetOrder(org.gvsig.fmap.dal.feature.FeatureQueryOrder order) voidsetPageSize(long pageSize) voidsetQueryParameter(String name, Object value) final voidsetScale(double scale) voidsetSymbolTable(org.gvsig.expressionevaluator.MutableSymbolTable symbolTable) voidsetUseSubquery(boolean useSubquery) voidorg.gvsig.json.JsonObjectBuildertoString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gvsig.json.SupportToJson
toJson, toJson, toJsonBuilder
-
Field Details
-
SCALE_PARAM_NAME
- See Also:
-
-
Constructor Details
-
DefaultFeatureQuery
public DefaultFeatureQuery()Creates a FeatureQuery which will load all available Features of a type. -
DefaultFeatureQuery
-
DefaultFeatureQuery
public DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType) Creates a FeatureQuery which will load all available Features of a type.- Parameters:
featureType- the type of Features of the query
-
DefaultFeatureQuery
public DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.tools.evaluator.Evaluator filter) Creates a FeatureQuery with the type of features, a filter and the order for the FeatureCollection.- Parameters:
featureType- the type of Features of the queryfilter- based on the properties of the Features
-
DefaultFeatureQuery
public DefaultFeatureQuery(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.tools.evaluator.Evaluator filter, double scale) Creates a FeatureQuery with the type of features, a filter, the order for the FeatureCollection and the view scale.- Parameters:
featureType- the type of Features of the queryfilter- based on the properties of the Featuresscale- to view the Features.
-
DefaultFeatureQuery
Creates a FeatureQuery which will load a list of attribute names of all available Features.- Parameters:
attributeNames- the list of attribute names to load
-
DefaultFeatureQuery
Creates a FeatureQuery with the list of attribute names of feature, a filter and the order for the FeatureCollection.- Parameters:
attributeNames- the list of attribute names to loadfilter- based on the properties of the Features
-
DefaultFeatureQuery
public DefaultFeatureQuery(String[] attributeNames, org.gvsig.tools.evaluator.Evaluator filter, double scale) Creates a FeatureQuery with the list of attribute names of feature, a filter, the order for the FeatureCollection and the view scale.- Parameters:
attributeNames- the list of attribute names to loadfilter- based on the properties of the Featuresscale- to view the Features.
-
-
Method Details
-
getScale
public double getScale()- Specified by:
getScalein interfaceorg.gvsig.fmap.dal.DataQuery
-
setScale
public final void setScale(double scale) - Specified by:
setScalein interfaceorg.gvsig.fmap.dal.DataQuery
-
getQueryParameter
- Specified by:
getQueryParameterin interfaceorg.gvsig.fmap.dal.DataQuery
-
setQueryParameter
- Specified by:
setQueryParameterin interfaceorg.gvsig.fmap.dal.DataQuery
-
setFeatureType
public final void setFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType) - Specified by:
setFeatureTypein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getAttributeNames
- Specified by:
getAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setAttributeNames
- Specified by:
setAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
retrievesAllAttributes
public void retrievesAllAttributes()- Specified by:
retrievesAllAttributesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addAttributeName
- Specified by:
addAttributeNamein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addEssentialAttributeNames
public void addEssentialAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store) - Specified by:
addEssentialAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addPrimaryKeyAttributeNames
public void addPrimaryKeyAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store) - Specified by:
addPrimaryKeyAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasAttributeNames
public boolean hasAttributeNames()- Specified by:
hasAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
clearAttributeNames
public void clearAttributeNames()- Specified by:
clearAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getFilter
public org.gvsig.tools.evaluator.Evaluator getFilter()- Specified by:
getFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getExpressionFilter
public org.gvsig.expressionevaluator.Expression getExpressionFilter()- Specified by:
getExpressionFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setFilter
public void setFilter(org.gvsig.expressionevaluator.Expression filter) - Specified by:
setFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setFilter
- Specified by:
setFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setFilter
public void setFilter(org.gvsig.tools.evaluator.Evaluator filter) - Specified by:
setFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addFilter
- Specified by:
addFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addFilter
public void addFilter(org.gvsig.expressionevaluator.Expression filter) - Specified by:
addFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addFilter
public void addFilter(org.gvsig.tools.evaluator.Evaluator evaluator) - Specified by:
addFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
clearFilter
public void clearFilter()- Specified by:
clearFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getOrder
public org.gvsig.fmap.dal.feature.FeatureQueryOrder getOrder()- Specified by:
getOrderin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setOrder
public void setOrder(org.gvsig.fmap.dal.feature.FeatureQueryOrder order) - Specified by:
setOrderin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasFilter
public boolean hasFilter()- Specified by:
hasFilterin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasLimit
public boolean hasLimit()- Specified by:
hasLimitin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasOrder
public boolean hasOrder()- Specified by:
hasOrderin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getCopy
public org.gvsig.fmap.dal.feature.FeatureQuery getCopy()- Specified by:
getCopyin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getFeatureTypeId
- Specified by:
getFeatureTypeIdin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setFeatureTypeId
- Specified by:
setFeatureTypeIdin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
selfRegister
public static void selfRegister() -
getLimit
public long getLimit()- Specified by:
getLimitin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getPageSize
public long getPageSize()- Specified by:
getPageSizein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setLimit
public void setLimit(long limit) - Specified by:
setLimitin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
clearLimit
public void clearLimit()- Specified by:
clearLimitin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setPageSize
public void setPageSize(long pageSize) - Specified by:
setPageSizein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getConstantsAttributeNames
- Specified by:
getConstantsAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setConstantsAttributeNames
- Specified by:
setConstantsAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addConstantAttributeName
- Specified by:
addConstantAttributeNamein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasConstantsAttributeNames
public boolean hasConstantsAttributeNames()- Specified by:
hasConstantsAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
clearConstantsAttributeNames
public void clearConstantsAttributeNames()- Specified by:
clearConstantsAttributeNamesin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
isAGroupByColumn
- Specified by:
isAGroupByColumnin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getGroupByColumns
- Specified by:
getGroupByColumnsin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
removeGroupByColumn
- Specified by:
removeGroupByColumnin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
addAggregate
- Specified by:
addAggregatein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getAggregateFunctions
- Specified by:
getAggregateFunctionsin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
removeAggregateFunction
- Specified by:
removeAggregateFunctionin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getAggregateFunction
- Specified by:
getAggregateFunctionin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getAggregate
- Specified by:
getAggregatein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getAggregate
- Specified by:
getAggregatein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
isAggregate
- Specified by:
isAggregatein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasAggregateFunctions
public boolean hasAggregateFunctions()- Specified by:
hasAggregateFunctionsin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasGroupByColumns
public boolean hasGroupByColumns()- Specified by:
hasGroupByColumnsin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
copyFrom
public void copyFrom(org.gvsig.fmap.dal.feature.FeatureQuery query) - Specified by:
copyFromin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getExtraColumns
public org.gvsig.fmap.dal.feature.FeatureExtraColumns getExtraColumns()- Specified by:
getExtraColumnsin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getExtraColumn
Deprecated.- Specified by:
getExtraColumnin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
getSymbolTable
public org.gvsig.expressionevaluator.MutableSymbolTable getSymbolTable()- Specified by:
getSymbolTablein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setSymbolTable
public void setSymbolTable(org.gvsig.expressionevaluator.MutableSymbolTable symbolTable) - Specified by:
setSymbolTablein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setVar
- Specified by:
setVarin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
isUseSubquery
public boolean isUseSubquery()- Specified by:
isUseSubqueryin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
setUseSubquery
public void setUseSubquery(boolean useSubquery) - Specified by:
setUseSubqueryin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
fromJson
public void fromJson(javax.json.JsonObject json) - Specified by:
fromJsonin interfaceorg.gvsig.json.SupportFromJson
-
toJsonBuilder
public org.gvsig.json.JsonObjectBuilder toJsonBuilder()- Specified by:
toJsonBuilderin interfaceorg.gvsig.json.SupportToJson
-
toString
-
addExtraColumn
public org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor addExtraColumn(String name, int datatype, org.gvsig.expressionevaluator.Expression expression) - Specified by:
addExtraColumnin interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-
hasAttributeName
- Specified by:
hasAttributeNamein interfaceorg.gvsig.fmap.dal.feature.FeatureQuery
-