Skip to content
Snippets Groups Projects
Commit 493c71a2 authored by Daniel Schramm's avatar Daniel Schramm
Browse files

Variable renamed

parent 29b865b5
No related branches found
No related tags found
No related merge requests found
......@@ -68,10 +68,10 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public BiConsumer<IntemediateResults, T> accumulator() {
return (result, streamElement) -> {
result.weightedValSum += valueFunction.applyAsDouble(streamElement)
return (iResult, streamElement) -> {
iResult.weightedValSum += valueFunction.applyAsDouble(streamElement)
* weightFunction.applyAsDouble(streamElement);
result.weightSum += weightFunction.applyAsDouble(streamElement);
iResult.weightSum += weightFunction.applyAsDouble(streamElement);
};
}
......@@ -85,11 +85,11 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public BinaryOperator<IntemediateResults> combiner() {
return (result1, result2) -> {
result1.weightedValSum += result2.weightedValSum;
result1.weightSum += result2.weightSum;
return (iResult1, iResult2) -> {
iResult1.weightedValSum += iResult2.weightedValSum;
iResult1.weightSum += iResult2.weightSum;
return result1;
return iResult1;
};
}
......@@ -108,7 +108,7 @@ public class WeightedAverageCollector<T> implements Collector<T, IntemediateResu
*/
@Override
public Function<IntemediateResults, Double> finisher() {
return result -> result.weightedValSum / result.weightSum;
return iResult -> iResult.weightedValSum / iResult.weightSum;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment