@Public public class AverageAccumulator extends Object implements SimpleAccumulator<Double>
long
, integer
, or
double
and the result is double
.Constructor and Description |
---|
AverageAccumulator() |
Modifier and Type | Method and Description |
---|---|
void |
add(double value) |
void |
add(Double value) |
void |
add(int value) |
void |
add(long value) |
AverageAccumulator |
clone()
Duplicates the accumulator.
|
Double |
getLocalValue() |
void |
merge(Accumulator<Double,Double> other)
Used by system internally to merge the collected parts of an accumulator at the end of the
job.
|
void |
resetLocal()
Reset the local value.
|
String |
toString() |
public void add(Double value)
add
in interface Accumulator<Double,Double>
value
- The value to add to the accumulator objectpublic void add(double value)
public void add(long value)
public void add(int value)
public Double getLocalValue()
getLocalValue
in interface Accumulator<Double,Double>
public void resetLocal()
Accumulator
resetLocal
in interface Accumulator<Double,Double>
public void merge(Accumulator<Double,Double> other)
Accumulator
merge
in interface Accumulator<Double,Double>
other
- Reference to accumulator to merge in.public AverageAccumulator clone()
Accumulator
CloneNotSupportedException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.