T - 操作的第一个参数的类型
U - 操作的第二个参数的类型
@FunctionalInterface public interface BiConsumer<T,U>
Consumer的二元专业化 。
与大多数其他功能界面不同,预计BiConsumer将通过副作用进行操作。
这是一个functional interface的功能方法是accept(Object, Object) 。
Consumer
| Modifier and Type | Method and Description |
|---|---|
void |
accept(T t, U u)
对给定的参数执行此操作。
|
default BiConsumer<T,U> |
andThen(BiConsumer<? super T,? super U> after)
返回一个组合的
BiConsumer ,按顺序执行此操作,后跟
after操作。
|
default BiConsumer<T,U> andThen(BiConsumer<? super T,? super U> after)
BiConsumer ,按顺序执行此操作,后跟after操作。
如果执行任一操作会抛出异常,它将被转发到组合操作的调用者。
如果执行此操作抛出一个异常, after操作将不被执行。
after - 此操作后执行的操作
BiConsumer按顺序执行这个操作,然后是
after操作
NullPointerException - 如果
after为空
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.