Package zone.lamprey.function
Interface DoubleUnaryOperator
- All Superinterfaces:
DoubleFunction<Double>,DoubleFunction<Double>,DoubleUnaryOperator,Function<Double,Double>,Function<Double,Double>,ToDoubleFunction<Double>,ToDoubleFunction<Double>,UnaryOperator<Double>,UnaryOperator<Double>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DoubleUnaryOperator extends DoubleFunction<Double>, UnaryOperator<Double>, ToDoubleFunction<Double>, DoubleUnaryOperator
Represents an operation on a single
double-valued operand that
produces a double-valued result. This is the primitive type
specialization of UnaryOperator for double.
This is a functional interface whose
functional method is applyAsDouble(double).
- Since:
- 1.8
- See Also:
UnaryOperator
-
Field Summary
Fields Modifier and Type Field Description static DoubleUnaryOperatorABSFunctional interface toMath.abs(double) -
Method Summary
Modifier and Type Method Description default Doubleapply(double value)Applies this function to the given argument.default Doubleapply(Double value)Applies this function to the given argument.doubleapplyAsDouble(double value)Applies this function to the given argument.default doubleapplyAsDouble(Double value)Applies this function to the given argument.default DoubleSupplierapplyPartial(double t)Partially apply a parameter such that a single param function becomes a no-param supplier.default DoubleConsumerconsume(DoubleConsumer consumer)Consume a function.static DoubleUnaryOperatoridentity()Returns a unary operator that always returns its input argument.default DoubleUnaryOperatormap(UnaryOperator<Double> functor)Lift a function.default DoubleToIntFunctionmapToInt(DoubleToIntFunction functor)Lift a function.default DoubleToLongFunctionmapToLong(DoubleToLongFunction functor)Lift a function.default <S> DoubleFunction<S>mapToObj(DoubleFunction<? extends S> functor)Lift a function.default DoublePredicatemapToPredicate(DoublePredicate functor)Lift a function.default doublerecurse(double value, int depth)A method that tells a function to call itself with its own result.default doublerecurse(double value, DoublePredicate terminalCondition)A method that tells a function to call itself with its own result.default doublerecurse(double value, DoublePredicate terminalCondition, int maxDepth)A method that tells a function to call itself with its own result.default DoubleUnaryOperatorrecursive(int depth)A method that creates a function which calls a function with its own result some amount of times.default DoubleUnaryOperatorrecursive(DoublePredicate terminalCondition)A method that creates a function which calls a function with its own result until some condition is met.default DoubleUnaryOperatorrecursive(DoublePredicate terminalCondition, int maxDepth)A method that creates a function which calls a function with its own result some amount of times or until some condition is met.Methods inherited from interface zone.lamprey.function.DoubleFunction
consume, map, mapToDouble, mapToInt, mapToLong, mapToPredicate
-
Field Details
-
ABS
Functional interface toMath.abs(double)
-
-
Method Details
-
applyAsDouble
double applyAsDouble(double value)Applies this function to the given argument.- Specified by:
applyAsDoublein interfaceDoubleUnaryOperator- Parameters:
value- the function argument- Returns:
- the function result
-
applyAsDouble
Applies this function to the given argument.- Specified by:
applyAsDoublein interfaceToDoubleFunction<Double>- Specified by:
applyAsDoublein interfaceToDoubleFunction<Double>- Parameters:
value- the function argument- Returns:
- the function result
-
apply
Applies this function to the given argument.- Specified by:
applyin interfaceDoubleFunction<Double>- Specified by:
applyin interfaceDoubleFunction<Double>- Parameters:
value- the function argument- Returns:
- the function result
-
apply
Applies this function to the given argument.- Specified by:
applyin interfaceDoubleFunction<Double>- Specified by:
applyin interfaceFunction<Double,Double>- Specified by:
applyin interfaceFunction<Double,Double>- Specified by:
applyin interfaceToDoubleFunction<Double>- Parameters:
value- the function argument- Returns:
- the function result
-
applyPartial
Partially apply a parameter such that a single param function becomes a no-param supplier.- Specified by:
applyPartialin interfaceDoubleFunction<Double>- Parameters:
t- The parameter to apply.- Returns:
- A partially-applied function.
-
consume
Consume a function.- Specified by:
consumein interfaceToDoubleFunction<Double>- Parameters:
consumer- The consumer to use in consuming.- Returns:
- A Consumer which passes it's argument to this function and then passes the result into the given consumer.
-
mapToObj
Lift a function.- Specified by:
mapToObjin interfaceToDoubleFunction<Double>- Type Parameters:
S- The return type.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToPredicate
Lift a function.- Specified by:
mapToPredicatein interfaceToDoubleFunction<Double>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToInt
Lift a function.- Specified by:
mapToIntin interfaceToDoubleFunction<Double>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToLong
Lift a function.- Specified by:
mapToLongin interfaceToDoubleFunction<Double>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
map
Lift a function.- Specified by:
mapin interfaceUnaryOperator<Double>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
recurse
A method that tells a function to call itself with its own result. This actually imitates recursion using iteration. Don't tell anyone.- Parameters:
value- The initial value to apply to the function.terminalCondition- The condition upon which the "recursion" will terminate.- Returns:
- The result of the recursive call.
-
recurse
A method that tells a function to call itself with its own result. This actually imitates recursion using iteration. Don't tell anyone.- Parameters:
value- The initial value to apply to the function.terminalCondition- The condition upon which the "recursion" will terminate.maxDepth- The maximum number of times to recurse. A depth of zero or less will simply return the passed-in value (the function will never be called).- Returns:
- The result of the recursive call.
-
recurse
default double recurse(double value, int depth)A method that tells a function to call itself with its own result. This actually imitates recursion using iteration. Don't tell anyone.- Parameters:
value- The initial value to apply to the function.depth- The number of times to recurse. A depth of zero or less will simply return the passed-in value (the function will never be called).- Returns:
- The result of the recursive call.
-
recursive
A method that creates a function which calls a function with its own result until some condition is met.- Parameters:
terminalCondition- The condition upon which the recursion will terminate.- Returns:
- A function that will call the given function on its own result a number of times as specified by the depth parameter.
-
recursive
A method that creates a function which calls a function with its own result some amount of times or until some condition is met.- Parameters:
terminalCondition- The condition upon which the recursion will terminate.maxDepth- The maximum number of times to recurse. A depth of zero or less will simply return the passed-in value (the function will never be called).- Returns:
- A function that will call the given function on its own result a number of times as specified by the depth parameter.
-
recursive
A method that creates a function which calls a function with its own result some amount of times.- Specified by:
recursivein interfaceUnaryOperator<Double>- Parameters:
depth- The number of times to recurse. A depth of zero or less will simply return the value passed toapply(t)(the inner function will never be called).- Returns:
- A function that will call the given function on its own result a number of times as specified by the depth parameter.
-
identity
Returns a unary operator that always returns its input argument.- Returns:
- a unary operator that always returns its input argument
-