Package com.smartgwt.client.types

# Enum SummaryFunctionType

java.lang.Object
java.lang.Enum<SummaryFunctionType>
com.smartgwt.client.types.SummaryFunctionType

All Implemented Interfaces:
  `ValueEnum`, `Serializable`, `Comparable<SummaryFunctionType>`, `Constable`

public enum SummaryFunctionType extends Enum<SummaryFunctionType> implements ValueEnum
This is used for client-side or server-side summaries

- Client-side: Function to produce a summary value based on an array of records and a field definition. An example usage is the `listGrid summary row`, where a row is shown at the bottom of the listGrid containing summary information about each column.
- Server-side: Function used for getting summarized field value using `Server Summaries feature` or when `Including values from multiple records`

For the client-side SummaryFunctions may be specified in one of 2 ways:

- as an explicit function or executable `StringMethod`, which will be passed `records` (an array of records) and `field` (the field definition for which the summary is required).
- as a standard SummaryFunction identifier

For valid ways to configure SummaryFunctions to use server-side feature see the `Server Summaries overview`, including how to implement custom summary functions, not just builtin ones listed here (look for "Custom Aggregation" section).

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ARRAY`
  Client: The same approach as for "concat"but returning an array of the values, rather than a string concatenation
  Server: The same approach as for "concat", and with the same restrictons and limitations, but returning an array of the values, rather than a string concatenation.
  `AVG`
  Client: iterates through the set of records, picking up all numeric values for the specified field and determining the mean value.
  `CONCAT`
  Client: iterates through the set of records, producing a string with each value concatenated to the end.
  Server: implemented as a native SQL aggregate expression by the Oracle (LISTAGG), PostgreSQL (string_agg), and MySQL (GROUP_CONCAT) database drivers.
  `CONCATDISTINCT`
  Client: like "concat", but removes duplicate values before concatenation.
  Server: natively supported on Oracle 19c+ (LISTAGG DISTINCT), PostgreSQL 9.0+ (string_agg DISTINCT), and MySQL (GROUP_CONCAT DISTINCT).
  `COUNT`
  Client: returns a numeric count of the total number of records passed in.
  Server: acts exactly like SQL COUNT function.
  `FIRST`
  Client: Currently the same as the min function.
  Server: implemented as SQL MIN function.
  `MAX`
  Client: iterates through the set of records, picking up all non-null values for the specified field and finding the maximum value, where comparison between values is made: via `SimpleType.compareValues()` if defined for the field's `type` via `DateUtil.compareLogicalDates()` if the field type inherits from "date" via comparison as String if the field type inherits from "time" via `DateUtil.compareDates()` for two values that are both `com.smartgwt.client.util.Date`s otherwise, using traditional methods Returns null to indicate an invalid summary value or when all source values are null.
  `MIN`
  Client: iterates through the set of records, picking up all non-null values for the specified field and finding the minimum value, where comparison between values is made: via `SimpleType.compareValues()` if defined for the field's `type` via `DateUtil.compareLogicalDates()` if the field type inherits from "date" via comparison as String if the field type inherits from "time" via `DateUtil.compareDates()` for two values that are both `com.smartgwt.client.util.Date`s otherwise, using traditional methods Returns null to indicate an invalid summary value or when all source values are null.
  `MULTIPLIER`
  Client: iterates through the set of records, picking up all numeric values for the specified field and multiplying them together.
  `SUM`
  Client: iterates through the set of records, picking up and summing all numeric values for the specified field.
  `TITLE`
  Client: returns `field.summaryValueTitle` if specified, otherwise `field.title`
  Server: not supported.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getValue()`
  `static SummaryFunctionType`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static SummaryFunctionType[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### SUM

    public static final SummaryFunctionType SUM
    Client: iterates through the set of records, picking up and summing all numeric values for the specified field. Returns null to indicate invalid summary value if any non numeric field values are encountered.
    Server: acts exactly like SQL SUM function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "sum".

  - ### AVG

    public static final SummaryFunctionType AVG
    Client: iterates through the set of records, picking up all numeric values for the specified field and determining the mean value. Returns null to indicate invalid summary value if any non numeric field values are encountered.
    Server: acts exactly like SQL AVG function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "avg".

  - ### MAX

    public static final SummaryFunctionType MAX
    Client: iterates through the set of records, picking up all non-null values for the specified field and finding the maximum value, where comparison between values is made:
    1. via `SimpleType.compareValues()` if defined for the field's `type`
    2. via `DateUtil.compareLogicalDates()` if the field type inherits from "date"
    3. via comparison as String if the field type inherits from "time"
    4. via `DateUtil.compareDates()` for two values that are both `com.smartgwt.client.util.Date`s
    5. otherwise, using traditional methods
    Returns null to indicate an invalid summary value or when all source values are null. For best results, ensure that the `Field.type` is correctly set.
    Server: acts exactly like the SQL MAX aggregate function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "max".

  - ### MIN

    public static final SummaryFunctionType MIN
    Client: iterates through the set of records, picking up all non-null values for the specified field and finding the minimum value, where comparison between values is made:
    1. via `SimpleType.compareValues()` if defined for the field's `type`
    2. via `DateUtil.compareLogicalDates()` if the field type inherits from "date"
    3. via comparison as String if the field type inherits from "time"
    4. via `DateUtil.compareDates()` for two values that are both `com.smartgwt.client.util.Date`s
    5. otherwise, using traditional methods
    Returns null to indicate an invalid summary value or when all source values are null. For best results, ensure that the `Field.type` is correctly set.
    Server: acts exactly like the SQL MIN aggregate function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "min".

  - ### MULTIPLIER

    public static final SummaryFunctionType MULTIPLIER
    Client: iterates through the set of records, picking up all numeric values for the specified field and multiplying them together. Returns null to indicate invalid summary value if any non numeric field values are encountered.
    Server: not supported.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "multiplier".

  - ### COUNT

    public static final SummaryFunctionType COUNT
    Client: returns a numeric count of the total number of records passed in.
    Server: acts exactly like SQL COUNT function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "count".

  - ### TITLE

    public static final SummaryFunctionType TITLE
    Client: returns `field.summaryValueTitle` if specified, otherwise `field.title`
    Server: not supported.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "title".

  - ### FIRST

    public static final SummaryFunctionType FIRST
    Client: Currently the same as the min function.
    Server: implemented as SQL MIN function.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "first".

  - ### CONCAT

    public static final SummaryFunctionType CONCAT
    Client: iterates through the set of records, producing a string with each value concatenated to the end.
    Server: implemented as a native SQL aggregate expression by the Oracle (LISTAGG), PostgreSQL (string_agg), and MySQL (GROUP_CONCAT) database drivers. Other SQL drivers perform an additional query to fetch the values for concatenation. Also supported for generic dataSources that do not have inherent support for aggregation ? see the description of this in the `allowAggregation` documentation. Not supported by JPA or Hibernate dataSources. See also `joinPrefix`, `joinString` and `joinSuffix` related datasource field attributes.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "concat".

  - ### CONCATDISTINCT

    public static final SummaryFunctionType CONCATDISTINCT
    Client: like "concat", but removes duplicate values before concatenation.
    Server: natively supported on Oracle 19c+ (LISTAGG DISTINCT), PostgreSQL 9.0+ (string_agg DISTINCT), and MySQL (GROUP_CONCAT DISTINCT). On other SQL databases, deduplication is applied programmatically after fetching values. Also supported client-side for clientOnly and cached dataSources. See also `joinPrefix`, `joinString` and `joinSuffix` related datasource field attributes.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "concatDistinct".

  - ### ARRAY

    public static final SummaryFunctionType ARRAY
    Client: The same approach as for "concat"but returning an array of the values, rather than a string concatenation
    Server: The same approach as for "concat", and with the same restrictons and limitations, but returning an array of the values, rather than a string concatenation.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "array".

- ## Method Details

  - ### values

    public static SummaryFunctionType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static SummaryFunctionType valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### getValue

    public String getValue()
    Specified by:
      `getValue` in interface `ValueEnum`