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 statistics to be calculated.

Note:

  • outStatistics is supported on only those layers / tables that indicate supportsStatistics is true.
  • A valid field name can only contain alpha-numeric 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 geodatabaseVersion 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 OutStatistics.Type: the type: OutStatistics.Type
onStatisticField String: the field name e.g. "pop2007"
outStatisticFieldName String: the out field name e.g. "Population_2007"

Public Methods

public boolean equals (Object obj)

Parameters
obj Object
Returns
boolean

public String getOnStatisticField ()

Gets the onStatisticField of the OutStatistic.

Returns
String Returns the onStatisticField.

public String getOutStatisticFieldName ()

Gets the outStatisticFieldName of the OutStatistic.

Returns
String Returns the outStatisticFieldName.

public OutStatistics.Type getType ()

Gets the type of the OutStatistic.

Returns
OutStatistics.Type Returns the type.

public int hashCode ()

Returns
int

public boolean isEmpty ()

Return true if all the fields are null.

Returns
boolean true if all the fields are null.

public void setOnStatisticField (String onStatisticField)

Sets the onStatisticField of the OutStatistic.

Parameters
onStatisticField String: The onStatisticField to set.

public void setOutStatisticFieldName (String outStatisticFieldName)

Sets the outStatisticFieldName of the OutStatistic.

Parameters
outStatisticFieldName String: The outStatisticFieldName to set.

public void setType (OutStatistics.Type type)

Sets the type of the OutStatistic.

Parameters
type OutStatistics.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
String null if the instance is empty.