public interface BiConsumer
| java.util.function.BiConsumer<T, U> |
表示接受两个输入参数并且不返回结果的操作。 这是Consumer专业化。 与大多数其他功能界面不同, BiConsumer预计将通过副作用进行操作。
这是一个 functional interface,其功能方法是 accept(Object, Object) 。
也可以看看:
公共方法(Public methods) |
|
|---|---|
abstract void |
accept(T t, U u) 对给定的参数执行此操作。 |
default BiConsumer<T, U> |
andThen(BiConsumer<? super T, ? super U> after) 返回合成的 |
void accept (T t,
U u)
对给定的参数执行此操作。
| 参数(Parameters) | |
|---|---|
t |
T: the first input argument |
u |
U: the second input argument |
BiConsumer<T, U> andThen (BiConsumer<? super T, ? super U> after)
返回合成的BiConsumer ,按顺序执行此操作,然后执行after操作。 如果执行任一操作会引发异常,则将其传递给组合操作的调用者。 如果执行此操作会引发异常,则after操作将不会执行。
| 参数(Parameters) | |
|---|---|
after |
BiConsumer: the operation to perform after this operation |
| 返回(Returns) | |
|---|---|
BiConsumer<T, U> |
a composed BiConsumer that performs in sequence this operation followed by the after operation |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if after is null |