OReilly.Modern.Java.Recipes.2017.8

所需积分/C币:9 2017-10-23 10:30:10 2.23MB PDF
8
收藏 收藏
举报

OReilly.Modern.Java.Recipes.2017.8 OReilly.Modern.Java.Recipes.2017.8
Modern Java recipes Simple solutions to Dificult problems in java 8 and 9 Ken Kousen Beijing·.oton: Farnham: Sebastopol Tokyo○RELY° Modern Java Recipes by Ken Kousen Copyright o 2017 Ken Kousen. All rights reserved Printed in the United states of america Published by O reilly Media, Inc, 1005 Gravenstein Highway North, Sebastopol, CA95472 OReilly books may be purchased for educational, business, or sales promotional use. Online editions are alsoavailableformosttitles(http://oreilly.com/safari).Formoreinformationcontactourcorporate/insti tutionalsalesdepartment800-998-9938orcorporate@oreilly.com Editors: Brian Foster and Jeff bleiel Indexer: Ellen Troutman-Zaig Production Editor: Justin Billing Interior Designer: David Futato 〔 opyeditor: Kim Cofer Cover Designer: Karen Montgomery Proofreader: Jasmine Kwityn Illustrator: Rebecca demarest August 2017 First edition Revision History for the First Edition 2017-08-04: First Release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781491973172forreleasedetails The OReilly logo is a registered trademark of O Reilly Media, Inc. Modern Java Recipes, the cover image, and related trade dress are trademarks of o reilly media, Inc While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and or rights 978-1-491-97317-2 ILSI Hey Xander, this one's yours. Surprise Table of contents Foreword iX Preface 1. The basics 鲁鲁鲁春鲁 1.1 Lambda Expressions 1.2 Method references 1. 3 Constructor References 1. 4 Functional interfaces 1.5 Default Methods in interfaces 058 1.6 Static Methods in Interfaces 21 2. The java util. function Package. 25 2.1 Consumers 26 2.2 Suppliers 28 2. 3 Predicates 31 2.4 Functions 35 3. Streams e。。。 39 3.1 Creating Streams 39 3.2 Boxed streams 3.3 Reduction Operations USing Reduce 46 3.4 Check Sorting Using reduce 55 3.5 Debugging Streams with peek 57 3.6 Converting Strings to Streams and Back 3.7 Counting elements 3. 8 Summary statistics 65 3.9 Finding the First Element in a Stream 68 3.10 Using any Match, allMatch, and noneMatch 3. 11 Stream flatMap Versus map 3.12 Concatenating Streams 3. 13 Lazy Streams 83 4. Comparators and Collectors. 87 4.1 Sorting Using a Comparator 87 4.2 Converting a Stream into a Collection 91 4.3 Adding a Linear Collection to a Map 94 4.4 Sorting maps 4.5 Partitioning and Grouping 100 4.6 Downstream collectors 102 4.7 Finding max and Min values 104 4.8 Creating Immutable Collections 107 4.9 Implementing the Collector Interface 109 5. Issues with Streams Lambdas and method references. ............ 115 5. 1 The java util. Objects Class 115 5.2 Lambdas and Effectively final 117 5. 3 Streams of Random Numbers 120 5. 4 Default methods in ma p 122 5.5 Default method Conflict 127 5.6 Iterating Over Collections and Maps 130 5. 7 Logging with a Supplier 132 5.8 Closure Composition 134 5.9 USing an Extracted Method for Exception Handling 138 5.10 Checked Exceptions and lambdas 141 5. 11 USing a Generic Exception Wrapper 144 6. The Optional Type 147 6.1 Creating an Optional 148 6.2 Retrieving Values from an Optional 150 6.3 Optional in Getters and Setters 154 6.4 Optional flatMap Versus map 156 6.5 Mapping Optionals 160 7. File 1/0 7.1 Process files 166 7.2 Retrieving Files as a Stream 169 7.3 Walking the Filesystem 170 7. 4 Searching the Filesystem 172 Table of contents 8. The java. time Package 8.1 Using the Basic Date-Time Classes 176 8.2 Creating Dates and Times from Existing Instances 180 8.3 Adjusters and Queries 185 8.4 Convert from java. util. Date to java. time. LocalDate 190 8.5 Parsing and Formatting 194 8.6 Finding Time Zones with Unusual Offsets 197 8.7 Finding Region Names from Offsets 200 8. 8 Time between events 202 9. Parallelism and〔 concurrency.…, 205 9.1 Converting from Sequential to Parallel Streams 206 9.2 When Parallel Helps 209 9.3 Changing the Pool size 215 9.4 The Future Interfac 217 9.5 Completing a CompletableFuture 220 9.6 Coordinating Completable Futures, Part 1 225 9.7 Coordinating Completable Futures, Part 2 231 10. Java 9 Additions.....4.....239 10. 1 Modules in Jigsaw 240 10.2 Private Methods in interfaces 245 10.3 Creating Immutable Collections 247 10.4 Stream: ofNullable, iterate take while, and drop while 252 10.5 Downstream Collectors: filtering and flatMapping 255 10.6 Optional: stream, or, ifPresentOrElse 259 10.7 Date Ranges 262 A. Generics and Java 8 267 Index ,287 Table of contents

...展开详情
试读 127P OReilly.Modern.Java.Recipes.2017.8
立即下载 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • 分享王者

关注 私信
上传资源赚钱or赚积分
最新推荐
OReilly.Modern.Java.Recipes.2017.8 9积分/C币 立即下载
1/127
OReilly.Modern.Java.Recipes.2017.8第1页
OReilly.Modern.Java.Recipes.2017.8第2页
OReilly.Modern.Java.Recipes.2017.8第3页
OReilly.Modern.Java.Recipes.2017.8第4页
OReilly.Modern.Java.Recipes.2017.8第5页
OReilly.Modern.Java.Recipes.2017.8第6页
OReilly.Modern.Java.Recipes.2017.8第7页
OReilly.Modern.Java.Recipes.2017.8第8页
OReilly.Modern.Java.Recipes.2017.8第9页
OReilly.Modern.Java.Recipes.2017.8第10页
OReilly.Modern.Java.Recipes.2017.8第11页
OReilly.Modern.Java.Recipes.2017.8第12页
OReilly.Modern.Java.Recipes.2017.8第13页
OReilly.Modern.Java.Recipes.2017.8第14页
OReilly.Modern.Java.Recipes.2017.8第15页
OReilly.Modern.Java.Recipes.2017.8第16页
OReilly.Modern.Java.Recipes.2017.8第17页
OReilly.Modern.Java.Recipes.2017.8第18页
OReilly.Modern.Java.Recipes.2017.8第19页
OReilly.Modern.Java.Recipes.2017.8第20页

试读结束, 可继续阅读

9积分/C币 立即下载