Functional Interfaces in Java: Fundamentals and Examples
Book information
Description
Reduce development time by organizing your programs as chains of functional interfaces and see that the advantages of using functional interfaces include the flexibility and power of inlined functional chains and reuse of functional methods utilized throughout the Java API. You’ll see how complex logical expressions can be reduced to chains of predicates and how chains of comparators can be used to sort data by several criteria in order. Other examples include streams that utilize functional interfaces to filter, sort, transform, and perform calculations on data; CompletableFutures that use functional interfaces to create cascading and parallel execution threads; and JavaFX programs that use functional interfaces to monitor the data backed by their graphical components. Each chapter contains a complete programming project: the Discount Dave project shows you how to qualify car customers by organizing questions as a list of predicates; the Real Estate Broker project shows you how to use chains of comparators to filter and sort homes according to customer priorities; the Dave's Part Inventory project shows you how to query and write reports from an inventory database using stream operations; and the Sentence Builder project shows you how to correct a sentence by implementing each grammar rule as a separate link in a future chain. Functional Interfaces in Java will help you quickly develop powerful and reliable programs that utilize functional interfaces to implement logic and calculations. What You Will LearnUse the functional interfaces in the java.util.function package to perform conditional logic, transform and generate data, and perform calculations Filter and sort data by several criteria using comparators Process collections and filter, sort, transform, and reduce stream elements with functional interfaces Write cascading and parallel execution threads Who This Book Is For Computer science student or a professional Java programmer. This work is a rigorous discussion of the application of functional interfaces, so prerequisites for this text include basic Java programming and object-oriented Java programming. Front Matter ....Pages i-xvii Functional Interfaces (Ralph Lecessi)....Pages 1-27 Lambda Expressions (Ralph Lecessi)....Pages 29-43 Predicates (Ralph Lecessi)....Pages 45-68 Functions (Ralph Lecessi)....Pages 69-93 Operators (Ralph Lecessi)....Pages 95-107 Consumers (Ralph Lecessi)....Pages 109-129 Suppliers (Ralph Lecessi)....Pages 131-150 Use in Traversing Objects (Ralph Lecessi)....Pages 151-180 Use in Collections (Ralph Lecessi)....Pages 181-207 Use in Comparing Objects (Ralph Lecessi)....Pages 209-242 Use in Optionals (Ralph Lecessi)....Pages 243-257 Use in Streams (Ralph Lecessi)....Pages 259-291 Use in Multithreaded Programs (Ralph Lecessi)....Pages 293-327 Use in Atomic Calculations (Ralph Lecessi)....Pages 329-346 Use in JavaFX Applications (Ralph Lecessi)....Pages 347-390 Back Matter ....Pages 391-410
Similar books
Functional Interfaces in Java: Fundamentals and Examples
2019 · PDF
JAVA - The Beginnings
2017 · AZW3
JAVA - The Beginnings
2017 · EPUB
JAVA - The Beginnings
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF