Class DoubleSumAggregator
- java.lang.Object
-
- org.apache.flink.api.common.aggregators.DoubleSumAggregator
-
- All Implemented Interfaces:
Serializable,Aggregator<DoubleValue>
@PublicEvolving public class DoubleSumAggregator extends Object implements Aggregator<DoubleValue>
AnAggregatorthat sums upDoubleValuevalues.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DoubleSumAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaggregate(double value)Adds the given value to the current aggregate.voidaggregate(DoubleValue element)Aggregates the given element.DoubleValuegetAggregate()Gets the aggregator's current aggregate.voidreset()Resets the internal state of the aggregator.
-
-
-
Method Detail
-
getAggregate
public DoubleValue getAggregate()
Description copied from interface:AggregatorGets the aggregator's current aggregate.- Specified by:
getAggregatein interfaceAggregator<DoubleValue>- Returns:
- The aggregator's current aggregate.
-
aggregate
public void aggregate(DoubleValue element)
Description copied from interface:AggregatorAggregates the given element. In the case of a sum aggregator, this method adds the given value to the sum.- Specified by:
aggregatein interfaceAggregator<DoubleValue>- Parameters:
element- The element to aggregate.
-
aggregate
public void aggregate(double value)
Adds the given value to the current aggregate.- Parameters:
value- The value to add to the aggregate.
-
reset
public void reset()
Description copied from interface:AggregatorResets the internal state of the aggregator. This must bring the aggregator into the same state as if it was newly initialized.- Specified by:
resetin interfaceAggregator<DoubleValue>
-
-