首页 > 其他 > 详细

Stream Introduction

时间:2020-04-30 23:05:47      阅读:53      评论:0      收藏:0      [点我收藏+]

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/12811475.html

 

Definition

A short definition is a sequence of elements from a source that supports data processing operations.

 

intermediate vs. terminal operations

技术分享图片

 

Intermediate operations

Intermediate operations such as filter or sorted return another stream as the return type. This allows the operations to be connected to form a query. What’s important is that intermediate operations don’t perform any processing until a terminal operation is invoked on the stream pipeline—they’re lazy. This is because intermediate operations can usually be merged and processed into a single pass by the terminal operation.

技术分享图片

 

Terminal operations

Terminal operations produce a result from a stream pipeline. A result is any nonstream value such as a List, an Integer, or even void.

技术分享图片

 

Reference

Manning.Java.8.in.Action.Lambdas.Streams.and.functional-style.programming

 

Stream Introduction

原文:https://www.cnblogs.com/agilestyle/p/12811475.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!