Java1.8 function Interface __ Block chain

Source: Internet
Author: User

Reproduced from: Java 8 Functional interface

A functional interface (functional Interface) is a generic interface with a method.
A functional interface can be implicitly converted to a lambda expression.
Functional interfaces can have existing functions to support lambda in a friendly way.
Pre-JDK 1.8 functional interfaces: Java.lang.Runnable java.util.concurrent.Callable java.security.PrivilegedAction Java.util.Comparator Java.io.FileFilter Java.nio.file.PathMatcher Java.lang.reflect.InvocationHandler Java.beans.PropertyChangeListener Java.awt.event.ActionListener Javax.swing.event.ChangeListener

JDK 1.8 New Added function interface: java.util.function

Serial Number Interface Description
1 Biconsumer Represents an operation that accepts two input parameters and does not return any results
2 Bifunction Represents a method that accepts two input parameters and returns a result
3 Binaryoperator Represents an operation that acts on two homogeneous operators and returns the result of the same type of operator
4 Bipredicate Represents a Boolean value method of two parameters
5 Booleansupplier Represents the provider of a Boolean value result
6 Consumer Represents an operation that accepts an input parameter and does not return
7 Doublebinaryoperator Represents an operation that acts on the two double value operator and returns the result of a double value.
8 Doubleconsumer Represents an operation that accepts a double value parameter and does not return a result.
9 Doublefunction Represents a method that accepts a double value parameter and returns the result
10 Doublepredicate Represents a Boolean method that has a double value parameter
11 Doublesupplier Represents a provider of a double value structure
12 Doubletointfunction Accepts a double type input, returning an int type result.
13 Doubletolongfunction Accepts a double type input and returns a long type result
14 Doubleunaryoperator Accept a parameter with the same type double, and the return value type double.
15 Function takes an input parameter and returns a result.
16 Intbinaryoperator Accepts two parameters with the same type int, and the return value type is int.
17 Intconsumer accepts an int type input parameter with no return value.
18 Intfunction accepts an int type input parameter and returns a result.
19 Intpredicate accepts an int input parameter, returns the result of a Boolean value.
20 Intsupplier No parameters, returns an int type result.
21st Inttodoublefunction accepts an int type input and returns a double type result.
22 Inttolongfunction accepts an int type input and returns a long type result.
23 Intunaryoperator Accepts a parameter of the same type int, and the return value type is int.
24 Longbinaryoperator Accepts two arguments of the same type long, and the return value type is long.
25 Longconsumer Accepts a long type input parameter with no return value.
26 Longfunction Takes a long type input parameter and returns a result.
27 Longpredicate R takes a long input parameter and returns a Boolean type result.
28 Longsupplier No arguments, returns a value of type long.
29 Longtodoublefunction Accepts a long input and returns a double type result.
30 Longtointfunction Takes a long type input and returns an int type result.
31 Longunaryoperator Accepts a parameter of the same type long, and the return value type is long.
32 Objdoubleconsumer Accepts an input parameter of type object and a double, no return value.
33 Objintconsumer Accepts an input parameter of type object and an int type with no return value.
34 Objlongconsumer Accepts an object type and a long type input parameter with no return value.
35 predicate Accepts an input parameter and returns a Boolean result.
36 Supplier No parameters, returns a result.
37 Todoublebifunction Accepts two input parameters, returns a double type result
38 Todoublefunction Accepts an input parameter, returns a double type result
39 Tointbifunction Accepts two input parameters and returns an int type result.
40 Tointfunction Accepts an input parameter and returns an int type result.
41 Tolongbifunction Accepts two input parameters and returns a long type result.
42 Tolongfunction takes an input parameter and returns a long result.
unaryoperator accepts a parameter of type T, and the return value type is T.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.