From Collections to Streams in Java 8 Using Lambda Expressions
#777 Год выпуска: 2015 Производитель: Pluralsight Сайт производителя: pluralsight.com Автор: Jose Paumard Продолжительность: 4:01 Тип раздаваемого материала: Видеоклипы Язык: Английский
Описание: Java 8 brought many new patterns to build efficient and clean applications. In this course, we cover one most important new thing: lambda expressions. Lambdas are a nice thing, but would be useless without new patterns to process data. These new patterns have been added to the Collection Framework, and to a the new Stream API. This course quickly explains what the map / filter / reduce pattern is about, and why is has been added to the Stream API. This new API is precisely described: how it can be used to efficiently process data and how it can be used in parallel. Caveats and corner cases are also shown.
Содержание
Lambda Expressions and Functional Interfaces Introduction to the Course What Are You Going to Learn in This Course? Agenda of the Course Who Are You? What Should You Know to Follow This Course? Agenda of This Module Lambda Expression: Introduction, Instances of Anonymous Classes Lambda Expression: Passing Code as a Parameter Let Us Write Our First, Simple Lambda Expressions Lambda Expression: Remarks and Precisions Method References: A First Example with an Instance Method Method References: A Second Example with a Static Method Method References: The System.out.println Pattern How to Create New API: Default and Static Methods in Interfaces Live Coding Introduction: The Comparator Example Implementing a Comparator with Lambda Expressions Comparing by Age, Last Name, and First Name Refactoring the Comparison with a Key Extractor Implementing the Comparator.comparing Static Method Making the Key Extractor Generic, Returning Comparable Objects Chaining Comparators with the thenComparing Default Method Writing the Comparator.thenComparing Implementation Writing the Final Comparator Creation and Chaining Pattern Wrap-up of the Module
Writing Data Processing Functions with Lambdas in Java 8 Introduction to the Module What Is a Functional Interface? The Predicate Example How to Implement a Functional Interface with a Lambda Expression How Does the Compiler Recognize the Type of a Lambda Expression? A Lambda Is Still an Interface with Usable Methods Functional Interface: The Complete and Exact Definition How to Use the @FunctionalInterface Annotation The Four Categories of the java.util.function Package First Category: The Consumers Second Category: The Supplier Third Category: The Functions Fourth Category: The Predicates Functional Interfaces for Java Primitive Types Introduction to the Live Coding Section: The Predicate Example Writing and Using a First, Simple Predicate Lambda Expression Chaining Predicates with the AND Boolean Operation Adding a and() Method on the Predicate Functional Interface Implementing the and() Default method on the Predicate Interface Adding a or() Default Method on the Predicate Interface Creating Predicates with a Static Call on a Functional Interface Making the isEqualsTo() Method Generic of the Predicate Interface Live Coding Wrap-up Module Wrap-up, Presentation of the Next Module
Data Processing Using Lambdas and the Collection Framework Introduction to the Module First Methods on Iterable, Collection and List First Method on Map: forEach() More Methods on Map: getOrDefault() More Methods on Map: putIfAbsent() More Methods on Map: replace() and replaceAll() New Pattern on Map: remove() New Patterns on Map: The compute() method New Patterns on Map: computeIfAbsent(), computeIfPresent() Building Maps of Maps and Maps of Lists with computeIfAbsent() New Pattern on Map: The merge() method Using merge() to Merge Two Maps Together Live Coding Session Introduction, forEach() in Action Methods removeIf(), replaceAll(), sort() in Action Setting Default Value for map.get(): getOrDefault() Adding Default key / value pairs: putIfAbsent, computeIfAbsent Merging Maps with the map.merge() Method Merging Maps: Analysis of the Result Live Coding and Module Wrap-up
Implementing Map Filter Reduce Using Lambdas and Collections Introduction to the Module Computing the Average of People Older than 20, Taken From a List Map / filter / reduce: A Precise Explaination A First Implementation, in the JDK7 Way A Closer Look at the Reduction Step: How Does it Work? Parallel Implementation of the Reduction Step First Caveat: Non-associative Reduction Operations How to Detect Non-associative Reduction Operations Second Caveat: Reduction of a Singleton Second Caveat: Reduction of a Set with Several Elements Second Caveat: Reduction That Do Not Have Identity Element Live Coding: Setting up the Environment Simulating Parallel Computation of a Non-associative Reduction Non-associative Reduction: The Average Reduction Operation Computing a Max: Reduction with No Identity Element Live Coding Wrap-up Using Optionals to Handle Reductions with No Identity Element Wrap-up on the Reduction Step Implementation in the JDK7 Way: a Closer Look CPU Load and Memory Footprint Evaluations Example of an allMatch Reduction Operation: Lost Optimizations Why Is this First, Naive Implementation Should be Avoided A First Glimpse at the Stream API Module Wrap-up
The Stream API, How to Build Streams, First Patterns Introduction to the Module A First Technical Definition of the Stream Interface First Definitions of the Concept of Stream The Notion of Unbounded Stream How to Build Streams: Empty Streams, Singletons, varargs How to Build Streams: The Generator and Iterator Pattern How to Build Streams on Strings, Regular Expressions, and Text Files The Stream.Builder Pattern The map / filter / reduce Pattern Written with a Stream A Second Example of the ap / filter / reduce Pattern on Streams Intermediate and Terminal Calls on Streams: peek() and forEach() How to Tell an Intermediate Call from a Terminal Call Selecting Ranges of Data in Streams: skip() and limit() Simple Reductions: Matchers, Short-circuiting Reductions Finder Reductions, Use of Optionals Example of Finder Reductions: findFirst(), findAny() General Reductions: Use of the reduce() Method Live Coding Session Introduction Example of a First Simple Stream Built on a vararg Building a Stream: The Generate Pattern, Use of Limit() Building a Stream: The Iterate Pattern Bulding Streams of Random Numbers Using Random.ints() Live Coding Session Wrap-up Module and Course Wrap-up
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете добавлять вложения
Ресурс не предоставляет электронные версии произведений, а занимается лишь коллекционированием и каталогизацией ссылок, присылаемых и публикуемых на форуме нашими читателями. Если вы являетесь правообладателем какого-либо представленного материала и не желаете чтобы ссылка на него находилась в нашем каталоге, свяжитесь с нами и мы незамедлительно удалим её. Файлы для обмена на трекере предоставлены пользователями сайта, и администрация не несёт ответственности за их содержание. Просьба не заливать файлы, защищенные авторскими правами, а также файлы нелегального содержания!