找传奇、传世资源到传世资源站!

java8函数式编程.pdf

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

函数式编程好书
from clipboard from clipboard
前言.........................................................................................................................................................IX第 1 章 简介.........................................................................................................................................11.1 为什么需要再次修改 Java.........................................................................................................11.2 什么是函数式编程.....................................................................................................................21.3 示例.............................................................................................................................................2第 2 章 Lambda 表达式...................................................................................................................52.1 第一个 Lambda 表达式..............................................................................................................52.2 如何辨别 Lambda 表达式..........................................................................................................62.3 引用值,而不是变量.................................................................................................................82.4 函数接口.....................................................................................................................................92.5 类型推断...................................................................................................................................102.6 要点回顾...................................................................................................................................122.7 练习...........................................................................................................................................12第 3 章 流...........................................................................................................................................153.1 从外部迭代到内部迭代...........................................................................................................153.2 实现机制...................................................................................................................................173.3 常用的流操作...........................................................................................................................193.3.1 collect(toList()) ..................................................................................................193.3.2 map............................................................................................................................193.3.3 filter ......................................................................................................................213.3.4 flatMap ....................................................................................................................22VI | 目录3.3.5 max 和 min.................................................................................................................233.3.6 通用模式 ......................................................................................................................243.3.7 reduce ......................................................................................................................243.3.8 整合操作 ......................................................................................................................263.4 重构遗留代码...........................................................................................................................273.5 多次调用流操作.......................................................................................................................303.6 高阶函数...................................................................................................................................313.7 正确使用 Lambda 表达式........................................................................................................313.8 要点回顾...................................................................................................................................323.9 练习...........................................................................................................................................323.10 进阶练习.................................................................................................................................33第 4 章 类库.......................................................................................................................................354.1 在代码中使用 Lambda 表达式................................................................................................354.2 基本类型...................................................................................................................................364.3 重载解析...................................................................................................................................384.4 @FunctionalInterface ........................................................................................................404.5 二进制接口的兼容性...............................................................................................................404.6 默认方法...................................................................................................................................414.7 多重继承...................................................................................................................................454.8 权衡...........................................................................................................................................464.9 接口的静态方法.......................................................................................................................464.10 Optional.............................................................................................................................474.11 要点回顾.................................................................................................................................484.12 练习.........................................................................................................................................484.13 开放练习.................................................................................................................................49第 5 章 高级集合类和收集器........................................................................................................515.1 方法引用...................................................................................................................................515.2 元素顺序...................................................................................................................................525.3 使用收集器...............................................................................................................................545.3.1 转换成其他集合 ..........................................................................................................545.3.2 转换成值 ......................................................................................................................555.3.3 数据分块 ......................................................................................................................555.3.4 数据分组 ......................................................................................................................565.3.5 字符串 ..........................................................................................................................575.3.6 组合收集器 ..................................................................................................................585.3.7 重构和定制收集器 ......................................................................................................60目录 | VII5.3.8 对收集器的归一化处理 ..............................................................................................655.4 一些细节...................................................................................................................................665.5 要点回顾...................................................................................................................................675.6 练习...........................................................................................................................................67第 6 章 数据并行化 .........................................................................................................................696.1 并行和并发...............................................................................................................................696.2 为什么并行化如此重要...........................................................................................................706.3 并行化流操作...........................................................................................................................716.4 模拟系统...................................................................................................................................726.5 限制...........................................................................................................................................756.6 性能...........................................................................................................................................756.7 并行化数组操作.......................................................................................................................786.8 要点回顾...................................................................................................................................806.9 练习...........................................................................................................................................80第 7 章 测试、调试和重构............................................................................................................817.1 重构候选项...............................................................................................................................817.1.1 进进出出、摇摇晃晃 ..................................................................................................827.1.2 孤独的覆盖 ..................................................................................................................827.1.3 同样的东西写两遍 ......................................................................................................837.2 Lambda 表达式的单元测试.....................................................................................................857.3 在测试替身时使用 Lambda 表达式........................................................................................877.4 惰性求值和调试.......................................................................................................................897.5 日志和打印消息.......................................................................................................................897.6 解决方案:peak...................................................................................................................907.7 在流中间设置断点...................................................................................................................907.8 要点回顾...................................................................................................................................90第 8 章 设计和架构的原则............................................................................................................918.1 Lambda 表达式改变了设计模式.............................................................................................928.1.1 命令者模式 ..................................................................................................................928.1.2 策略模式 ......................................................................................................................958.1.3 观察者模式 ..................................................................................................................978.1.4 模板方法模式 ............................................................................................................1008.2 使用 Lambda 表达式的领域专用语言..................................................................................1028.2.1 使用 Java 编写 DSL...................................................................................................1038.2.2 实现 ............................................................................................................................104VIII | 目录8.2.3 评估 ............................................................................................................................1068.3 使用 Lambda 表达式的 SOLID 原则....................................................................................1068.3.1 单一功能原则 ............................................................................................................1078.3.2 开闭原则 ....................................................................................................................1098.3.3 依赖反转原则 ............................................................................................................ 1118.4 进阶阅读.................................................................................................................................1148.5 要点回顾.................................................................................................................................114第 9 章 使用 Lambda 表达式编写并发程序 ..........................................................................1159.1 为什么要使用非阻塞式 I/O...................................................................................................1159.2 回调.........................................................................................................................................1169.3 消息传递架构.........................................................................................................................1199.4 末日金字塔.............................................................................................................................1209.5 Future ......................................................................................................................................1229.6 CompletableFuture............................................................................................................1239.7 响应式编程.............................................................................................................................1269.8 何时何地使用新技术.............................................................................................................1289.9 要点回顾.................................................................................................................................1299.10 练习.......................................................................................................................................129第 10 章 下一步该怎么办............................................................................................................131封面介绍..............................................................................................................................................133

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复