Most visited

Recently visited

Added in API level 24

BiFunction

public interface BiFunction

java.util.function.BiFunction<T, U, R>
Known Indirect Subclasses


表示接受两个参数并产生结果的函数。 这是Function专业化。

这是一个 functional interface,其功能方法是 apply(Object, Object)

也可以看看:

摘要(Summary)

公共方法(Public methods)

default <V> BiFunction<T, U, V> andThen(Function<? super R, ? extends V> after)

返回一个组合函数,该函数首先将此函数应用于其输入,然后将 after函数应用于结果。

abstract R apply(T t, U u)

将此函数应用于给定的参数。

公共方法(Public methods)

andThen

Added in API level 24
BiFunction<T, U, V> andThen (Function<? super R, ? extends V> after)

返回首先将此函数应用于其输入的after函数,然后将after函数应用于结果。 如果对任一函数的求值引发异常,则将其传递给组合函数的调用者。

参数(Parameters)
after Function: the function to apply after this function is applied
返回(Returns)
BiFunction<T, U, V> a composed function that first applies this function and then applies the after function
抛出异常(Throws)
NullPointerException if after is null

apply

Added in API level 24
R apply (T t, 
                U u)

将此函数应用于给定的参数。

参数(Parameters)
t T: the first function argument
u U: the second function argument
返回(Returns)
R the function result

Hooray!