com.smartgwt.client.types
Enum SummaryFunctionType

java.lang.Object
  extended by java.lang.Enum<SummaryFunctionType>
      extended by com.smartgwt.client.types.SummaryFunctionType
All Implemented Interfaces:
ValueEnum, Serializable, Comparable<SummaryFunctionType>

public enum SummaryFunctionType
extends Enum<SummaryFunctionType>
implements ValueEnum

Function to produce a summary value based on an array of records and a field definition. An example usage is the 'summary row', where a row is shown at the bottom of the listGrid containing summary information about each column.

SummaryFunctions may be specified in one of 2 ways:


Enum Constant Summary
AVG
          Iterates through the set of records, picking up all numeric values for the specified field and determining the mean value.
COUNT
          Returns a numeric count of the total number of records passed in.
MAX
          Iterates through the set of records, picking up all values for the specified field and finding the maximum value.
MIN
          Iterates through the set of records, picking up all values for the specified field and finding the minimum value.
MULTIPLIER
          Iterates through the set of records, picking up all numeric values for the specified field and multiplying them together.
SUM
          Iterates through the set of records, picking up and summing all numeric values for the specified field.
TITLE
          Returns field.summaryValueTitle if specified, otherwise field.title
 
Method Summary
 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, 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
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.


AVG

public static final SummaryFunctionType AVG
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.


MAX

public static final SummaryFunctionType MAX
Iterates through the set of records, picking up all values for the specified field and finding the maximum value. Handles numeric fields and date type fields only. Returns null to indicate invalid summary value if any non numeric/date field values are encountered.


MIN

public static final SummaryFunctionType MIN
Iterates through the set of records, picking up all values for the specified field and finding the minimum value. Handles numeric fields and date type fields only. Returns null to indicate invalid summary value if any non numeric field values are encountered.


MULTIPLIER

public static final SummaryFunctionType MULTIPLIER
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.


COUNT

public static final SummaryFunctionType COUNT
Returns a numeric count of the total number of records passed in.


TITLE

public static final SummaryFunctionType TITLE
Returns field.summaryValueTitle if specified, otherwise field.title

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(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