Enum CalculationEnum
- java.lang.Object
-
- java.lang.Enum<CalculationEnum>
-
- net.sf.jasperreports.engine.type.CalculationEnum
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CalculationEnum>,JREnum,NamedEnum
public enum CalculationEnum extends java.lang.Enum<CalculationEnum> implements JREnum
- Author:
- Sanda Zaharia (shertage@users.sourceforge.net)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AVERAGEThe value is obtained by calculating the average for the series of values obtained by evaluating the variable's expression for each record in the data source.COUNTThe value is calculated by counting the non-null values of the variable expression with every iteration in the data source.DISTINCT_COUNTThe value is calculated by counting the distinct non-null values of the variable expression with every iteration in the data source.FIRSTThe variable keeps the first value and does not increment it on subsequent iterations.HIGHESTThe value of the variable represents the highest in the series of values obtained by evaluating the variable's expression for each data source record.LOWESTThe value of the variable represents the lowest in the series of values obtained by evaluating the variable's expression for each data source record.NOTHINGThe value is calculated by simply evaluating the variable expression.STANDARD_DEVIATIONThe value is obtained by calculating the standard deviation for the series of values returned by evaluating the variable's expression.SUMThe value is calculated by summing up the values returned by the variable's expression.SYSTEMThe value is not calculated by JasperReports.VARIANCEThe value is obtained by calculating the variance for the series of values returned by evaluating the variable's expression.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CalculationEnumgetByName(java.lang.String name)static CalculationEnumgetByValue(byte value)Deprecated.Used only by deprecated serialized fields.static CalculationEnumgetByValue(java.lang.Byte value)Deprecated.Used only by deprecated serialized fields.java.lang.StringgetName()bytegetValue()java.lang.BytegetValueByte()Deprecated.Used only by deprecated serialized fields.static CalculationEnumvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CalculationEnum[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NOTHING
public static final CalculationEnum NOTHING
The value is calculated by simply evaluating the variable expression.
-
COUNT
public static final CalculationEnum COUNT
The value is calculated by counting the non-null values of the variable expression with every iteration in the data source. The count variable must be numeric, but the variable expression needs not, since its value is not important. On the other hand, the initial value expression must be numeric since it will be the count variable initial value.
-
SUM
public static final CalculationEnum SUM
The value is calculated by summing up the values returned by the variable's expression. Both the main expression and initial expression must have numeric type.
-
AVERAGE
public static final CalculationEnum AVERAGE
The value is obtained by calculating the average for the series of values obtained by evaluating the variable's expression for each record in the data source. Both the main expression and initial expression must have numeric type.In order to calculate the average, the engine creates behind the scenes a helper report variable that calculates the sum of the values and uses it to calculate the average for those values. This helper sum variable gets its name from the corresponding average variable suffixed with "_SUM" sequence. This helper variable can be used in other report expressions just like any normal variable.
-
LOWEST
public static final CalculationEnum LOWEST
The value of the variable represents the lowest in the series of values obtained by evaluating the variable's expression for each data source record.
-
HIGHEST
public static final CalculationEnum HIGHEST
The value of the variable represents the highest in the series of values obtained by evaluating the variable's expression for each data source record.
-
STANDARD_DEVIATION
public static final CalculationEnum STANDARD_DEVIATION
The value is obtained by calculating the standard deviation for the series of values returned by evaluating the variable's expression.Just like for the variables that calculate the average, the engine creates and uses helper report variables for first obtaining the sum and the count that correspond to your current series of values. The name for those helper variables that are created behind the scenes is obtained by suffixing the user variable with the "_SUM" or "_COUNT" suffix and they can be used in other report expressions like any other report variable.
For variables that calculate the standard deviation, there is always a helper variable present, that first calculates the variance for the series of values and it has the "_VARIANCE" suffix added to its name.
-
VARIANCE
public static final CalculationEnum VARIANCE
The value is obtained by calculating the variance for the series of values returned by evaluating the variable's expression.
-
SYSTEM
public static final CalculationEnum SYSTEM
The value is not calculated by JasperReports. The user must calculate the value of the variable, almost certainly using the scriptlets functionality. For this type of calculation, the only thing the engine does is to conserve the value users have calculated, from one iteration in the data source to the next.
-
FIRST
public static final CalculationEnum FIRST
The variable keeps the first value and does not increment it on subsequent iterations.
-
DISTINCT_COUNT
public static final CalculationEnum DISTINCT_COUNT
The value is calculated by counting the distinct non-null values of the variable expression with every iteration in the data source. The count variable must be numeric, but the variable expression needs not, since its value is not important. On the other hand, the initial value expression must be numeric since it will be the count variable initial value.
-
-
Method Detail
-
values
public static CalculationEnum[] 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 (CalculationEnum c : CalculationEnum.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CalculationEnum 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 namejava.lang.NullPointerException- if the argument is null
-
getValueByte
public java.lang.Byte getValueByte()
Deprecated.Used only by deprecated serialized fields.- Specified by:
getValueBytein interfaceJREnum
-
getByName
public static CalculationEnum getByName(java.lang.String name)
-
getByValue
public static CalculationEnum getByValue(java.lang.Byte value)
Deprecated.Used only by deprecated serialized fields.
-
getByValue
public static CalculationEnum getByValue(byte value)
Deprecated.Used only by deprecated serialized fields.
-
-