- Apache Spark 2.x for Java Developers
- Sourav Gulati Sumit Kumar
- 45字
- 2021-07-02 19:01:59
Groupings
The elements of streams can also be grouped using Collectors, returning a map, such that for a key of type T, the Collector generates a Map<T,List<Y>>:
//Grouping Collectors
Map<Integer,List<String>>groupExample= streamSupplier.get().collect(Collectors.groupingBy(x-> x.toString().length()));
System.out.println("Grouping stream elements on the basis of its length :: " + groupExample);
推薦閱讀
- Mobile Application Development:JavaScript Frameworks
- 技術領導力:程序員如何才能帶團隊
- Neo4j Essentials
- The React Workshop
- Mastering LibGDX Game Development
- Canvas Cookbook
- Python趣味編程與精彩實例
- IoT Projects with Bluetooth Low Energy
- HTML+CSS+JavaScript網頁制作:從入門到精通(第4版)
- JavaScript Concurrency
- 你好!Java
- SCRATCH編程課:我的游戲我做主
- MySQL從入門到精通
- 計算機輔助設計與繪圖技術(AutoCAD 2014教程)(第三版)
- HTML5+CSS3+JavaScript案例實戰