Kousen K. - Modern Java Recipes [2017, PDF, ENG]

Ответить на тему
Статистика раздачи
Размер:  2 MB   |    Зарегистрирован:  5 лет 8 месяцев   |    Скачан:  0 раз

Полного источника не было: Никогда

 
   
 
 
Автор Сообщение

admin ®

Статус: Не в сети

Стаж: 6 лет 6 месяцев

Сообщений: 23700

Репутация: 0 [+] [-]

Откуда: Россия

Создавать темы 30-Июл-2018 04:00 | #1

[Цитировать]

Modern Java Recipes
Год издания: 2017
Автор: Kousen K.
Издательство: O'Reilly Media
ISBN: 978-1491973172
Язык: Английский
Формат: PDF
Качество: Издательский макет или текст (eBook)
Интерактивное оглавление: Да
Количество страниц: 322
Описание: The introduction of functional programming concepts in Java SE 8 was a drastic change for this venerable object-oriented language. Lambda expressions, method references, and streams fundamentally changed the idioms of the language, and many developers have been trying to catch up ever since. This cookbook will help. With more than 70 detailed recipes, author Ken Kousen shows you how to use the newest features of Java to solve a wide range of problems.For developers comfortable with previous Java versions, this guide covers nearly all of Java SE 8, and includes a chapter focused on changes coming in Java 9. Need to understand how functional idioms will change the way you write code? This cookbook—chock full of use cases—is for you.Recipes cover:- The basics of lambda expressions and method references
- Interfaces in the java.util.function package
- Stream operations for transforming and filtering data
- Comparators and Collectors for sorting and converting streaming data
- Combining lambdas, method references, and streams
- Creating instances and extract values from Java’s Optional type
- New I/O capabilities that support functional streams
- The Date-Time API that replaces the legacy Date and Calendar classes
- Mechanisms for experimenting with concurrency and parallelism

Примеры страниц

Оглавление

Table of ContentsForeword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1. The Basics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Lambda Expressions 2
1.2 Method References 6
1.3 Constructor References 10
1.4 Functional Interfaces 15
1.5 Default Methods in Interfaces 18
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. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 39
3.1 Creating Streams 39
3.2 Boxed Streams 43
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 60
3.7 Counting Elements 63
3.8 Summary Statistics 65
3.9 Finding the First Element in a Stream 68
3.10 Using anyMatch, allMatch, and noneMatch 73
3.11 Stream flatMap Versus map 75
3.12 Concatenating Streams 79
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 97
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 Map 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 I/O. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 165
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
8. The java.time Package. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 175
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 Interface 217
9.5 Completing a CompletableFuture 220
9.6 Coordinating CompletableFutures, Part 1 225
9.7 Coordinating CompletableFutures, Part 2 231
10. Java 9 Additions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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, takeWhile, and dropWhile 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
Доп. информация: Исходный код:
https://github.com/kousen/java_8_recipes
[ivtracker.org].t6311.torrent 
 ЗОЛОТАЯ РАЗДАЧА! СКАЧАННОЕ НЕ ЗАСЧИТЫВАЕТСЯ! 
Торрент: Зарегистрирован [ 2018-07-30 04:00 ] · 69A321C2E7912412C248AB907D618990189F274F

Скачать .torrent

Скачать

1 KB

Статус: проверено · admin · 5 лет 8 месяцев назад
Скачан: 0 раз
Размер: 2 MB
Поделиться:
 
Похожие темы
[Профиль] [ЛС]
Вернуться к началу
Показать сообщения:    
Ответить на тему

Текущее время: 24-Апр 08:53

Часовой пояс: UTC + 3



Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете прикреплять файлы к сообщениям
Вы можете скачивать файлы