Class AverageExpression
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.AverageExpression
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Expression
public class AverageExpression extends AbstractExpression
Deprecated.this has been replaced by the ColumnAverageExpression.An expression that takes values from one or more fields and returns the average of them.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AverageExpression()
Deprecated.Creates a new expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String[]
getField()
Deprecated.Returns the defined fields as array.String
getField(int index)
Deprecated.Returns the defined field at the given index-position.int
getFieldCount()
Deprecated.Returns the number of fields defined in this expression.Expression
getInstance()
Deprecated.Clones the expression.int
getRoundingMode()
Deprecated.Returns the defined rounding mode.int
getScale()
Deprecated.Returns the scale for the divide-operation.Object
getValue()
Deprecated.Returns the average of the values.void
setField(int index, String field)
Deprecated.Defines the field in the field-list at the given index.void
setField(String[] fields)
Deprecated.Defines all fields as array.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.AbstractExpression
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
-
-
-
Constructor Detail
-
AverageExpression
public AverageExpression()
Deprecated.Creates a new expression. The fields used by the expression are defined using properties named '0', '1', ... 'N'. These fields should containNumber
instances.
-
-
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.
-
getValue
public Object getValue()
Deprecated.Returns the average of the values.- Returns:
- a BigDecimal instance.
-
getInstance
public Expression getInstance()
Deprecated.Clones the expression.- Specified by:
getInstance
in interfaceExpression
- Overrides:
getInstance
in classAbstractExpression
- Returns:
- A copy of this expression.
-
getField
public String[] getField()
Deprecated.Returns the defined fields as array.- Returns:
- the fields
-
setField
public void setField(String[] fields)
Deprecated.Defines all fields as array. This completely replaces any previously defined fields.- Parameters:
fields
- the new list of fields.
-
getField
public String getField(int index)
Deprecated.Returns the defined field at the given index-position.- Parameters:
index
- the position of the field name that should be queried.- Returns:
- the field name at the given position.
-
setField
public void setField(int index, String field)
Deprecated.Defines the field in the field-list at the given index.- Parameters:
index
- the position in the list, where the field should be defined.field
- the name of the field.
-
getFieldCount
public int getFieldCount()
Deprecated.Returns the number of fields defined in this expression.- Returns:
- the number of fields.
-
-