Javaには関数型インタフェースがたくさん用意されてるのだけど、なにがあってなにがないのかとかわかりにくいのでまとめている。
ここの最後にまとめていたのだけど、検索しづらいので独立させた
https://nowokay.hatenablog.com/entry/20130824/1377300917
しかし見れたもんじゃないな・・・
下のほうに再掲
第一引数 | 第二引数 | void | int | long | double | boolean | object R | (T=U=R) |
---|---|---|---|---|---|---|---|---|
Runnable | IntSupplier | LongSupplier | DoubleSupplier | BooleanSupplier | Supplier | |||
int | IntConsumer | IntUnaryOperator | IntToLongFunction | IntToDoubleFunction | IntPredicate | IntFunction | ||
int | int | IntBinaryOperator | ||||||
long | LongConsumer | LongToIntFunction | LongUnaryOperator | LongToDoubleFunction | LongPredicate | LongFunction | ||
long | long | LongBinaryOperator | ||||||
double | DoubleConsumer | DoubleToIntFunction | DoubleToLongFunction | DoubleUnaryOperator | DoublePredicate | DoubleFunction | ||
double | double | DoubleBinaryOperator | ||||||
ObjectT | Consumer | ToIntFunction | ToLongFunction | ToDoubleFunction | Predicate | Function | UnaryOperator | |
ObjectT | ObjectU | BiConsumer | ToIntBiFunction | ToLongBiFunciton | ToDoubleBiFunction | BiPredicate | BiFunction | BinaryOperator |
ObjectT | int | ObjIntConsumer | ||||||
ObjectT | long | ObjLongConsumer | ||||||
ObjectT | double | ObjDoubleConsumer |
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
・
第一引数 | 第二引数 | void | int | long | double | boolean | object R | (T=U=R) |
---|---|---|---|---|---|---|---|---|
Runnable | IntSupplier | LongSupplier | DoubleSupplier | BooleanSupplier | Supplier | |||
int | IntConsumer | IntUnaryOperator | IntToLongFunction | IntToDoubleFunction | IntPredicate | IntFunction | ||
int | int | IntBinaryOperator | ||||||
long | LongConsumer | LongToIntFunction | LongUnaryOperator | LongToDoubleFunction | LongPredicate | LongFunction | ||
long | long | LongBinaryOperator | ||||||
double | DoubleConsumer | DoubleToIntFunction | DoubleToLongFunction | DoubleUnaryOperator | DoublePredicate | DoubleFunction | ||
double | double | DoubleBinaryOperator | ||||||
ObjectT | Consumer | ToIntFunction | ToLongFunction | ToDoubleFunction | Predicate | Function | UnaryOperator | |
ObjectT | ObjectU | BiConsumer | ToIntBiFunction | ToLongBiFunciton | ToDoubleBiFunction | BiPredicate | BiFunction | BinaryOperator |
ObjectT | int | ObjIntConsumer | ||||||
ObjectT | long | ObjLongConsumer | ||||||
ObjectT | double | ObjDoubleConsumer |