Class StatisticsQueryParameters


  • public final class StatisticsQueryParameters
    extends java.lang.Object
    Represents the input parameters for defining a statistics query.
    Since:
    100.2.0
    • Constructor Detail

      • StatisticsQueryParameters

        public StatisticsQueryParameters​(java.lang.Iterable<StatisticDefinition> statisticDefinitions)
        Constructs a StatisticsQueryParameters by a list of statistic definitions.
        Parameters:
        statisticDefinitions - the statistic definitions to apply for the query
        Throws:
        java.lang.IllegalArgumentException - if statisticDefinitions is null, or empty
        Since:
        100.2.0
    • Method Detail

      • getGeometry

        public Geometry getGeometry()
        Gets the geometry that (along with the spatial relationship) defines features to be included in the statistical query.
        Returns:
        the geometry used for spatial filtering
        Since:
        100.2.0
      • setGeometry

        public void setGeometry​(Geometry geometry)
        Sets the geometry that defines features to be included in the statistical query.
        Parameters:
        geometry - the geometry used for spatial filtering
        Throws:
        java.lang.IllegalArgumentException - if geometry is null
        Since:
        100.2.0
      • getSpatialRelationship

        public QueryParameters.SpatialRelationship getSpatialRelationship()
        Gets the spatial relationship that defines features to be included in the statistical query.
        Returns:
        the spatial relationship type
        Since:
        100.2.0
      • setSpatialRelationship

        public void setSpatialRelationship​(QueryParameters.SpatialRelationship spatialRelationship)
        Sets the spatial relationship that defines features to be included in the statistical query.
        Parameters:
        spatialRelationship - the spatial relationship type
        Throws:
        java.lang.IllegalArgumentException - if spatialRelationship is null
        Since:
        100.2.0
      • getWhereClause

        public java.lang.String getWhereClause()
        Gets an expression string used in the where clause. It will be combined with a spatial criteria (geometry) to filter the features evaluated in the statistical query. If no filters are defined, all features in the table are included in the query.
        Returns:
        a string of the attribute expression that defines features to be included in the statistics query.
        Since:
        100.2.0
      • setWhereClause

        public void setWhereClause​(java.lang.String whereClause)
        Sets an expression string used in the where clause. It will be combined with a spatial criteria (geometry) to filter the features evaluated in the statistical query. If no filters are defined, all features in the table are included in the query.

        Here some valid examples:

        
         setWhereClause("STATE_NAME LIKE 'Miss%'"); // % means anything
         setWhereClause("STATE_NAME = 'California'"); //strings must be enclosed within single quotes in where clause
         setWhereClause("POP2007 > 1000000");
         
         
        Parameters:
        whereClause - the where clause string for filtering features
        Throws:
        java.lang.IllegalArgumentException - if whereClause is null
        Since:
        100.2.0
      • getGroupByFieldNames

        public java.util.List<java.lang.String> getGroupByFieldNames()
        Gets a list of fields by which statistical query results will be grouped.

        By default the list is empty. Adds valid field names to group the statistical query result. It will affect the result of StatisticRecord.getGroup().

        Returns:
        a mutable list of fields by which statistical query results will be grouped
        Since:
        100.2.0
      • getOrderByFields

        public java.util.List<QueryParameters.OrderBy> getOrderByFields()
        Gets a list of fields by which statistical query results will be ordered.

        By default the list is empty. Adds valid field names to sort the statistical query result. It will affect the result order of StatisticsQueryResult.iterator().

        Returns:
        a mutable list of fields for sort orders
        Since:
        100.2.0
      • getStatisticDefinitions

        public java.util.List<StatisticDefinition> getStatisticDefinitions()
        Gets a list of StatisticDefinition objects to include in a statistical query of a table.

        By default the list is the same as the definition list constructing the object. Adds or removes a statistic definition to the list to decide the final statistical query result. The list cannot be empty.

        Returns:
        a mutable list of StatisticDefinition objects
        Since:
        100.2.0
      • setTimeExtent

        public void setTimeExtent​(TimeExtent timeExtent)
        Sets the time extent that defines features to be included in the statistics query. The time extent can be null to indicate an infinite extent.
        Parameters:
        timeExtent - the time extent
        Since:
        100.3.0
      • getTimeExtent

        public TimeExtent getTimeExtent()
        Gets the time extent that defines features to be included in the statistics query.
        Returns:
        the time extent, or null if no time extent is set
        Since:
        100.3.0