Preparation

binaere bauten gmbh • jost becker
Interface
Static methods
public interface Comparator<T> {

public static <T…> Comparator<T> reverseOrder() {
return Collec...
Virtual extension methods
public interface Iterable<T> {

default void forEach(Consumer<? super T> action) {
Objects.requi...
SAM interface
public interface Comparable<T> {
public int compareTo(T o);
}

binaere bauten gmbh • matthias köster
Lambda Expression
List<String> names = Arrays.asList("one", "two", "three");

Collections.sort(names,
(String o1, String o...
Lambda Expression
Variable capture
String prefix ="Hi "; // effectively final
names.forEach(
(String s) -> System.out.prin...
Method handles
List<Integer> nums = Arrays.asList(10, 2, 3);
nums.sort(Integer::compareTo);

List<String> names = Arrays.a...
Type inference
List<String> myList = Collections.emptyList();
Collections.sort(myList, (o1, o2) -> o2.compareTo(o1));

bin...
Stream API
List<String> names = Arrays.asList("one", "two", "three");
int minSize = names.parallelStream().
mapToInt(Strin...
JavaFX





binaere bauten gmbh • jost becker
Summary
•
–

•
–
–
–

binaere bauten gmbh • jost becker

Already feels like
Using a decent Scala IDE ;-)
Thanks a lot for your attention!

fin

binaere bauten gmbh • matthias köster
Java 8 support in eclipse/JDT
Upcoming SlideShare
Loading in …5
×

Java 8 support in eclipse/JDT

663 views

Published on

Slides of my talk I gave at the eclipse Democamp on the 2. Dec in Berlin.

Published in: Technology, Self Improvement
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
663
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java 8 support in eclipse/JDT

  1. 1. Preparation binaere bauten gmbh • jost becker
  2. 2. Interface Static methods public interface Comparator<T> { public static <T…> Comparator<T> reverseOrder() { return Collections.reverseOrder(); } } binaere bauten gmbh • matthias köster
  3. 3. Virtual extension methods public interface Iterable<T> { default void forEach(Consumer<? super T> action) { Objects.requireNonNull(action); for (T t : this) { action.accept(t); } } } binaere bauten gmbh • matthias köster
  4. 4. SAM interface public interface Comparable<T> { public int compareTo(T o); } binaere bauten gmbh • matthias köster
  5. 5. Lambda Expression List<String> names = Arrays.asList("one", "two", "three"); Collections.sort(names, (String o1, String o2) -> o2.compareTo(o1)); binaere bauten gmbh • matthias köster
  6. 6. Lambda Expression Variable capture String prefix ="Hi "; // effectively final names.forEach( (String s) -> System.out.println(prefix + s)); prefix = ""; // not effectively final anymore names.forEach( (String s) -> System.out.println(prefix + s)); binaere bauten gmbh • matthias köster
  7. 7. Method handles List<Integer> nums = Arrays.asList(10, 2, 3); nums.sort(Integer::compareTo); List<String> names = Arrays.asList("one", "two", "three"); names.forEach(System.out::println); binaere bauten gmbh • matthias köster
  8. 8. Type inference List<String> myList = Collections.emptyList(); Collections.sort(myList, (o1, o2) -> o2.compareTo(o1)); binaere bauten gmbh • matthias köster
  9. 9. Stream API List<String> names = Arrays.asList("one", "two", "three"); int minSize = names.parallelStream(). mapToInt(String::length).reduce(0, Integer::min); OptionalInt minSize = names.parallelStream(). mapToInt(String::length).min(); Path p = FileSystems.getDefault(). getPath("/tmp/index.html"); Files.lines(p,Charset.forName("UTF-8")). forEach(System.out::println); binaere bauten gmbh • matthias köster
  10. 10. JavaFX    binaere bauten gmbh • jost becker
  11. 11. Summary • – • – – – binaere bauten gmbh • jost becker Already feels like Using a decent Scala IDE ;-)
  12. 12. Thanks a lot for your attention! fin binaere bauten gmbh • matthias köster

×