Most visited

Recently visited

Added in API level 24

IntUnaryOperator

public interface IntUnaryOperator

java.util.function.IntUnaryOperator


表示对单个int值进行操作的操作数,它产生int值的结果。 这是针对intUnaryOperator的原始类型专业化。

这是一个 functional interface,其功能方法是 applyAsInt(int)

也可以看看:

摘要(Summary)

公共方法(Public methods)

default IntUnaryOperator andThen(IntUnaryOperator after)

返回首先将此运算符应用于其输入的 after运算符,然后将 after运算符应用于结果。

abstract int applyAsInt(int operand)

将此运算符应用于给定的操作数。

default IntUnaryOperator compose(IntUnaryOperator before)

返回一个合成运算符,该运算符首先将 before运算符应用于其输入,然后将此运算符应用于结果。

static IntUnaryOperator identity()

返回总是返回其输入参数的一元运算符。

公共方法(Public methods)

andThen

Added in API level 24
IntUnaryOperator andThen (IntUnaryOperator after)

返回首先将此运算符应用于其输入的after运算符,然后将after运算符应用于结果。 如果对任何一个操作符的评估抛出一个异常,它将被转发给组合操作员的调用者。

参数(Parameters)
after IntUnaryOperator: the operator to apply after this operator is applied
返回(Returns)
IntUnaryOperator a composed operator that first applies this operator and then applies the after operator
抛出异常(Throws)
NullPointerException if after is null

也可以看看:

applyAsInt

Added in API level 24
int applyAsInt (int operand)

将此运算符应用于给定的操作数。

参数(Parameters)
operand int: the operand
返回(Returns)
int the operator result

compose

Added in API level 24
IntUnaryOperator compose (IntUnaryOperator before)

返回一个合成运算符,该运算符首先将before运算符应用于其输入,然后将此运算符应用于结果。 如果对任何一个操作符的评估抛出一个异常,它将被转发给组合操作员的调用者。

参数(Parameters)
before IntUnaryOperator: the operator to apply before this operator is applied
返回(Returns)
IntUnaryOperator a composed operator that first applies the before operator and then applies this operator
抛出异常(Throws)
NullPointerException if before is null

也可以看看:

identity

Added in API level 24
IntUnaryOperator identity ()

返回总是返回其输入参数的一元运算符。

返回(Returns)
IntUnaryOperator a unary operator that always returns its input argument

Hooray!