Submit Search
SpringCamp 2013 : About Jdk8
6 likes
1,839 views
Sangmin Lee
1 of 46
Download now
Downloaded 32 times
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
More Related Content
PDF
μλ°8 λλ€ λλ¨Έμ§ κ³΅κ°
Sungchul Park
Β
PPTX
Just java
Jong Wook Kim
Β
PPTX
μλ° 8 νμ΅
HeeChang Lee
Β
PDF
αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ αα ©αα ’
beom kyun choi
Β
PDF
java 8 λλ€μ μκ°μ μλ―Έ κ³ μ°°
Sungchul Park
Β
PDF
JDK λ³μ²μ¬
SeungHyun Eom
Β
PDF
Java8 & Lambda
κΈ°ν ν©
Β
PPTX
λμ νλΌλ―Έν°μ λλ€ In java 8
μ§μ° μ΄
Β
μλ°8 λλ€ λλ¨Έμ§ κ³΅κ°
Sungchul Park
Β
Just java
Jong Wook Kim
Β
μλ° 8 νμ΅
HeeChang Lee
Β
αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ αα ©αα ’
beom kyun choi
Β
java 8 λλ€μ μκ°μ μλ―Έ κ³ μ°°
Sungchul Park
Β
JDK λ³μ²μ¬
SeungHyun Eom
Β
Java8 & Lambda
κΈ°ν ν©
Β
λμ νλΌλ―Έν°μ λλ€ In java 8
μ§μ° μ΄
Β
What's hot
(18)
PDF
μλ°8 μ€νΈλ¦Ό API μκ°
beom kyun choi
Β
PDF
Ji κ°λ° 리뷰 (μ λ¦Όνλ‘κ·Έλλ¨Έ)
beom kyun choi
Β
PDF
αα ‘αα ¦ αα ₯αΊαα ₯α«αα ’ αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ αα ΅αα ’α«αα ₯α«
daewon jeong
Β
PDF
JVM λ©λͺ¨λ¦¬ ν΄λΆν
Greg Lee
Β
PDF
μΉκ³ λ―κ³ λ§λ³΄κ³ μ¦κΈ°λ μ€νΈλ¦Ό API
Arawn Park
Β
PDF
Java stream v0.1
Hyosang Hong
Β
PPTX
Java mentoring of samsung scsc 2
λν κΉ
Β
PDF
Java lambda
Hyosang Hong
Β
PDF
Java advancd ed10
hungrok
Β
PDF
αα ©αα ¦α―α α ΅αΌ αα §α«αα ³αΈ λ¦¬λ·°
beom kyun choi
Β
PDF
Collection framework
ssuser34b989
Β
PPTX
Linq to object using c#
λ³κ±Έ μ€
Β
PDF
Java λ³μμλ£ν
Hyosang Hong
Β
PPTX
Jquery javascript_ed10
hungrok
Β
PDF
μλ°8κ°μ 0αα ‘αΌ. java8 overview
Sejong Park
Β
PDF
μΌλ¨ μμνλ μ½νλ¦°
Park JoongSoo
Β
PDF
μλ°8κ°μ 2κ°. Stream API
Sejong Park
Β
PPT
κ°μμλ£4
Young Wook Kim
Β
μλ°8 μ€νΈλ¦Ό API μκ°
beom kyun choi
Β
Ji κ°λ° 리뷰 (μ λ¦Όνλ‘κ·Έλλ¨Έ)
beom kyun choi
Β
αα ‘αα ¦ αα ₯αΊαα ₯α«αα ’ αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ αα ΅αα ’α«αα ₯α«
daewon jeong
Β
JVM λ©λͺ¨λ¦¬ ν΄λΆν
Greg Lee
Β
μΉκ³ λ―κ³ λ§λ³΄κ³ μ¦κΈ°λ μ€νΈλ¦Ό API
Arawn Park
Β
Java stream v0.1
Hyosang Hong
Β
Java mentoring of samsung scsc 2
λν κΉ
Β
Java lambda
Hyosang Hong
Β
Java advancd ed10
hungrok
Β
αα ©αα ¦α―α α ΅αΌ αα §α«αα ³αΈ λ¦¬λ·°
beom kyun choi
Β
Collection framework
ssuser34b989
Β
Linq to object using c#
λ³κ±Έ μ€
Β
Java λ³μμλ£ν
Hyosang Hong
Β
Jquery javascript_ed10
hungrok
Β
μλ°8κ°μ 0αα ‘αΌ. java8 overview
Sejong Park
Β
μΌλ¨ μμνλ μ½νλ¦°
Park JoongSoo
Β
μλ°8κ°μ 2κ°. Stream API
Sejong Park
Β
κ°μμλ£4
Young Wook Kim
Β
Ad
Viewers also liked
(6)
PDF
μ’μΆ©μ°λ ORM κ°λ°κΈ° | Devon 2012
Daum DNA
Β
PPT
Spring Batch 2.0
Guido Schmutz
Β
PDF
Ksug2015 jpa5 αα ³αα ³α α ΅αΌαα ͺjpa
Younghan Kim
Β
PPTX
μννΈμ¨μ΄ νμ΅ λ° αα ‘αα ‘ αα °αΈ αα ’αα ‘α―αα ‘ αα ‘α¨αα ³αΈ α α ©αα ³αα ’αΈ
Javajigi Jaesung
Β
PDF
SpringDataJPA - μ€νλ§ μΊ ν
Younghan Kim
Β
PDF
λ λμ κ°λ°μ λκΈ°
JeongHun Byeon
Β
μ’μΆ©μ°λ ORM κ°λ°κΈ° | Devon 2012
Daum DNA
Β
Spring Batch 2.0
Guido Schmutz
Β
Ksug2015 jpa5 αα ³αα ³α α ΅αΌαα ͺjpa
Younghan Kim
Β
μννΈμ¨μ΄ νμ΅ λ° αα ‘αα ‘ αα °αΈ αα ’αα ‘α―αα ‘ αα ‘α¨αα ³αΈ α α ©αα ³αα ’αΈ
Javajigi Jaesung
Β
SpringDataJPA - μ€νλ§ μΊ ν
Younghan Kim
Β
λ λμ κ°λ°μ λκΈ°
JeongHun Byeon
Β
Ad
Similar to SpringCamp 2013 : About Jdk8
(20)
PDF
Java stream v0.1
Hyosang Hong
Β
PDF
Java_10 λλ€
Hong Hyo Sang
Β
PDF
Java jungsuk3 ch14_lambda_stream
μ± λ¨κΆ
Β
PDF
ν¨μμ μ¬κ³ 2μ₯
HyeonSeok Choi
Β
PPTX
ECMAScript 6μ μλ‘μ΄ κ²λ€!
WooYoung Cho
Β
PPTX
Java Virtual Machine, Call stack, Java Byte Code
Javajigi Jaesung
Β
PDF
2014.07.26 KSUGμ μ§μ€μ μ΄ ν¨κ»νλ ν ν¬λ컬 μΈλ―Έλ - αα ‘μ αα ₯αΊαα ₯α«αα ’ αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ (μ λμ)
JiandSon
Β
PPT
Ai C#μΈλ―Έλ
Astin Choi
Β
PPTX
Java8 λλ€
Jong Woo Rhee
Β
PDF
Java κ°μμλ£ ed11
hungrok
Β
PDF
Swift3 subscript inheritance initialization
Eunjoo Im
Β
PDF
PySpark λ°°μ°κΈ° Ch 06. ML ν¨ν€μ§ μκ°νκΈ°
μ°¬ν¬ μ΄
Β
PPTX
κ°μμλ£ 2
Young Wook Kim
Β
PPTX
About Visual C++ 10
ν₯λ°° μ΅
Β
PDF
[1A5]αα αα ²α―αα ₯α¨αα ΅α«αα ‘α«αα ³α α ©αα ΅αα ³αα ’αΈαα ’αα ‘α―
NAVER D2
Β
PPTX
ν¨μν νλ‘κ·Έλλ°
Min-su Kim
Β
PDF
2014.07.26 KSUGμ μ§μ€μ μ΄ ν¨κ»νλ ν ν¬λ컬 μΈλ―Έλ - μλ°8 λλ€ λλ¨Έμ§ μ΄μΌκΈ° (λ°μ±μ² )
JiandSon
Β
PDF
νμ΄μ¬ λ°μ΄ν°λ² μ΄μ€ μ°κ²° 2ν
SeongHyun Ahn
Β
PDF
12μ₯ μμ (κ³ κΈ)
μ μ λ¨
Β
PPTX
Java Annotationκ³Ό MyBatisλ‘ λλ§μ ORM Frameworkμ λ§λ€μ΄λ³΄μ
Donghyeok Kang
Β
Java stream v0.1
Hyosang Hong
Β
Java_10 λλ€
Hong Hyo Sang
Β
Java jungsuk3 ch14_lambda_stream
μ± λ¨κΆ
Β
ν¨μμ μ¬κ³ 2μ₯
HyeonSeok Choi
Β
ECMAScript 6μ μλ‘μ΄ κ²λ€!
WooYoung Cho
Β
Java Virtual Machine, Call stack, Java Byte Code
Javajigi Jaesung
Β
2014.07.26 KSUGμ μ§μ€μ μ΄ ν¨κ»νλ ν ν¬λ컬 μΈλ―Έλ - αα ‘μ αα ₯αΊαα ₯α«αα ’ αα ‘αα ‘8 α α ‘α·αα ‘αα ΅α¨ (μ λμ)
JiandSon
Β
Ai C#μΈλ―Έλ
Astin Choi
Β
Java8 λλ€
Jong Woo Rhee
Β
Java κ°μμλ£ ed11
hungrok
Β
Swift3 subscript inheritance initialization
Eunjoo Im
Β
PySpark λ°°μ°κΈ° Ch 06. ML ν¨ν€μ§ μκ°νκΈ°
μ°¬ν¬ μ΄
Β
κ°μμλ£ 2
Young Wook Kim
Β
About Visual C++ 10
ν₯λ°° μ΅
Β
[1A5]αα αα ²α―αα ₯α¨αα ΅α«αα ‘α«αα ³α α ©αα ΅αα ³αα ’αΈαα ’αα ‘α―
NAVER D2
Β
ν¨μν νλ‘κ·Έλλ°
Min-su Kim
Β
2014.07.26 KSUGμ μ§μ€μ μ΄ ν¨κ»νλ ν ν¬λ컬 μΈλ―Έλ - μλ°8 λλ€ λλ¨Έμ§ μ΄μΌκΈ° (λ°μ±μ² )
JiandSon
Β
νμ΄μ¬ λ°μ΄ν°λ² μ΄μ€ μ°κ²° 2ν
SeongHyun Ahn
Β
12μ₯ μμ (κ³ κΈ)
μ μ λ¨
Β
Java Annotationκ³Ό MyBatisλ‘ λλ§μ ORM Frameworkμ λ§λ€μ΄λ³΄μ
Donghyeok Kang
Β
SpringCamp 2013 : About Jdk8
1.
μΆJ κ°D λK κ²8 λ€μ μ ? Home : GodOfJava.com Blog
: tuning-java.com μ΄μλ―Ό μ΄ λ¬Έμλ λλκΈκΌ΄λ‘ μμ±λμμ΅λλ€. μ€μΉνκΈ°
2.
λͺ© μ°¨ 1. Introduction 2. JDK
7 Summary 3. JDK 8 Summary 4. java.time 5. Lambda Expression 6. Bulk Data Operation 7. Conclusion
3.
JDK 7 Summary
4.
1. JDK 7
μμ λ³κ²½λ κ²λ€ - μΆκ° μ¬ν μ«μ νμ λ°©λ² λ³΄μ switch λ¬Έμμ String μ¬μ© μ λ€λ¦μ μ½κ² μ¬μ©ν μ μλ Diamond μμΈμ²λ¦¬μ λ€μ€μ²λ¦¬ κ°λ₯ 6
5.
2. JDK 7
μμ μΆκ°λ κ²λ€ - μΆκ° μ¬ν Fork Join NIO2 JDBC 4.1 TransferQueue μΆκ° Objects ν΄λμ€ μΆκ° 7
6.
JDK 8 Summary
7.
1. JDK 8
Download JDK 8 μ 2013λ 10μ νμ¬ EA (Early Access) - μ μ λ²μ μ μμ§ λμ€μ§ μμμΌλ©° 2014λ μ€μλ λμ¬ λ― λ€μ΄λ‘λλ μλ λ§ν¬μμ - https://jdk8.java.net/download.html - μ μλ°μμ§. ο κ³μ λκΉ !!! (Safariμμ κ³μ λ€μ λ€μ΄λ‘λλ₯Ό λλ₯΄λ©΄μ λ°κ±°λ λ€μ΄λ‘λ ν΄ κΆμ₯) 9
8.
2. Full added
features μΆκ°λ κΈ°λ₯λ€ λͺ©λ‘ (http://openjdk.java.net/projects/jdk8/features) 10
9.
3. Today β¦ μ€λ
λ€λ£° λ΄μ©μ - java.time package - Lambda Expression - Bulk Data Operation μ°Έκ³ - λͺ¨λν λΆλΆμ λ΄λΉνλ jigsaw λ JDK 8μμ μ μΈ λμμ 11
10.
java.time Date-Time API
11.
1. About Date-Time
API Data-Time API - JDK 8 λΆν° μ 곡λλ©°, ISO-8601 νμ€μ λ°λ¦ (http://www.iso.org/iso/home/standards/iso8601.htm) - λͺ¨λ ν΄λμ€λ immutable νκ³ , thread safe - Hijrah(Islamic), Japanese, Minguo(Taiwan), ThaiBuddhist λ¬λ ₯μ μ 곡 ο¨ μνκΉκ²λ μ°λ¦¬λλΌμ μλ ₯μ μ‘΄μ¬νμ§ μμ 13
12.
2. Date-Time Design
Principles Clear Fluent Immutable Extensible 14
13.
2. Date-Time Design
Principles Clear - APIλ₯Ό λͺ λ°±νκ² λ§λ€μμ - μλ₯Ό λ€μ΄ λ§€κ°λ³μλ‘ nullμ΄ λ€μ΄μ€λ©΄ NullPointerException λ°μ Fluent - μ½λλ₯Ό μ½κΈ° μ½κ² LocalDate today = LocalDate.now(); LocalDate payday = today.with(TemporalAdjuster.lastDayOfMonth()).minusDays(2); Immutable - λΆλ³μ κ°μ²΄ LocalDate dateOfBirth = LocalDate.of(2012, Month.MAY, 14); LocalDate firstBirthday = dateOfBirth.plusYears(1); Extensible - μμμ λ¬λ ₯μ μ½κ² μΆκ° ν μ μμ 15
14.
3. Date-Time packages java.time java.time.chrono java.time.format java.time.temporal java.time.zone 16
15.
3. Date-Time packages java.time -
λ μ§μ μκ°μ λνλ΄λ μ½μ΄(core) API java.time.chrono - μ£Όμ λ¬λ ₯ μ 곡 java.time.format - λ μ§λ₯Ό formatνκ³ parseνλ ν΄λμ€ μ 곡 java.time.temporal - λ μ§ λ° μκ° ν΄λμ€λ€μ μ²λ¦¬νκΈ° μν νμ₯ API java.time.zone - νμμ‘΄(time zone) μ§μ ν΄λμ€λ€ 17
16.
4. Naming Convention μ£Όμ
λ©μλμ΄λ¦ prefix Prefix Method type Description of static fact ory μ λ ₯ λ§€κ°λ³μμ λ°λΌ μΈμ€ν΄μ€ μμ± from static fact ory μ λ ₯ λ§€κ°λ³μλ₯Ό λμ ν΄λμ€λ‘ λ³ν parse static fact ory μ λ ₯ λ¬Έμμ΄μ νμ±νμ¬ λμ ν΄λμ€μ μΈμ€ν΄μ€ μμ± format instance μ§μ λ formatterλ₯Ό μ¬μ©νμ¬ κ°μ format get instance λμ κ°μ²΄μ μΌλΆ μν κ°μ λ¦¬ν΄ is instance λμ κ°μ²΄μ μν νμΈ with instance νλμ μμκ° λ³κ²½λ 볡μ κ°μ²΄ λ¦¬ν΄ plus instance νλμ μμλ₯Ό λν 볡μ κ°μ²΄ λ¦¬ν΄ minus instance νλμ μμμ κ°μ λΊ λ³΅μ κ°μ²΄ λ¦¬ν΄ to instance νμ¬ κ°μ²΄λ₯Ό λ€λ₯Έ νμ μΌλ‘ λ³ν 18 at instance νμ¬ κ°μ²΄λ₯Ό λ€λ₯Έ κ°μ²΄μ κ²°ν©
17.
Lambda Expression
18.
1. About Lambda Lambda
Expression - βλλ€ μ΅μ€νλ μ βμ΄λΌκ³ λ°μ. (무μνκ² βλλΈλ€βλΌκ³ μ½μ§ λ§ κ² !) - μ΄κ±΄ λ κ·Έλ₯ κ°λ¨ν ννμμ λ°°μ°λ κ²μ΄λΌκΈ° 보λ€λ μλ‘μ΄ μΈμ΄λ₯Ό λ°°μ°λ λλ ? - .stream().filter(β¦).map() κ³Ό κ°μ΄ .μ κ³μ μ°μ΄μ£Όλ λ¬Έλ²μ μ΅μν΄λ 30%λ λ¨Ήκ³ λ€μ΄κ°λ κ² - μ΅λͺ (Anonymous) ν΄λμ€λ§ μ΄ν΄ν΄λ 20%λ λ¨Ήκ³ λ€μ΄κ°λ κ² - νμ΄ν(->)μ λ‘λ‘(::)λ§ μ μ΄ν΄ν΄λ 40%μ λ¨Ήκ³ λ€μ΄κ°λ κ² - λλ¨Έμ§ 10%λ API λ₯Ό μ΄ν΄νλ κ² - μ€λ μ΄ μκ°μ λͺ¨λ μ΄ν΄νκΈ° μ½μ§ μμ κ² 20
19.
1. About Lambda Lambda
Expression μ Stream.of(idArray) .map(EmployeeUtils::findById) .filter(e -> e !=null) .filter(e -> e.getSalary() > 50000) .findFirst() .orElse(null); 21
20.
2. Basic Knowledge Lambda
Expression μ μμ보기 μ μ μνμ μ΄ν΄νκΈ° μν API μ΄ν΄ java.util.Comparator interfaceμ compare() λ©μλ java.util.Arrays classμ sort() λ©μλ 22
21.
3. Understand Lambda-1 λ€μμ
Integer λ₯Ό μ λ ¬ν΄ λ³΄μ. Integer[] data={3,2,1,4,6,5,9,8,7,10}; Arrays.sort(T[] t) λ©μλλ₯Ό μ¬μ©ν μλ μμ§λ§, Comparatorλ₯Ό μ¬μ©ν΄μΌ νλ μν©μΌ κ²½μ° Comparator μΈν°νμ΄μ€λ₯Ό ꡬνν΄μΌ ~~~ 23
22.
3. Understand Lambda-1 λ°©λ²
1 Comparator μΈν°νμ΄μ€λ₯Ό ꡬνν Integer λΉκ΅ ν΄λμ€ class IntegerComparator<T> implements Comparator<T> { @Override public int compare(T x,T y) { if(x instanceof Integer) { return compareInt((Integer)x,(Integer)y); } else return 0; } public int compareInt(Integer x,Integer y) { return (x < y) ? -1 : ((x == y) ? 0 : 1); } } 24
23.
3. Understand Lambda-1 λ°©λ²
1 IntegerComparator ν΄λμ€ μ¬μ© μ public void useClass(Integer[] data) { IntegerComparator<Integer> compare=new IntegerComparator<Integer>(); Arrays.sort(data,compare); for(Integer temp:data) { System.out.println(temp); } } 25
24.
3. Understand Lambda-1 λ°©λ²
2 λΆν°λ compareInt() λ©μλκ° ν΄λΉ ν΄λμ€μ μ μΈ λμ΄ μμ κ²½μ° public int compareInt(Integer x,Integer y) { return (x < y) ? -1 : ((x == y) ? 0 : 1); } 26
25.
3. Understand Lambda-1 λ°©λ²
2 Anonymous ν΄λμ€ μ¬μ© μ public void anonymous(Integer[] data) { Comparator<Integer> compare=new Comparator<Integer>() { @Override public int compare(Integer x,Integer y) { return compareInt(x,y); } }; Arrays.sort(data,compare); for(Integer temp:data) { System.out.println(temp); } } 27
26.
3. Understand Lambda-1 λ°©λ²
3 Lambda μ¬μ© μ 1 public void lambda1(Integer[] data) { Arrays.sort(data, (Integer x,Integer y) -> compareInt(x,y) ); for(Integer temp:data) { System.out.println(temp); } } 28
27.
3. Understand Lambda-1 λ°©λ²
4 Lambda μ¬μ© μ 2 public void lambda2(Integer[] data) { Arrays.sort(data, (x,y) -> compareInt(x,y) ); for(Integer temp:data) { System.out.println(temp); } } 29
28.
3. Understand Lambda-1 λ°©λ²
5 Lambda μ¬μ© μ 3 public void lambda3(Integer[] data) { List<Integer> list=Arrays.asList(data); list.sort( (x,y) -> compareInt(x,y) ); list.forEach(System.out::println); } 30
29.
4. Understand Lambda-2 Lambda
μ¬μ© μ public class Calculator { interface IntegerMath { int operation(int a, int b); } public int operateBinary(int a, int b, IntegerMath op) { return op.operation(a, b); } public static void main(String... args) { Calculator myApp = new Calculator(); IntegerMath addition = (a, b) -> a + b; IntegerMath subtraction = (a, b) -> a - b; System.out.println("40 + 2 = " + myApp.operateBinary(40, 2, addition)); System.out.println("20 - 10 = " + myApp.operateBinary(20, 10, subtraction)); } } 31
30.
4. Understand Lambda-2 Lambda
μ¬μ© μ public class Calculator { interface IntegerMath { int operation(int a, int b); } public int operateBinary(int a, int b, IntegerMath op) { return op.operation(a, b); } public static void main(String... args) { Calculator myApp = new Calculator(); IntegerMath addition = (a, b) -> a + b; IntegerMath subtraction = (a, b) -> a - b; System.out.println("40 + 2 = " + myApp.operateBinary(40, 2, addition)); System.out.println("20 - 10 = " + myApp.operateBinary(20, 10, subtraction)); } } 32
31.
4. Understand Lambda-2 Lambda
μ¬μ© μ public class Calculator { interface IntegerMath { int operation(int a, int b); } public int operateBinary(int a, int b, IntegerMath op) { return op.operation(a, b); } public static void main(String... args) { Calculator myApp = new Calculator(); IntegerMath addition = (a, b) -> a + b; IntegerMath subtraction = (a, b) -> a - b; System.out.println("40 + 2 = " + myApp.operateBinary(40, 2, addition)); System.out.println("20 - 10 = " + myApp.operateBinary(20, 10, subtraction)); } } 33
32.
4. Understand Lambda-2 Lambda
μ¬μ© μ public class Calculator { interface IntegerMath { int operation(int a, int b); } public int operateBinary(int a, int b, IntegerMath op) { return op.operation(a, b); } public static void main(String... args) { Calculator myApp = new Calculator(); IntegerMath addition = (a, b) -> a + b; IntegerMath subtraction = (a, b) -> a - b; System.out.println("40 + 2 = " + myApp.operateBinary(40, 2, addition)); System.out.println("20 - 10 = " + myApp.operateBinary(20, 10, subtraction)); } } 34
33.
5. Expression -> (arrow
token) IntegerMath addition = (a, b) -> a + b; - λ§€κ°λ³μλ‘ aμ b λ₯Ό λ°λ μμ μ addition κ°μ²΄μ ν λΉνλ€. - (a,b)μμ λ§€κ°λ³μ νμ μ λͺ μν΄λ λκ³ , λͺ μνμ§ μμλ λλ€. IntegerMath addition = (int a, int b) -> a + b; 35
34.
5. Expression :: (method
reference) System.out::println - λλ€ λ¬Έμ₯μ΄ λ€μ΄κ°λ λΆλΆμ :: μ μ¬μ©νμ¬ λ©μλ μ°Έμ‘° κ°λ₯ - λ©μλ μ°Έμ‘° λ¬Έλ²μ μλμ κ°μ Kind Example static λ©μλ μ°Έμ‘° ν΄λμ€λͺ ::staticλ©μλλͺ μΈμ€ν΄μ€ λ©μλ μ°Έμ‘° μΈμ€ν΄μ€λͺ ::λ©μλλͺ νΉμ νμ μ μΈμ€ν΄μ€ λ©μλ μ°Έμ‘° νμ ::λ©μλλͺ μμ±μ μ°Έμ‘° ν΄λμ€λͺ ::new 36
35.
Bulk Data Operation java.util.stream.Stream
36.
1. Stream interface java.util.stream.Stream
interface - Collection APIλ₯Ό ꡬν / νμ₯ν ν΄λμ€μ κ°μ²΄λ₯Ό μ½κ² μ²λ¦¬ν μ μλλ‘ ν μΈ ν°νμ΄μ€ - http://download.java.net/jdk8/docs/api/ - Collection ν΄λμ€μ stream() λ©μλλ₯Ό νΈμΆνλ©΄ Stream κ°μ²΄ μμ± - Steam == sequence of elements 38
37.
1. Stream interface λ³ν
λμ κ°μ²΄ List<Integer> numbers=Arrays.asList(1,2,3,4,5,6,7,8,9,10); Stream interface μ public void map(List<Integer> numbers) { System.out.println("map()"); numbers.stream() .map(value -> value *2) .forEach(System.out::println); } 39
38.
2. Stream methods μ£Όμ
λ©μλ Method Description filter(Predicate<T> predicate) μ£Όμ΄μ§ 쑰건(predicate)μ λ§λ μμ λ¦¬ν΄ forEach(Consumer<T> action) μ£Όμ΄μ§ μμ (action) μ€ν map(Function<T,R> mapper) μνλ μμ (mapper)μ κ²°κ³Όλ₯Ό λ¦¬ν΄ reduce(BinaryOperator<T> accumulato reduce μμ μν (νμ μλ‘μ΄ κ°μ²΄ λ° κ° r) μ 리ν΄) collect(Collector<? super T,A,R> co mutable reduction μμ μν(μμ λ κ°μ²΄ llector) λ° κ°μ 리ν΄) 40
39.
3. Stream μ filter
& forEach numbers.stream() .filter(value -> value %3 == 0) .forEach(System.out::println); 41
40.
3. Stream μ map
& forEach numbers.stream() .map(value -> value *2) .forEach(System.out::println); 42
41.
3. Stream μ reduce List<String>
names= Arrays.asList("God","Of","Java","You","Min","Yeon","Sook"); Optional<String> shortestName = names.stream() .reduce((name1,name2) -> name1.length()<=name2.length() ? name1 : name2 ); Optional<String> longestName = names.stream() .reduce((name1,name2) -> name1.length()>=name2.length() ? name1 : name2 ); System.out.println(shortestName.get()); System.out.println(longestName.get()); 43
42.
Conclusion
43.
Conclusion μ€λͺ ν λ΄μ©μ΄ μ΄ν΄
μλλ€κ³ μ’μ νμ§ λ§μ ! - μ΄μ°¨νΌ JDK 8 Releaseλ λ΄λ ο¨ μ΄ν΄ν μκ°μ μΆ©λΆνλ€. - μ΄μ°¨νΌ Release λ μ΄νμ μ¬λ¬λΆλ€μ μμ€ν μμ JDK 8μ μ¬μ©νλ €λ©΄ λ©μλ€. ο¨ μ΄ν΄ν μκ°μ λ μΆ©λΆνλ€. κ·Έλ λ€κ³ Lambda Expression 무μνλ©΄ ? - 3λ λ€μ λνλλ€. ο¨ μ½λλ₯Ό μ΄ν΄ λͺ»νκ² μ£ ? 45
44.
Conclusion μ€λ μ€λͺ ν λ΄μ©μ
λΉμ°μ μΌκ°μΌ λΏ - Lambda λ° Bulk Data Operation μ λν΄μ μμΈν μ΄ν΄λ³΄λ €λ©΄ API/Java Tutorial μ°Έκ³ http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html http://docs.oracle.com/javase/tutorial/collections/streams/index.html 46
45.
* Lambda reference State
of the Lambda - http://cr.openjdk.java.net/~briangoetz/lambda/lambda-libraries-final.html Java Tutorial - http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html Slideshare - http://www.slideshare.net/scottleber/java8-8-lambda-expressions - Marty Hall (slideshare) http://www.slideshare.net/martyhall/java-8-tutorial-streams-part-1 http://www.slideshare.net/martyhall/java-8-tutorial-streams-part-2-mapreduce-parallel-streams-and-infinite-streams http://www.slideshare.net/martyhall/java-8-tutorial-lambda-expressionspart-1 http://www.slideshare.net/martyhall/java-8-tutorial-lambda-expressionspart-2 http://www.slideshare.net/martyhall/java-8-tutorial-lambda-expressions- 47
46.
κ°μ¬ν©λλ€. μ΄ λ¬Έμλ λλκΈκΌ΄λ‘
μμ±λμμ΅λλ€. μ€μΉνκΈ°
Download