Stay organized with collections
Save and categorize content based on your preferences.
DoubleUnaryOperator
@FunctionalInterface interface 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)
.
Summary
Public methods |
open DoubleUnaryOperator! |
Returns a composed operator that first applies this operator to its input, and then applies the after operator to the result.
|
abstract Double |
Applies this operator to the given operand.
|
open DoubleUnaryOperator! |
Returns a composed operator that first applies the before operator to its input, and then applies this operator to the result.
|
open static DoubleUnaryOperator! |
Returns a unary operator that always returns its input argument.
|
Public methods
andThen
open fun andThen(after: DoubleUnaryOperator!): DoubleUnaryOperator!
Returns a composed operator that first applies this operator to its input, and then applies the after
operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.
Return |
DoubleUnaryOperator! |
a composed operator that first applies this operator and then applies the after operator |
Exceptions |
java.lang.NullPointerException |
if after is null |
applyAsDouble
abstract fun applyAsDouble(operand: Double): Double
Applies this operator to the given operand.
Parameters |
operand |
Double: the operand |
Return |
Double |
the operator result |
compose
open fun compose(before: DoubleUnaryOperator!): DoubleUnaryOperator!
Returns a composed operator that first applies the before
operator to its input, and then applies this operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.
Return |
DoubleUnaryOperator! |
a composed operator that first applies the before operator and then applies this operator |
Exceptions |
java.lang.NullPointerException |
if before is null |
identity
open static fun identity(): DoubleUnaryOperator!
Returns a unary operator that always returns its input argument.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DoubleUnaryOperator\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDoubleUnaryOperator\n===================\n\n```\n@FunctionalInterface interface DoubleUnaryOperator\n```\n\n|---------------------------------------------|\n| [java.util.function.DoubleUnaryOperator](#) |\n\nRepresents an operation on a single `double`-valued operand that produces a `double`-valued result. This is the primitive type specialization of [UnaryOperator](/reference/kotlin/java/util/function/UnaryOperator) for `double`.\n\nThis is a [functional interface](/reference/kotlin/java/util/function/package-summary) whose functional method is [applyAsDouble(double)](#applyAsDouble(kotlin.Double)).\n\nSummary\n-------\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [DoubleUnaryOperator](#)! | [andThen](#andThen(java.util.function.DoubleUnaryOperator))`(`after:` `[DoubleUnaryOperator](#)!`)` Returns a composed operator that first applies this operator to its input, and then applies the `after` operator to the result. |\n| abstract [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) | [applyAsDouble](#applyAsDouble(kotlin.Double))`(`operand:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Applies this operator to the given operand. |\n| open [DoubleUnaryOperator](#)! | [compose](#compose(java.util.function.DoubleUnaryOperator))`(`before:` `[DoubleUnaryOperator](#)!`)` Returns a composed operator that first applies the `before` operator to its input, and then applies this operator to the result. |\n| open static [DoubleUnaryOperator](#)! | [identity](#identity())`()` Returns a unary operator that always returns its input argument. |\n\nPublic methods\n--------------\n\n### andThen\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun andThen(after: DoubleUnaryOperator!): DoubleUnaryOperator!\n```\n\nReturns a composed operator that first applies this operator to its input, and then applies the `after` operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------|\n| `after` | [DoubleUnaryOperator](#)!: the operator to apply after this operator is applied |\n\n| Return ||\n|---------------------------|--------------------------------------------------------------------------------------------|\n| [DoubleUnaryOperator](#)! | a composed operator that first applies this operator and then applies the `after` operator |\n\n| Exceptions ||\n|----------------------------------|------------------|\n| `java.lang.NullPointerException` | if after is null |\n\n**See Also**\n\n- [#compose(DoubleUnaryOperator)](#compose(java.util.function.DoubleUnaryOperator)) \n\n### applyAsDouble\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun applyAsDouble(operand: Double): Double\n```\n\nApplies this operator to the given operand.\n\n| Parameters ||\n|-----------|-----------------------------------------------------------------------------------------------|\n| `operand` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): the operand |\n\n| Return ||\n|----------------------------------------------------------------------------------|---------------------|\n| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) | the operator result |\n\n### compose\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun compose(before: DoubleUnaryOperator!): DoubleUnaryOperator!\n```\n\nReturns a composed operator that first applies the `before` operator to its input, and then applies this operator to the result. If evaluation of either operator throws an exception, it is relayed to the caller of the composed operator.\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------|\n| `before` | [DoubleUnaryOperator](#)!: the operator to apply before this operator is applied |\n\n| Return ||\n|---------------------------|---------------------------------------------------------------------------------------------|\n| [DoubleUnaryOperator](#)! | a composed operator that first applies the `before` operator and then applies this operator |\n\n| Exceptions ||\n|----------------------------------|-------------------|\n| `java.lang.NullPointerException` | if before is null |\n\n**See Also**\n\n- [#andThen(DoubleUnaryOperator)](#andThen(java.util.function.DoubleUnaryOperator)) \n\n### identity\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen static fun identity(): DoubleUnaryOperator!\n```\n\nReturns a unary operator that always returns its input argument.\n\n| Return ||\n|---------------------------|---------------------------------------------------------|\n| [DoubleUnaryOperator](#)! | a unary operator that always returns its input argument |"]]