Class GroupAverage
java.lang.Object
com.northconcepts.datapipeline.group.GroupOperation<BigDecimal>
com.northconcepts.datapipeline.group.operation.GroupAverage
A
GroupOperation that averages the source field in each group as a BigDecimal; unless
excludeNulls is set, null values count as zero.-
Constructor Summary
ConstructorsConstructorDescriptionGroupAverage(FieldPath sourceFieldName) GroupAverage(FieldPath sourceFieldName, FieldPath targetFieldName) GroupAverage(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls) GroupAverage(String sourceFieldName) GroupAverage(String sourceFieldName, String targetFieldName) GroupAverage(String sourceFieldName, String targetFieldName, boolean excludeNulls) -
Method Summary
Modifier and TypeMethodDescriptionprotected GroupOperationField<BigDecimal> Creates the accumulator that computes this operation's result for one group; called once per group in each window.Returns the rounding applied to the average (defaults toRoundingMode.HALF_UP).intgetScale()Returns the number of decimal places in the average (defaults to 5).setRoundingMode(RoundingMode roundingMode) Sets the rounding applied to the average (defaults toRoundingMode.HALF_UP).setScale(int scale) Sets the number of decimal places in the average (defaults to 5).toString()Methods inherited from class com.northconcepts.datapipeline.group.GroupOperation
getExcludeNulls, getFilter, getSourceFieldName, getSourceFieldPath, getTargetFieldName, getTargetFieldPath, setExcludeNulls, setFilter, setTargetFieldName
-
Constructor Details
-
GroupAverage
-
GroupAverage
-
GroupAverage
-
GroupAverage
-
GroupAverage
-
GroupAverage
-
-
Method Details
-
getScale
public int getScale()Returns the number of decimal places in the average (defaults to 5). -
setScale
Sets the number of decimal places in the average (defaults to 5). -
getRoundingMode
Returns the rounding applied to the average (defaults toRoundingMode.HALF_UP). -
setRoundingMode
Sets the rounding applied to the average (defaults toRoundingMode.HALF_UP). -
createField
Description copied from class:GroupOperationCreates the accumulator that computes this operation's result for one group; called once per group in each window.- Specified by:
createFieldin classGroupOperation<BigDecimal>
-
toString
- Overrides:
toStringin classGroupOperation<BigDecimal>
-