@FunctionalInterface public interface IntConsumer
int值参数的操作,不返回任何结果。
这是Consumer的Consumer的原始类型int 。
与大多数其他功能界面不同,预计IntConsumer将通过副作用进行操作。
这是一个functional interface的功能方法是accept(int) 。
Consumer
| Modifier and Type | Method and Description |
|---|---|
void |
accept(int value)
对给定的参数执行此操作。
|
default IntConsumer |
andThen(IntConsumer after)
返回一个组合的
IntConsumer ,
IntConsumer执行该操作,后跟
after操作。
|
void accept(int value)
value - 输入参数
default IntConsumer andThen(IntConsumer after)
IntConsumer ,按顺序执行该操作,后跟after操作。
如果执行任一操作会抛出异常,它将被转发到组合操作的调用者。
如果执行此操作抛出一个异常, after操作将不被执行。
after - 此操作后执行的操作
IntConsumer按顺序执行该操作,然后执行
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.