Submit Search
Upload
Java functional api
•
0 likes
•
291 views
javakidxxx
Follow
A brief introduction for Java function API
Read less
Read more
Technology
Report
Share
Report
Share
1 of 20
Download now
Download to read offline
Recommended
2014 Java Developer Day會後分享 Java Functional API
2014 Java Developer Day會後分享 Java Functional API
Anke Yang
函数式编程
函数式编程
wang zaixiang
Lambda
Lambda
Justin Lin
CH12:Lambda
CH12:Lambda
Justin Lin
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
Kaunas Java User Group
第1章 入门
第1章 入门
Runa Jiang
ELK 交流学习
ELK 交流学习
杨文 陈
Java SE 8 技術手冊第 12 章 - Lambda
Java SE 8 技術手冊第 12 章 - Lambda
Justin Lin
Recommended
2014 Java Developer Day會後分享 Java Functional API
2014 Java Developer Day會後分享 Java Functional API
Anke Yang
函数式编程
函数式编程
wang zaixiang
Lambda
Lambda
Justin Lin
CH12:Lambda
CH12:Lambda
Justin Lin
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
Kaunas Java User Group
第1章 入门
第1章 入门
Runa Jiang
ELK 交流学习
ELK 交流学习
杨文 陈
Java SE 8 技術手冊第 12 章 - Lambda
Java SE 8 技術手冊第 12 章 - Lambda
Justin Lin
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Java functional api
1.
Java Functional API
2.
認識Lambda 在諸如Lisp、Python的語言中,Lambda是代表 ● 匿名函數(Anonymous) ● 閉包(Closure) ●
在許多程式語言之中早就有它的身影存在 在實用上 ● is a way to refactor refactored codes
3.
從JavaScript看起 當函式是物件時,我們可以: ● 根據需要將之傳遞給另一個變數參考 ● 可以傳遞給別的函式進行動作 ●
流桯中不同的演算需求,可以設計回呼函式來 抽換
4.
從JavaScript看起 這樣做可以 ● 簡化語法 ● 開放了更多不同設計方式的可能性
5.
看看Java 匿名類別 ● 程式碼太冗長,可讀性降低 ● sort在做什麼?
6.
看看Java 宣告實作介面變數 ● 原來是在做升冪排序 ● 但...
7.
Java Lambda 等號左邊在宣告變數時已指定型別,所以
8.
Java Lambda Interface Comparator<T> →int
compare(T o1, T o2) 編譯器可以從Comparator<Integer>中推斷 出n1與n2的型態,所以
9.
Java Lambda Lambda表式示 ● 等號右邊是Lambda表示式 ○
本身是中性的,不代表任何型態的實例 ○ 只關心方法簽署上的參數與回傳值,忽略方法名稱 ● 等號左邊為Lambda表示式的目標型態 ● 目標型態存在時,編譯器就可以據此推斷出型 態
10.
Java Lambda 函式介面(Functional Interface) ●
Comparator是一個函式介面 ● JDK8的Lambda並未導入新型態,而是就現有 interface語法來定義,作為目標型態 ● 要求僅具單一抽象方法 ● 其他如Runnable(void run())、Callable(V call() throw Exception)等
11.
Java Lambda 最後我們可寫成 更簡潔明白了
12.
Java Lambda 方法參照 ● 重用現有方法實作,可以避免到處寫下 Lambda運算式 ●
程式碼更加清楚 ● 靜態方法(static method)與物件的實例方法 (instance method)皆可參考
13.
Java Lambda JDK8的Lambda ● 語法上的新增 ●
與既有的API相容,並增加其功能 ● 全新且更有威力的API 從現在的程式進行重構開始著手
14.
Functional API
15.
Functional API ● Predicate<T> ○
T → test(T t) → boolean ● Function<T,R> ○ T → apply(T t) → R ● Consumer<T> ○ T → accept(T t) → void
16.
Functional API
17.
Functional API ● Lazy ○
處理檔案的IO,變得更有效率 ● 使用Optional來代替null ● Supplier<T> ○ none → get() → T
18.
Functional API 平行處理 JDK8引入Lambda目的之一,就是為了讓開發 者在開發平行程式更為簡便
19.
Functional Programming 當你在 ● 重構現有的程式碼 ●
運用filter、map、reduce等 ● 回傳Optional而非null ● 開始使用parallelism以及考慮相關議題 就是在實作Functional Programming
20.
Thanks
Download now