Interface FeatureQuery

All Superinterfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, DataQuery, org.gvsig.tools.persistence.Persistent, org.gvsig.json.SupportFromJson, org.gvsig.json.SupportJson, org.gvsig.json.SupportToJson

public interface FeatureQuery extends DataQuery, org.gvsig.tools.lang.Cloneable, org.gvsig.json.SupportJson
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.

Author:
2009- César Ordiñana - gvSIG team
  • Field Details

  • Method Details

    • getAttributeNames

      String[] getAttributeNames()
      Returns the names of the attributes to load from each Feature.
      Returns:
      the attribute names to load
    • setAttributeNames

      void setAttributeNames(String[] attributeNames)
      Sets the names of the attributes to load from each Feature.
      Parameters:
      attributeNames - the attribute names to load
    • retrievesAllAttributes

      void retrievesAllAttributes()
    • addAttributeName

      void addAttributeName(String attributeName)
      Adds the attribute to the list of attributes that the query result Feature must have.
      Parameters:
      attributeName - the attribute name to load
    • addPrimaryKeyAttributeNames

      void addPrimaryKeyAttributeNames(FeatureStore store)
    • addEssentialAttributeNames

      void addEssentialAttributeNames(FeatureStore store)
    • hasAttributeNames

      boolean hasAttributeNames()
      Return true if has set attribute names
      Returns:
      true if has attribute names, otherwise false
    • clearAttributeNames

      void clearAttributeNames()
      Remove all the attribute names specifieds.
    • getConstantsAttributeNames

      String[] getConstantsAttributeNames()
      Returns the names of the attributes that are constants in each Feature. These attributes will not be charged.
      Returns:
      the attribute names that are constant
    • setConstantsAttributeNames

      void setConstantsAttributeNames(String[] attributeNames)
      Set of attribute names to be treated as constants for each Feature.
      Parameters:
      attributeNames - the attribute names to be constants
    • addConstantAttributeName

      void addConstantAttributeName(String attributeName)
      Add an attribute name that will be treated as constant for each Feature.
      Parameters:
      attributeName - the attribute name to be treated as constant
    • hasConstantsAttributeNames

      boolean hasConstantsAttributeNames()
      Return true if has set constants attribute names
      Returns:
      true if has constants attribute names, otherwise false
    • clearConstantsAttributeNames

      void clearConstantsAttributeNames()
      Remove all the names specified as constants attributes.
    • setFeatureType

      void setFeatureType(FeatureType featureType)
      Sets the FeatureType of the Features 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.
      Parameters:
      featureType - the feature type of the data to load
    • getFeatureTypeId

      String getFeatureTypeId()
      Returns the FeatureType id of the Features to load.
      Returns:
      the FeatureType id of the Features to load
    • setFeatureTypeId

      void setFeatureTypeId(String featureTypeId)
      Sets the FeatureType id of the Features to load. This way all Feature attributes will be loaded.
      Parameters:
      featureTypeId - the FeatureType id of the Features to load
    • getFilter

      org.gvsig.tools.evaluator.Evaluator getFilter()
      Returns the filter to apply to the Features to load.
      Returns:
      the filter
    • getExpressionFilter

      org.gvsig.expressionevaluator.Expression getExpressionFilter()
      Return the Expression associated to the filter. If the current filter is not an Expression, return null.
      Returns:
      the expression of the filter.
    • setFilter

      void setFilter(org.gvsig.tools.evaluator.Evaluator filter)
      Sets the filter to apply to the Features to load.
      Parameters:
      filter - the filter to apply to the Features to load
    • setFilter

      void setFilter(org.gvsig.expressionevaluator.Expression filter)
    • setFilter

      void setFilter(String filter)
    • addFilter

      void addFilter(org.gvsig.tools.evaluator.Evaluator filter)
      Adds a filter to apply to the Features 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.
      Parameters:
      filter - a filter to apply to the Features to load
    • addFilter

      void addFilter(org.gvsig.expressionevaluator.Expression filter)
    • addFilter

      void addFilter(String filter)
    • clearFilter

      void clearFilter()
    • hasFilter

      boolean hasFilter()
      Returns if a filter has been defined for the query.
      Returns:
      if a filter has been defined for the query
    • getOrder

      FeatureQueryOrder getOrder()
      Returns the order of the Features to load.
      Returns:
      the order of the Features to load
    • setOrder

      void setOrder(FeatureQueryOrder order)
      Sets the order of the Features to load.
      Parameters:
      order - the order of the Features to load
    • hasOrder

      boolean hasOrder()
      Returns if an order has been set for the elements returned by the query.
      Returns:
      if an order has been set for the elements returned by the query
    • getCopy

      FeatureQuery getCopy()
      Returns:
      @Deprecated to be removed in gvSIG 2.0
      See Also:
      • Cloneable.clone()
    • getLimit

      long getLimit()
      Returns the maximum number of elements to return with this query.

      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.

      Returns:
      the maximum number of elements to return with this query
    • setLimit

      void setLimit(long limit)
      Sets the maximum number of elements to return with this query.

      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.

      Parameters:
      limit - the maximum number of elements to return with this query
    • clearLimit

      void clearLimit()
    • getPageSize

      long getPageSize()
      Returns the load page size, as the number of elements to be retrieved in block by the data source. This value is only used as a hint to the underlying data source, as a way to tell how many Features may be read in a block.
      Returns:
      the load page size
    • setPageSize

      void setPageSize(long pageSize)
      Sets the load page size, as the number of elements to be retrieved in block by the data source. This value is only used as a hint to the underlying data source, as a way to tell how many Features may be read in a block.
      Parameters:
      pageSize - the load page size
    • isUseSubquery

      boolean isUseSubquery()
      Returns true if a subquery should be used. It will only take effect when the sql perameter of the connection has a value.
      Returns:
    • setUseSubquery

      void setUseSubquery(boolean useSubquery)
      Indicates whether to use a subquery or not in case the connection has an sql indicated. This flag will have no effect if the "sql" parameter in the connection has not been specified. By default it will be true and whenever an sql has been indicated in the connection, a subquery will be used to access the data. If false is assigned, the sql should return, in the same order, the rows required by the FeatureType of the store.
      Parameters:
      useSubquery -
    • getGroupByColumns

      List<String> getGroupByColumns()
      Return the names of attributes for group the features.
      Returns:
      the list of names to group features.
    • removeGroupByColumn

      void removeGroupByColumn(String colname)
    • isAGroupByColumn

      boolean isAGroupByColumn(String name)
    • hasGroupByColumns

      boolean hasGroupByColumns()
    • getAggregateFunctions

      Map<String,String> getAggregateFunctions()
      Return the aggregate functions useds for every attribute of the feature. The map is indexed by the name of the attribute and contains the aggregate functions used by each attribute.
      Returns:
      a Map with the aggregate function by attribute
    • removeAggregateFunction

      void removeAggregateFunction(String colname)
    • getAggregateFunction

      String getAggregateFunction(String name)
    • addAggregate

      void addAggregate(String funcName, String columnName)
    • getAggregate

      @Deprecated String getAggregate(String name)
      Deprecated.
    • getAggregate

      String getAggregate(String tableName, String name)
    • isAggregate

      boolean isAggregate(String name)
    • hasAggregateFunctions

      boolean hasAggregateFunctions()
    • copyFrom

      void copyFrom(FeatureQuery query)
    • getExtraColumn

      FeatureExtraColumns getExtraColumn()
    • getExtraColumns

      FeatureExtraColumns getExtraColumns()
      Extra local columns to the query. It will never be null.
      Returns:
    • getSymbolTable

      org.gvsig.expressionevaluator.MutableSymbolTable getSymbolTable()
    • setSymbolTable

      void setSymbolTable(org.gvsig.expressionevaluator.MutableSymbolTable symbolTable)
    • setVar

      void setVar(String name, Object value)
      Set a variable in the symbol table associated to this searchPanel.
      Parameters:
      name -
      value -
    • hasLimit

      boolean hasLimit()
    • addExtraColumn

      EditableFeatureAttributeDescriptor addExtraColumn(String name, int datatype, org.gvsig.expressionevaluator.Expression expression)
      Adds the expression to the list of attributes that the query result Feature must have.
      Parameters:
      name - , the name of the new attribute
      datatype - , the type of the new attribute
      expression - , the expression of the new attribute
      Returns:
      the EditableFeatureAttributeDescriptor of the new extra-column added
    • hasAttributeName

      boolean hasAttributeName(String pkname)