Stream操作分类 | ||
中间操作(Intermediate operations) | 无状态 | unordered()、filter()、map()、mapToInt()、mapToLong() mapToDouble()、flatMap()、flatMapToInt()、flatMapToLong() flatMapToDouble()、peek() |
有状态 | distinct()、sorted()、limit()、skip() | |
终端操作(Terminal operations) | 非短路操作 | forEach()、forEachOrdered()、toArray()、reduce()、collect max()、min()、count() |
短路操作 | anyMatch()、allMatch()、noneMatch()、findFirst()、findAny() |
原文:https://www.cnblogs.com/nxf-rabbit75/p/13702869.html