com.smartgwt.client.types

## Enum SummaryFunctionType

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

- All Implemented Interfaces:
    ValueEnum, java.io.Serializable, java.lang.Comparable<SummaryFunctionType>

      public enum SummaryFunctionType
      extends java.lang.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).

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and 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 SQL CONCAT function by the Oracle database driver; other SQL drivers perform an additional query to fetch the values for concatenation.
    `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 values for the specified field and finding the maximum value.
    `MIN` Client: iterates through the set of records, picking up all values for the specified field and finding the minimum value.
    `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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getValue()`
    `static SummaryFunctionType` | `valueOf(java.lang.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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- - ### Enum Constant Detail

    - #### 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 values for the specified field and finding the maximum value. Handles numeric fields and date/time/datetime type fields only. Returns null to indicate invalid summary value if any non numeric/date field values are encountered.
      Server: acts exactly like SQL MAX 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 values for the specified field and finding the minimum value. Handles numeric fields and date/time/datetime type fields only. Returns null to indicate invalid summary value if any non numeric field values are encountered.
      Server: acts exactly like 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 "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 SQL CONCAT function by the Oracle database driver; other SQL drivers perform an additional query to fetch the values for concatenation. This function is 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. Note: This function is only supported for `DataSourceField.includeSummaryFunction`; it is not supported in other summary contexts, such as `DSRequest.summaryFunctions`. 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".

    - #### 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 Detail

    - #### values

          public static SummaryFunctionType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (SummaryFunctionType c : SummaryFunctionType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static SummaryFunctionType valueOf(java.lang.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:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public java.lang.String getValue()

      Specified by:
        `getValue` in interface `ValueEnum`