O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Java8 lambdas

Roberts Polis Inglês

Conteúdo do mapa

Java8 lambdas

  1. Functional References

    • Class::instanceMethod
    • Class::staticMethod
    • object::instanceMethod
      • public class User { private String name; public User(String name) { this.name = name; } public void printName() { System.out.println(name); } } public class Main { public static void main(String[] args) { User u1 = new User("AAA"); User u2 = new User("BBB"); User u3 = new User("ZZZ"); List userList = Arrays.asList(u1, u2, u3); userList.forEach(User::printName); // works userList.forEach(u1::printName); // compile error } }
    • EnclosingClass.this::method
      •     In an inner class, you can capture the this reference of an enclosing class as EnclosingClass.this::method. You can also capture super    
    • Class::new
      •  Stream stream = names.stream().map(Employee::new);  int[]::new is a constructor reference with one parameter: the length of the array. It is equivalent to the lambda expression n -> new int[n].  Employee[] buttons = stream.toArray(Employee[]::new);    
  2. Interface

    • Constant Fields
      • implicit public,static, final
    • Default Methods
      • declared using Default
      • fully implemented method
    • Static methods
    • single abstract method makes interface functional
  3. java.util.function

    • Predicate
      • BiPredicate<T,U> => boolean tes(T,U)
    • Consumer<T> => void accept(T)
    • Function<T,R> => R apply(T)
      • ToDoubleFunction<T> => double applyAsDouble(T)
      • DoubleFunction<R> => R apply(double)
    • Supplier<T> => T get()
    • Unary
      • UnaryOperator<T> => T apply(T)
  4. Lambda Operations

    • filter()
    • map(Function<T,R>)
      • mapToLong()
      • mapToInt()
    • peek(Consumer<T>)
    • forEach()
    • count()
    • sum()
    • average()
    • min(Comparator<T>)
    • findFirst()
    • findAny()
    • anyMatch()
    • allMatch()
    • noneMatch()
    • mapToDouble()
    • max(Comparator<T>)
    • sorted(Comparator<T>)
    • Comparing(Function<T,U>)
    • reversed()
    • collect(Collector<?>)
    • java.util.stream.Collectors
      • averagingDouble(ToDoubleFunction<T>)
      • groupingBy(Function<K>)
        • Map&lt;String, Long&gt; counting = items.stream().collect( Collectors.groupingBy(Item::getName, Collectors.counting()));
      • joining()
      • partitioningBy(Predicate<T>)
  5. Stream

    • Collection .stream() parallelStream()
    • Arrays.stream(Object[])
    • Stream.of(Object[])
    • intStream.range()
    • Stream.iterate(Object,UnaryOperator)
    • BufferedReader.lines()

Informações

Descrição
Mapa Mental sobre Java8 lambdas, criado por Roberts Polis em 21-05-2017.
Criado por
Roberts Polis
Visualizações
6
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?