(source: Java SE 8 for the Really Impatient: Programming with Lambdas - 3.3. Choosing a Functional Interface)
Common Functional Interfaces
Functional Interface |
Parameter Types |
Return Type |
Abstract Method Name |
Description |
Other Methods |
|
none |
|
|
Runs an action without arguments or return value |
|
|
none |
|
|
Supplies a value of type |
|
|
|
|
|
Consumes a value of type |
|
|
|
|
|
Consumes values of types |
|
|
|
|
|
A function with argument of type |
|
|
|
|
|
A function with arguments of types |
|
|
|
|
|
A unary operator on the type |
|
|
|
|
|
A binary operator on the type |
|
|
|
|
|
A Boolean-valued function |
|
|
|
|
|
A Boolean-valued function with two arguments |
|
Functional Interfaces for Primitive Types
p, q is int
, long
, double
; P, Q is Int
, Long
, Double
Functional Interface |
Parameter Types |
Return Type |
Abstract Method Name |
|
none |
|
|
P |
none |
p |
|
P |
p |
|
|
|
|
|
|
P |
p |
|
|
P |
p |
q |
|
|
|
p |
|
|
|
p |
|
P |
p |
p |
|
P |
p, p |
p |
|
P |
p |
|
|
No comments:
Post a Comment