Commit a8aeeb5
Java 8 stream tweaks
working:
// http://www.javainuse.com/java/java8_method_References
List<String> myList = Arrays.asList("b1", "a2", "a1", "c2", "c1");
System.out.println("\n\n------- stream().map().forEach() using lambda
expressions -------");
myList.stream().map(s -> s.toUpperCase()).forEach(s ->
System.out.print(s + " "));
System.out.println("\n\n------- stream().map().sorted().forEach()
using Class::method method reference --------");
myList.stream().map(String::toUpperCase).sorted().forEach(System.out::print);
// https://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/
System.out.println("\n\n-------
stream().filter().map().sorted().forEach() --------");
myList.stream()
.filter(s -> s.startsWith("c"))
.map(String::toUpperCase)
.sorted()
.forEach(System.out::print);
System.out.println("\n");1 parent 9a8f94c commit a8aeeb5
File tree
3 files changed
+4
-6
lines changed- sources/net.sf.j2s.core
- dist/dropins
- ver
- src/net/sf/j2s/core/astvisitors
3 files changed
+4
-6
lines changedBinary file not shown.
Binary file not shown.
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5730 | 5730 | | |
5731 | 5731 | | |
5732 | 5732 | | |
5733 | | - | |
5734 | | - | |
5735 | | - | |
5736 | | - | |
| 5733 | + | |
5737 | 5734 | | |
5738 | 5735 | | |
5739 | | - | |
| 5736 | + | |
| 5737 | + | |
| 5738 | + | |
5740 | 5739 | | |
5741 | 5740 | | |
5742 | 5741 | | |
| |||
5805 | 5804 | | |
5806 | 5805 | | |
5807 | 5806 | | |
5808 | | - | |
5809 | 5807 | | |
5810 | 5808 | | |
5811 | 5809 | | |
| |||
0 commit comments