File tree Expand file tree Collapse file tree 7 files changed +617
-168
lines changed Expand file tree Collapse file tree 7 files changed +617
-168
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
build.xml.data.CRC32 =53a7d579
2
2
build.xml.script.CRC32 =c6b5575f
3
- build.xml.stylesheet.CRC32 =8064a381 @1.79 .1.48
3
+ build.xml.stylesheet.CRC32 =f85dc8f2 @1.90 .1.48
4
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
6
nbproject/build-impl.xml.data.CRC32 =53a7d579
7
- nbproject/build-impl.xml.script.CRC32 =3066fa53
8
- nbproject/build-impl.xml.stylesheet.CRC32 =05530350 @1.79 .1.48
7
+ nbproject/build-impl.xml.script.CRC32 =f390ffbe
8
+ nbproject/build-impl.xml.stylesheet.CRC32 =3a2fa800 @1.90 .1.48
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ do.depend=false
3
3
do.jar =true
4
4
javac.debug =true
5
5
javadoc.preview =true
6
- user.properties.file =C:\\Users\\manbhakr\\AppData\\Roaming\\NetBeans\\8.1 \\build.properties
6
+ user.properties.file =C:\\Users\\manbhakr\\AppData\\Roaming\\NetBeans\\10.0 \\build.properties
Original file line number Diff line number Diff line change @@ -19,8 +19,12 @@ build.test.results.dir=${build.dir}/test/results
19
19
# debug.transport=dt_socket
20
20
debug.classpath =\
21
21
${run.classpath}
22
+ debug.modulepath =\
23
+ ${run.modulepath}
22
24
debug.test.classpath =\
23
25
${run.test.classpath}
26
+ debug.test.modulepath =\
27
+ ${run.test.modulepath}
24
28
# Files in build.classes.dir which should be excluded from distribution jar
25
29
dist.archive.excludes =
26
30
# This directory is removed when the project is cleaned:
@@ -36,13 +40,17 @@ javac.classpath=
36
40
javac.compilerargs =
37
41
javac.deprecation =false
38
42
javac.external.vm =true
43
+ javac.modulepath =
44
+ javac.processormodulepath =
39
45
javac.processorpath =\
40
46
${javac.classpath}
41
47
javac.source =1.8
42
48
javac.target =1.8
43
49
javac.test.classpath =\
44
50
${javac.classpath} :\
45
51
${build.classes.dir}
52
+ javac.test.modulepath =\
53
+ ${javac.modulepath}
46
54
javac.test.processorpath =\
47
55
${javac.test.classpath}
48
56
javadoc.additionalparam =
@@ -68,9 +76,13 @@ run.classpath=\
68
76
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
69
77
# To set system properties for unit tests define test-sys-prop.name=value:
70
78
run.jvmargs =
79
+ run.modulepath =\
80
+ ${javac.modulepath}
71
81
run.test.classpath =\
72
82
${javac.test.classpath} :\
73
83
${build.test.classes.dir}
84
+ run.test.modulepath =\
85
+ ${javac.test.modulepath}
74
86
source.encoding =UTF-8
75
87
src.dir =src
76
88
test.src.dir =test
Original file line number Diff line number Diff line change
1
+ package com .know .streams ;
2
+
3
+ import com .know .util .DataUtil ;
4
+ import com .know .util .Utility ;
5
+ import java .util .List ;
6
+ import java .util .stream .Collectors ;
7
+
8
+ /**
9
+ * Steam configuration can be done by filter and map operation
10
+ * @author KnowGroup
11
+ */
12
+ public class Lesson_01_Stream_Configuration_filter_map {
13
+
14
+ public static void main (String [] arg ){
15
+ /*
16
+ filter | elements based on a given predicate
17
+ */
18
+ List <Integer > collect =
19
+ DataUtil .fibbinacos ().stream ().filter (n ->n %2 ==0 ).collect (Collectors .toList ());
20
+ collect .stream ().forEach (System .out ::println );
21
+
22
+ Utility .log ("============" );
23
+
24
+ /*
25
+ map | elements to another form defined in a function
26
+ */
27
+ List <Integer > mapped =
28
+ DataUtil .fibbinacos ().stream ().map (n ->n *n ).collect (Collectors .toList ());
29
+ mapped .stream ().forEach (System .out ::println );
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ package com .know .streams ;
2
+
3
+ import com .know .util .DataUtil ;
4
+ import static com .know .util .DataUtil .*;
5
+ import static com .know .util .Utility .*;
6
+ import java .util .Set ;
7
+ import java .util .stream .Collectors ;
8
+
9
+ /**
10
+ *
11
+ * @author KnowGroup
12
+ */
13
+ public class Lesson_02_Stream_Processing {
14
+
15
+ public static void main (String [] arg ){
16
+
17
+ /*
18
+ collect | element to a give Collector
19
+ */
20
+ //log(otp());
21
+ Set <Integer > collect = DataUtil .fibbinacos ().stream ().collect (Collectors .toSet ());
22
+
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ package com .know .util ;
2
+
3
+ import java .util .ArrayList ;
4
+ import java .util .List ;
5
+
6
+ /**
7
+ *
8
+ * @author KnowGroup
9
+ */
10
+ public class DataUtil {
11
+
12
+ public static List <Integer > fibbinacos (){
13
+ List <Integer > result = new ArrayList <>();
14
+ result .add (1 );
15
+ result .add (2 );
16
+ result .add (3 );
17
+ result .add (5 );
18
+ result .add (8 );
19
+ result .add (13 );
20
+ result .add (21 );
21
+ result .add (34 );
22
+ result .add (55 );
23
+ result .add (89 );
24
+ result .add (134 );
25
+ return result ;
26
+ }
27
+
28
+ public static String otp (){
29
+ final StringBuilder o = new StringBuilder ();
30
+ for (int i = 0 ; i < 6 ;i ++){
31
+ o .append ((int )(Math .random ()*10 ));
32
+ }
33
+ return o .toString ();
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments