zoukankan      html  css  js  c++  java
  • JAVA-Stream

    最简单的例子:
    List<String> list = Stream.of("aaa", "bbb", "ccc").map(item -> item + "xx").collect(Collectors.toList());
    System.out.println(list);

    常见的操作可以归类如下。

    • Intermediate:

    map (mapToInt, flatMap 等)、 filter、 distinct、 sorted、 peek、 limit、 skip、 parallel、 sequential、 unordered

    • Terminal:

    forEach、 forEachOrdered、 toArray、 reduce、 collect、 min、 max、 count、 anyMatch、 allMatch、 noneMatch、 findFirst、 findAny、 iterator

    • Short-circuiting:

    anyMatch、 allMatch、 noneMatch、 findFirst、 findAny、 limit

    参考

    https://www.ibm.com/developerworks/cn/java/j-lo-java8streamapi/

  • 相关阅读:
    自闭的D7
    D2
    Codeforces Round #531 (Div. 3)
    hello 2019 D
    牛客练习赛36B
    cf954H
    gym102007 E
    Gym 101972
    Gym 101810
    试题 历届试题 青蛙跳杯子(bfs)
  • 原文地址:https://www.cnblogs.com/ENU7/p/9685207.html
Copyright © 2011-2022 走看看