| java.lang.Object org.jfree.report.function.AbstractExpression org.jfree.report.function.ColumnAggregationExpression org.jfree.report.function.ColumnAverageExpression
ColumnAverageExpression | public class ColumnAverageExpression extends ColumnAggregationExpression (Code) | | Computes the horizontal average over all columns specified in the field-list. The average will be computed over all
fields of the current data-row, it will not be computed for all rows in the group. For that use the
org.jfree.report.function.ItemAvgFunction instead.
Non numeric and null-columns will be treated as zero for the task of summing up all members. Whether these fields are
used counted as valid fields can be controlled with the 'onlyValidFields' flag.
author: Thomas Morgner |
Method Summary | |
public int | getRoundingMode() Returns the defined rounding mode. | public int | getScale() Returns the scale for the divide-operation. | public Object | getValue() Computes the horizontal average of all field in the field-list. | public boolean | isOnlyValidFields() Returns, whether non-numeric and null-values are ignored for the average-computation. | public boolean | isReturnInfinity() Returns, whether the expression returns infinity if there are no valid fields. | public void | setOnlyValidFields(boolean onlyValidFields) Defines, whether non-numeric and null-values are ignored for the average-computation. | public void | setReturnInfinity(boolean returnInfinity) Defines, whether the expression returns infinity if there are no valid fields. | public void | setRoundingMode(int roundingMode) Defines the rounding mode. | public void | setScale(int scale) Defines the scale for the divide-operation. |
ColumnAverageExpression | public ColumnAverageExpression()(Code) | | Default Constructor.
|
getScale | public int getScale()(Code) | | Returns the scale for the divide-operation. The scale influences the precision of the division.
the scale. |
getValue | public Object getValue()(Code) | | Computes the horizontal average of all field in the field-list. The average will be computed over all fields of the
current data-row, it will not be computed for all rows in the group. For that use the
org.jfree.report.function.ItemAvgFunction instead.
the value of the function. |
isOnlyValidFields | public boolean isOnlyValidFields()(Code) | | Returns, whether non-numeric and null-values are ignored for the average-computation.
true, if the invalid fields will be ignored, false if they count as valid zero-value fields. |
isReturnInfinity | public boolean isReturnInfinity()(Code) | | Returns, whether the expression returns infinity if there are no valid fields. If set to false, this expression
returns null instead.
true, if infinity is returned, false otherwise. |
setOnlyValidFields | public void setOnlyValidFields(boolean onlyValidFields)(Code) | | Defines, whether non-numeric and null-values are ignored for the average-computation.
Parameters: onlyValidFields - true, if the invalid fields will be ignored, false if they count as valid zero-valuefields. |
setReturnInfinity | public void setReturnInfinity(boolean returnInfinity)(Code) | | Defines, whether the expression returns infinity if there are no valid fields. If set to false, this expression
returns null instead.
Parameters: returnInfinity - true, if infinity is returned, false otherwise. |
setScale | public void setScale(int scale)(Code) | | Defines the scale for the divide-operation. The scale influences the precision of the division.
Parameters: scale - the scale. |
|
|