weixin_39703468 2020-11-29 19:20
浏览 0

Add EntryStream.collapseKeys(): collapse adjacent elements with the equal key

Three signatures are proposed:


// collapse elements with the same key gathering corresponding values to list
EntryStream<k list>> collapseKeys();

// collapse elements with the same key reducing the values with given mergeFunction
EntryStream<k v> collapseKeys(BinaryOperator<v> mergeFunction);

// collapse elements with the same key reducing the values with given Collector
<a r> EntryStream<k r> collapseKeys(Collector<v a r> collector);
</v></k></a></v></k></k>
  • [x] Implementation
  • [x] Tests
  • [x] JavaDoc
  • [x] Changes
  • [x] Cheatsheet

该提问来源于开源项目:amaembo/streamex

  • 写回答

0条回答 默认 最新

    报告相同问题?