@FunctionalInterface public interface IntConsumer
int
-valued参数并返回任何结果。这是
int
的
Consumer
原始类型的专业化。不像大多数其他的功能接口,
IntConsumer
有望通过的副作用。
这是一个functional interface其功能的方法是accept(int)
。
Consumer
Modifier and Type | Method and Description |
---|---|
void |
accept(int value)
在给定的参数上执行此操作。
|
default IntConsumer |
andThen(IntConsumer after)
返回一个由
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.