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

public class DefaultFeatureQuery extends Object implements org.gvsig.fmap.dal.feature.FeatureQuery
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 Details

  • Constructor Details

    • DefaultFeatureQuery

      public DefaultFeatureQuery()
      Creates a FeatureQuery which will load all available Features of a type.
    • DefaultFeatureQuery

      public DefaultFeatureQuery(String storeName)
    • 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 query
      filter - 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 query
      filter - based on the properties of the Features
      scale - to view the Features.
    • DefaultFeatureQuery

      public DefaultFeatureQuery(String[] attributeNames)
      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

      public 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.
      Parameters:
      attributeNames - the list of attribute names to load
      filter - 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 load
      filter - based on the properties of the Features
      scale - to view the Features.
  • Method Details

    • getScale

      public double getScale()
      Specified by:
      getScale in interface org.gvsig.fmap.dal.DataQuery
    • setScale

      public final void setScale(double scale)
      Specified by:
      setScale in interface org.gvsig.fmap.dal.DataQuery
    • getQueryParameter

      public Object getQueryParameter(String name)
      Specified by:
      getQueryParameter in interface org.gvsig.fmap.dal.DataQuery
    • setQueryParameter

      public void setQueryParameter(String name, Object value)
      Specified by:
      setQueryParameter in interface org.gvsig.fmap.dal.DataQuery
    • setFeatureType

      public final void setFeatureType(org.gvsig.fmap.dal.feature.FeatureType featureType)
      Specified by:
      setFeatureType in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getAttributeNames

      public String[] getAttributeNames()
      Specified by:
      getAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setAttributeNames

      public final void setAttributeNames(String[] attributeNames)
      Specified by:
      setAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • retrievesAllAttributes

      public void retrievesAllAttributes()
      Specified by:
      retrievesAllAttributes in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addAttributeName

      public void addAttributeName(String attributeName)
      Specified by:
      addAttributeName in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addEssentialAttributeNames

      public void addEssentialAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store)
      Specified by:
      addEssentialAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addPrimaryKeyAttributeNames

      public void addPrimaryKeyAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore store)
      Specified by:
      addPrimaryKeyAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasAttributeNames

      public boolean hasAttributeNames()
      Specified by:
      hasAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • clearAttributeNames

      public void clearAttributeNames()
      Specified by:
      clearAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getFilter

      public org.gvsig.tools.evaluator.Evaluator getFilter()
      Specified by:
      getFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getExpressionFilter

      public org.gvsig.expressionevaluator.Expression getExpressionFilter()
      Specified by:
      getExpressionFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setFilter

      public void setFilter(org.gvsig.expressionevaluator.Expression filter)
      Specified by:
      setFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setFilter

      public void setFilter(String filter)
      Specified by:
      setFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setFilter

      public void setFilter(org.gvsig.tools.evaluator.Evaluator filter)
      Specified by:
      setFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addFilter

      public void addFilter(String filter)
      Specified by:
      addFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addFilter

      public void addFilter(org.gvsig.expressionevaluator.Expression filter)
      Specified by:
      addFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addFilter

      public void addFilter(org.gvsig.tools.evaluator.Evaluator evaluator)
      Specified by:
      addFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • clearFilter

      public void clearFilter()
      Specified by:
      clearFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getOrder

      public org.gvsig.fmap.dal.feature.FeatureQueryOrder getOrder()
      Specified by:
      getOrder in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setOrder

      public void setOrder(org.gvsig.fmap.dal.feature.FeatureQueryOrder order)
      Specified by:
      setOrder in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasFilter

      public boolean hasFilter()
      Specified by:
      hasFilter in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasLimit

      public boolean hasLimit()
      Specified by:
      hasLimit in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasOrder

      public boolean hasOrder()
      Specified by:
      hasOrder in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • getCopy

      public org.gvsig.fmap.dal.feature.FeatureQuery getCopy()
      Specified by:
      getCopy in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getFeatureTypeId

      public String getFeatureTypeId()
      Specified by:
      getFeatureTypeId in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setFeatureTypeId

      public void setFeatureTypeId(String featureTypeId)
      Specified by:
      setFeatureTypeId in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.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:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • selfRegister

      public static void selfRegister()
    • getLimit

      public long getLimit()
      Specified by:
      getLimit in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getPageSize

      public long getPageSize()
      Specified by:
      getPageSize in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setLimit

      public void setLimit(long limit)
      Specified by:
      setLimit in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • clearLimit

      public void clearLimit()
      Specified by:
      clearLimit in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setPageSize

      public void setPageSize(long pageSize)
      Specified by:
      setPageSize in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getConstantsAttributeNames

      public String[] getConstantsAttributeNames()
      Specified by:
      getConstantsAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setConstantsAttributeNames

      public void setConstantsAttributeNames(String[] constantsAttributeNames)
      Specified by:
      setConstantsAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addConstantAttributeName

      public void addConstantAttributeName(String attributeName)
      Specified by:
      addConstantAttributeName in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasConstantsAttributeNames

      public boolean hasConstantsAttributeNames()
      Specified by:
      hasConstantsAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • clearConstantsAttributeNames

      public void clearConstantsAttributeNames()
      Specified by:
      clearConstantsAttributeNames in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • isAGroupByColumn

      public boolean isAGroupByColumn(String name)
      Specified by:
      isAGroupByColumn in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getGroupByColumns

      public List<String> getGroupByColumns()
      Specified by:
      getGroupByColumns in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • removeGroupByColumn

      public void removeGroupByColumn(String colname)
      Specified by:
      removeGroupByColumn in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • addAggregate

      public void addAggregate(String funcName, String columnName)
      Specified by:
      addAggregate in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getAggregateFunctions

      public Map<String,String> getAggregateFunctions()
      Specified by:
      getAggregateFunctions in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • removeAggregateFunction

      public void removeAggregateFunction(String colname)
      Specified by:
      removeAggregateFunction in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getAggregateFunction

      public String getAggregateFunction(String name)
      Specified by:
      getAggregateFunction in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getAggregate

      public String getAggregate(String name)
      Specified by:
      getAggregate in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getAggregate

      public String getAggregate(String tableName, String name)
      Specified by:
      getAggregate in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • isAggregate

      public boolean isAggregate(String name)
      Specified by:
      isAggregate in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasAggregateFunctions

      public boolean hasAggregateFunctions()
      Specified by:
      hasAggregateFunctions in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasGroupByColumns

      public boolean hasGroupByColumns()
      Specified by:
      hasGroupByColumns in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • copyFrom

      public void copyFrom(org.gvsig.fmap.dal.feature.FeatureQuery query)
      Specified by:
      copyFrom in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getExtraColumns

      public org.gvsig.fmap.dal.feature.FeatureExtraColumns getExtraColumns()
      Specified by:
      getExtraColumns in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getExtraColumn

      @Deprecated public org.gvsig.fmap.dal.feature.FeatureExtraColumns getExtraColumn()
      Deprecated.
      Specified by:
      getExtraColumn in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • getSymbolTable

      public org.gvsig.expressionevaluator.MutableSymbolTable getSymbolTable()
      Specified by:
      getSymbolTable in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setSymbolTable

      public void setSymbolTable(org.gvsig.expressionevaluator.MutableSymbolTable symbolTable)
      Specified by:
      setSymbolTable in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setVar

      public void setVar(String name, Object value)
      Specified by:
      setVar in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • isUseSubquery

      public boolean isUseSubquery()
      Specified by:
      isUseSubquery in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • setUseSubquery

      public void setUseSubquery(boolean useSubquery)
      Specified by:
      setUseSubquery in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • fromJson

      public void fromJson(javax.json.JsonObject json)
      Specified by:
      fromJson in interface org.gvsig.json.SupportFromJson
    • toJsonBuilder

      public org.gvsig.json.JsonObjectBuilder toJsonBuilder()
      Specified by:
      toJsonBuilder in interface org.gvsig.json.SupportToJson
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addExtraColumn

      public org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor addExtraColumn(String name, int datatype, org.gvsig.expressionevaluator.Expression expression)
      Specified by:
      addExtraColumn in interface org.gvsig.fmap.dal.feature.FeatureQuery
    • hasAttributeName

      public boolean hasAttributeName(String name)
      Specified by:
      hasAttributeName in interface org.gvsig.fmap.dal.feature.FeatureQuery