public class

OutStatistics

extends Object
java.lang.Object
   ↳ com.esri.core.tasks.ags.query.OutStatistics

Class Overview

The definitions for one or more field-based statistic to be calculated Note:

  • outStatistics is supported on only those layers / tables that indicate suppportsStatistics is true.
  • If outStatisticFieldName is empty or missing, then map server would assign a field name to the returned statistic field. A valid field name can only contain alpha-numberic characters and an underscore.
  • When using outStatistics the only other parameters that will be used are groupByFieldsForStatistics, orderByFields, text, time, and where.
  • Specifying geometry, objectIds, or gdbVersion parameters would return an error.

Values: An array of statistic definitions. A statistic definition specifies the type of statistic, the field on which it is to be calculated, and the resulting output field name.

Summary

Nested Classes
enum OutStatistics.Type  
Public Constructors
OutStatistics(OutStatistics.Type type, String onStatisticField, String outStatisticFieldName)
Instantiates an object of OutStatistic.
Public Methods
boolean equals(Object obj)
String getOnStatisticField()
Gets the onStatisticField of the OutStatistic.
String getOutStatisticFieldName()
Gets the outStatisticFieldName of the OutStatistic.
OutStatistics.Type getType()
Gets the type of the OutStatistic.
int hashCode()
boolean isEmpty()
Return true if all the fields are null.
void setOnStatisticField(String onStatisticField)
Sets the onStatisticField of the OutStatistic.
void setOutStatisticFieldName(String outStatisticFieldName)
Sets the outStatisticFieldName of the OutStatistic.
void setType(OutStatistics.Type type)
Sets the type of the OutStatistic.
String toJson()
Returns null if the instance is empty.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public OutStatistics (OutStatistics.Type type, String onStatisticField, String outStatisticFieldName)

Instantiates an object of OutStatistic.

Parameters
type the type: OutStatistics.Type
onStatisticField the field name e.g. "pop2007"
outStatisticFieldName the out field name e.g. "Population_2007"

Public Methods

public boolean equals (Object obj)

public String getOnStatisticField ()

Gets the onStatisticField of the OutStatistic.

Returns
  • Returns the onStatisticField.

public String getOutStatisticFieldName ()

Gets the outStatisticFieldName of the OutStatistic.

Returns
  • Returns the outStatisticFieldName.

public OutStatistics.Type getType ()

Gets the type of the OutStatistic.

Returns
  • Returns the type.

public int hashCode ()

public boolean isEmpty ()

Return true if all the fields are null.

Returns
  • true if all the fields are null.

public void setOnStatisticField (String onStatisticField)

Sets the onStatisticField of the OutStatistic.

Parameters
onStatisticField The onStatisticField to set.

public void setOutStatisticFieldName (String outStatisticFieldName)

Sets the outStatisticFieldName of the OutStatistic.

Parameters
outStatisticFieldName The outStatisticFieldName to set.

public void setType (OutStatistics.Type type)

Sets the type of the OutStatistic.

Parameters
type The type to set.

public String toJson ()

Returns null if the instance is empty.

Syntax:

 [
   {
     "statisticType": "",
     "onStatisticField": "Field1", 
     "outStatisticFieldName": "Out_Field_Name1"
   },
   {
     "statisticType": "",
     "onStatisticField": "Field2",
     "outStatisticFieldName": "Out_Field_Name2"
   }  
 ]
 
Example:
 [
   {
     "statisticType": "sum",
     "onStatisticField": "GENDER",
     "outStatisticFieldName": "PopulationByGender"
   },
   {
     "statisticType": "avg",
     "onStatisticField": "INCOME",
     "outStatisticFieldName": "AverageIncome"
   }
 ]
 
 

Returns
  • null if the instance is empty.