Most visited

Recently visited

Added in API level 24

DoubleUnaryOperator

public interface DoubleUnaryOperator

java.util.function.DoubleUnaryOperator


表示对单个double操作数的操作,该操作数生成double结果。 这是针对doubleUnaryOperator的原始类型专业化。

这是一个 functional interface,其功能方法是 applyAsDouble(double)

也可以看看:

Summary

Public methods

default DoubleUnaryOperator andThen(DoubleUnaryOperator after)

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

abstract double applyAsDouble(double operand)

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

default DoubleUnaryOperator compose(DoubleUnaryOperator before)

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

static DoubleUnaryOperator identity()

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

Public methods

andThen

Added in API level 24
DoubleUnaryOperator andThen (DoubleUnaryOperator after)

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

Parameters
after DoubleUnaryOperator: the operator to apply after this operator is applied
Returns
DoubleUnaryOperator a composed operator that first applies this operator and then applies the after operator
Throws
NullPointerException if after is null

也可以看看:

applyAsDouble

Added in API level 24
double applyAsDouble (double operand)

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

Parameters
operand double: the operand
Returns
double the operator result

compose

Added in API level 24
DoubleUnaryOperator compose (DoubleUnaryOperator before)

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

Parameters
before DoubleUnaryOperator: the operator to apply before this operator is applied
Returns
DoubleUnaryOperator 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
DoubleUnaryOperator identity ()

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

Returns
DoubleUnaryOperator a unary operator that always returns its input argument

Hooray!