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

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
    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", but returning an array of the values, rather than a string concatenation.
    Client: iterates through the set of records, picking up all numeric values for the specified field and determining the mean value.
    Client: iterates through the set of records, producing a string with each value concatenated to the end.
    Server: implemented as SQL CONCAT function.
    Client: returns a numeric count of the total number of records passed in.
    Server: acts exactly like SQL COUNT function.
    Client: Currently the same as the min function.
    Server: implemented as SQL MIN function.
    Client: iterates through the set of records, picking up all values for the specified field and finding the maximum value.
    Client: iterates through the set of records, picking up all values for the specified field and finding the minimum value.
    Client: iterates through the set of records, picking up all numeric values for the specified field and multiplying them together.
    Client: iterates through the set of records, picking up and summing all numeric values for the specified field.
    Client: returns field.summaryValueTitle if specified, otherwise field.title
    Server: not supported.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    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 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. Supported only by SQLDataSource. Note that it is natively supported only by Oracle DB driver, other drivers perform additional query to fetch values for concatenation. 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", but returning an array of the values, rather than a string concatenation. As with "concat", supported only by SQLDataSource.

      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