現状*1 java.util.function packageには43個interfaceがあるようです。
http://download.java.net/jdk8/docs/api/java/util/function/package-summary.html
とりあえず対応表だけ作ったら力尽きたので、後で気が向いたときに、java.util.functionの残念なところと、Scalaのspecialized annotationについて書く・・・
Java | Scala |
---|---|
BiConsumer |
Function2[A, B, Unit] |
BiFunction |
Function2[A, B, C] |
BinaryOperator |
Function2[A, A, A] |
BiPredicate |
Function2[A, B, Boolean] |
BooleanSupplier | Function0[Boolean] |
Consumer |
Function1[A, Unit] |
DoubleBinaryOperator | Function2[Double, Double, Double] |
DoubleConsumer | Function1[Double, Unit] |
DoubleFunction |
Function1[Double, A] |
DoublePredicate | Function1[Double, Boolean] |
DoubleSupplier | Function0[Double] |
DoubleToIntFunction | Function1[Double, Int] |
DoubleToLongFunction | Function1[Double, Long] |
DoubleUnaryOperator | Function1[Double, Double] |
Function |
Function1[A, B] |
IntBinaryOperator | Function2[Int, Int, Int] |
IntConsumer | Function1[Int, Unit] |
IntFunction |
Function1[Int, A] |
IntPredicate | Function1[Int, Boolean] |
IntSupplier | Function0[Int] |
IntToDoubleFunction | Function1[Int, Double] |
IntToLongFunction | Function1[Int, Long] |
IntUnaryOperator | Function1[Int, Int] |
LongBinaryOperator | Function2[Long, Long, Long] |
LongConsumer | Function1[Long, Unit] |
LongFunction |
Function1[Long, A] |
LongPredicate | Function1[Long, Boolean] |
LongSupplier | Function0[Long] |
LongToDoubleFunction | Function1[Long, Double] |
LongToIntFunction | Function1[Long, Int] |
LongUnaryOperator | Function1[Long, Long] |
ObjDoubleConsumer |
Function2[T, Double, Unit] |
ObjIntConsumer |
Function2[T, Int, Unit] |
ObjLongConsumer |
Function2[T, Long, Unit] |
Predicate |
Function1[A, Boolean] |
Supplier |
Function0[A] |
ToDoubleBiFunction |
Function2[A, B, Double] |
ToDoubleFunction |
Function1[A, Double] |
ToIntBiFunction |
Function2[A, B, Int] |
ToIntFunction |
Function1[A, Int] |
ToLongBiFunction |
Function2[A, B, Long] |
ToLongFunction |
Function1[A, Long] |
UnaryOperator |
Function1[A, A] |
*1:もう仕様が完全に固まったのか、まだ変更ありえるのか?というような事情知らない