Table of Contents for
Modern Java Recipes

Version ebook / Retour

Cover image for bash Cookbook, 2nd Edition Modern Java Recipes by Ken Kousen Published by O'Reilly Media, Inc., 2017
  1. nav
  2. Cover
  3. Modern Java Recipes
  4. Modern Java Recipes
  5. Dedication
  6. Foreword
  7. Preface
  8. The Basics
  9. The java.util.function Package
  10. Streams
  11. Comparators and Collectors
  12. Issues with Streams, Lambdas, and Method References
  13. The Optional Type
  14. File I/O
  15. The java.time Package
  16. Parallelism and Concurrency
  17. Java 9 Additions
  18. Generics and Java 8
  19. Index
  20. About the Author
  21. Colophon
  1. Foreword
  2. Preface
    1. Modern Java
    2. Who Should Read This Book
    3. How This Book Is Organized
    4. Conventions Used in This Book
    5. Using Code Examples
    6. O’Reilly Safari
    7. How to Contact Us
    8. Acknowledgments
  3. The Basics
    1. 1.1. Lambda Expressions
    2. 1.2. Method References
    3. 1.3. Constructor References
    4. 1.4. Functional Interfaces
    5. 1.5. Default Methods in Interfaces
    6. 1.6. Static Methods in Interfaces
  4. The java.util.function Package
    1. 2.1. Consumers
    2. 2.2. Suppliers
    3. 2.3. Predicates
    4. 2.4. Functions
  5. Streams
    1. 3.1. Creating Streams
    2. 3.2. Boxed Streams
    3. 3.3. Reduction Operations Using Reduce
    4. 3.4. Check Sorting Using Reduce
    5. 3.5. Debugging Streams with peek
    6. 3.6. Converting Strings to Streams and Back
    7. 3.7. Counting Elements
    8. 3.8. Summary Statistics
    9. 3.9. Finding the First Element in a Stream
    10. 3.10. Using anyMatch, allMatch, and noneMatch
    11. 3.11. Stream flatMap Versus map
    12. 3.12. Concatenating Streams
    13. 3.13. Lazy Streams
  6. Comparators and Collectors
    1. 4.1. Sorting Using a Comparator
    2. 4.2. Converting a Stream into a Collection
    3. 4.3. Adding a Linear Collection to a Map
    4. 4.4. Sorting Maps
    5. 4.5. Partitioning and Grouping
    6. 4.6. Downstream Collectors
    7. 4.7. Finding Max and Min Values
    8. 4.8. Creating Immutable Collections
    9. 4.9. Implementing the Collector Interface
  7. Issues with Streams, Lambdas, and Method References
    1. 5.1. The java.util.Objects Class
    2. 5.2. Lambdas and Effectively Final
    3. 5.3. Streams of Random Numbers
    4. 5.4. Default Methods in Map
    5. 5.5. Default Method Conflict
    6. 5.6. Iterating Over Collections and Maps
    7. 5.7. Logging with a Supplier
    8. 5.8. Closure Composition
    9. 5.9. Using an Extracted Method for Exception Handling
    10. 5.10. Checked Exceptions and Lambdas
    11. 5.11. Using a Generic Exception Wrapper
  8. The Optional Type
    1. 6.1. Creating an Optional
    2. 6.2. Retrieving Values from an Optional
    3. 6.3. Optional in Getters and Setters
    4. 6.4. Optional flatMap Versus map
    5. 6.5. Mapping Optionals
  9. File I/O
    1. 7.1. Process Files
    2. 7.2. Retrieving Files as a Stream
    3. 7.3. Walking the Filesystem
    4. 7.4. Searching the Filesystem
  10. The java.time Package
    1. 8.1. Using the Basic Date-Time Classes
    2. 8.2. Creating Dates and Times from Existing Instances
    3. 8.3. Adjusters and Queries
    4. 8.4. Convert from java.util.Date to java.time.LocalDate
    5. 8.5. Parsing and Formatting
    6. 8.6. Finding Time Zones with Unusual Offsets
    7. 8.7. Finding Region Names from Offsets
    8. 8.8. Time Between Events
  11. Parallelism and Concurrency
    1. 9.1. Converting from Sequential to Parallel Streams
    2. 9.2. When Parallel Helps
    3. 9.3. Changing the Pool Size
    4. 9.4. The Future Interface
    5. 9.5. Completing a CompletableFuture
    6. 9.6. Coordinating CompletableFutures, Part 1
    7. 9.7. Coordinating CompletableFutures, Part 2
  12. Java 9 Additions
    1. 10.1. Modules in Jigsaw
    2. 10.2. Private Methods in Interfaces
    3. 10.3. Creating Immutable Collections
    4. 10.4. Stream: ofNullable, iterate, takeWhile, and dropWhile
    5. 10.5. Downstream Collectors: filtering and flatMapping
    6. 10.6. Optional: stream, or, ifPresentOrElse
    7. 10.7. Date Ranges
  13. Generics and Java 8
    1. Background
    2. What Everybody Knows
    3. What Some Developers Don’t Realize
    4. Wildcards and PECS
    5. Examples from the Java 8 API
    6. Summary
  14. Index
Back to top