reduce

归约操作:将流归约成一个值

int num = list.stream().reduce(0, (a, b) -> a + b);

map和reduce的连接通常称为map-reduce模式,因Google用它来进行网络搜索而出名,因为它很容易并行化

results matching ""

    No results matching ""