Package groovy.util.function
Interface FloatUnaryOperator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents an operation that takes a
float-valued operand and produces
a float-valued result. This is a specialization of
UnaryOperator for float.
This is a functional interface
whose functional method is applyAsFloat(float).
- Since:
- 5.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault FloatUnaryOperatorandThen(FloatUnaryOperator after) Creates a "forward" composed operator that first applies this operator to its input, and then applies theafteroperator to the result.floatapplyAsFloat(float operand) Applies this operator.default FloatUnaryOperatorcompose(FloatUnaryOperator before) Creates a "backward" composed operator that first applies thebeforeoperator to its input, and then applies this operator to the result.static FloatUnaryOperatoridentity()Returns the identity float unary operator.
-
Method Details
-
applyAsFloat
float applyAsFloat(float operand) Applies this operator.- Parameters:
operand- the operand- Returns:
- the operator result
-
compose
Creates a "backward" composed operator that first applies thebeforeoperator to its input, and then applies this operator to the result.- Parameters:
before- the operator to apply before this operator is applied- Returns:
- the composed operator
- Throws:
NullPointerException- if before is null- See Also:
-
andThen
Creates a "forward" composed operator that first applies this operator to its input, and then applies theafteroperator to the result.- Parameters:
after- the operator to apply after this operator is applied- Returns:
- the composed operator
- Throws:
NullPointerException- if after is null- See Also:
-
identity
Returns the identity float unary operator.- Returns:
- a unary operator that always returns its input argument
-