This topic created in 1736 days ago, the information mentioned may be changed or developed.
Performs a reduction on the elements of this stream, using the provided identity, accumulation and combining functions. This is equivalent to:
U result = identity;
for (T element : this stream)
result = accumulator.apply(result, element)
return result;
but is not constrained to execute sequentially.
The identity value must be an identity for the combiner function. This means that for all u, combiner(identity, u) is equal to u.
搜了下大概知道这个 combiner 是并行流合并子流 reduce 的结果用的,但是那个 combiner(identity, u) is equal to u.是啥意思
2 replies • 2021-08-09 12:17:10 +08:00
 |
|
1
sosilver Aug 9, 2021 via Android
wiki/Identity_element
|