Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Functional Programming in Java
For the Best Reading Experience...
Table of Contents
Foreword
Praise for Functional Programming in Java
Acknowledgments
Preface
Who’s This Book For
What’s in This Book
Java Version Used in This Book
How to Read the Code Examples
Online Resources
Chapter 1: Hello, Lambda Expressions!
Change the Way You Think
The Big Gains of Functional-Style Code
Why Code in the Functional Style?
Evolution, Not Revolution
A Little Sugar to Sweeten
Recap
Chapter 2: Using Collections
Iterating through a List
Transforming a List
Finding Elements
Reusing Lambda Expressions
Using Lexical Scoping and Closures
Picking an Element
Reducing a Collection to a Single Value
Joining Elements
Recap
Chapter 3: Strings, Comparators, and Filters
Iterating a String
Implementing the Comparator Interface
Multiple and Fluent Comparisons
Using the collect Method and the Collectors Class
Listing All Files in a Directory
Listing Select Files in a Directory
Listing Immediate Subdirectories Using flatMap
Watching a File Change
Recap
Chapter 4: Designing with Lambda Expressions
Separating Concerns Using Lambda Expressions
Delegating Using Lambda Expressions
Decorating Using Lambda Expressions
A Peek into the default Methods
Creating Fluent Interfaces Using Lambda Expressions
Dealing with Exceptions
Recap
Chapter 5: Working with Resources
Cleaning Up Resources
Using Lambda Expressions to Clean Up Resources
Managing Locks
Creating Concise Exception Tests
Recap
Chapter 6: Being Lazy
Delayed Initialization
Lazy Evaluations
Leveraging the Laziness of Streams
Creating Infinite, Lazy Collections
Recap
Chapter 7: Optimizing Recursions
Using Tail-Call Optimization
Speeding Up with Memoization
Recap
Chapter 8: Composing with Lambda Expressions
Using Function Composition
Using MapReduce
Taking a Leap to Parallelize
Recap
Chapter 9: Bringing It All Together
Essential Practices to Succeed with the Functional Style
Performance Concerns
Adopting the Functional Style
Appendix 1: Starter Set of Functional Interfaces
Consumer < T >
Supplier < T >
Predicate < T >
Function < T, R >
Appendix 2: Syntax Overview
Defining a Functional Interface
Creating No-Parameter Lambda Expressions
Creating a Single-Parameter Lambda Expression
Inferring a Lambda Expression’s Parameter Type
Dropping Parentheses for a Single-Parameter Inferred Type
Creating a Multi-Parameter Lambda Expression
Calling a Method with Mixed Parameters
Storing a Lambda Expression
Creating a Multiline Lambda Expression
Returning a Lambda Expression
Returning a Lambda Expression from a Lambda Expression
Lexical Scoping in Closures
Passing a Method Reference of an Instance Method
Passing a Method Reference to a static Method
Passing a Method Reference to a Method on Another Instance
Passing a Reference of a Method That Takes Parameters
Using a Constructor Reference
Function Composition
Appendix 3: Web Resources
Bibliography
You May Be Interested In…
← Prev
Back
Next →
← Prev
Back
Next →