Class ColumnAverageExpression
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.ColumnAggregationExpression
-
- org.pentaho.reporting.engine.classic.core.function.ColumnAverageExpression
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Expression
public class ColumnAverageExpression extends ColumnAggregationExpression
Deprecated.the same can be achived with a formula "AVG([column1], [column2], [column3])"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 theItemAvgFunction
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
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ColumnAverageExpression()
Deprecated.Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
getRoundingMode()
Deprecated.Returns the defined rounding mode.int
getScale()
Deprecated.Returns the scale for the divide-operation.Object
getValue()
Deprecated.Computes the horizontal average of all field in the field-list.boolean
isOnlyValidFields()
Deprecated.Returns, whether non-numeric and null-values are ignored for the average-computation.boolean
isReturnInfinity()
Deprecated.Returns, whether the expression returns infinity if there are no valid fields.void
setOnlyValidFields(boolean onlyValidFields)
Deprecated.Defines, whether non-numeric and null-values are ignored for the average-computation.void
setReturnInfinity(boolean returnInfinity)
Deprecated.Defines, whether the expression returns infinity if there are no valid fields.void
setRoundingMode(int roundingMode)
Deprecated.Defines the rounding mode.void
setScale(int scale)
Deprecated.Defines the scale for the divide-operation.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.ColumnAggregationExpression
getField, getField, getFieldCount, getFieldValues, getInstance, setField, setField
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
-
-
-
Method Detail
-
getRoundingMode
public int getRoundingMode()
Deprecated.Returns the defined rounding mode. This influences the precision of the divide-operation.- Returns:
- the rounding mode.
- See Also:
BigDecimal.divide(java.math.BigDecimal, int)
-
setRoundingMode
public void setRoundingMode(int roundingMode)
Deprecated.Defines the rounding mode. This influences the precision of the divide-operation.- Parameters:
roundingMode
- the rounding mode.- See Also:
BigDecimal.divide(java.math.BigDecimal, int)
-
getScale
public int getScale()
Deprecated.Returns the scale for the divide-operation. The scale influences the precision of the division.- Returns:
- the scale.
-
setScale
public void setScale(int scale)
Deprecated.Defines the scale for the divide-operation. The scale influences the precision of the division.- Parameters:
scale
- the scale.
-
isReturnInfinity
public boolean isReturnInfinity()
Deprecated.Returns, whether the expression returns infinity if there are no valid fields. If set to false, this expression returns null instead.- Returns:
- true, if infinity is returned, false otherwise.
-
setReturnInfinity
public void setReturnInfinity(boolean returnInfinity)
Deprecated.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.
-
isOnlyValidFields
public boolean isOnlyValidFields()
Deprecated.Returns, whether non-numeric and null-values are ignored for the average-computation.- Returns:
- true, if the invalid fields will be ignored, false if they count as valid zero-value fields.
-
setOnlyValidFields
public void setOnlyValidFields(boolean onlyValidFields)
Deprecated.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-value fields.
-
getValue
public Object getValue()
Deprecated.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 theItemAvgFunction
instead.- Returns:
- the value of the function.
-
-