Stay organized with collections
Save and categorize content based on your preferences.
LongUnaryOperator
@FunctionalInterface interface LongUnaryOperator
Represents an operation on a single long
-valued operand that produces a long
-valued result. This is the primitive type specialization of UnaryOperator
for long
.
This is a functional interface whose functional method is applyAsLong(long)
.
Summary
Public methods |
open LongUnaryOperator! |
Returns a composed operator that first applies this operator to its input, and then applies the after operator to the result.
|
abstract Long |
Applies this operator to the given operand.
|
open LongUnaryOperator! |
Returns a composed operator that first applies the before operator to its input, and then applies this operator to the result.
|
open static LongUnaryOperator! |
Returns a unary operator that always returns its input argument.
|
Public methods
andThen
open fun andThen(after: LongUnaryOperator!): LongUnaryOperator!
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.
Parameters |
after |
LongUnaryOperator!: the operator to apply after this operator is applied |
Return |
LongUnaryOperator! |
a composed operator that first applies this operator and then applies the after operator |
Exceptions |
java.lang.NullPointerException |
if after is null |
applyAsLong
abstract fun applyAsLong(operand: Long): Long
Applies this operator to the given operand.
Parameters |
operand |
Long: the operand |
Return |
Long |
the operator result |
compose
open fun compose(before: LongUnaryOperator!): LongUnaryOperator!
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.
Parameters |
before |
LongUnaryOperator!: the operator to apply before this operator is applied |
Return |
LongUnaryOperator! |
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(): LongUnaryOperator!
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,["# LongUnaryOperator\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nLongUnaryOperator\n=================\n\n```\n@FunctionalInterface interface LongUnaryOperator\n```\n\n|-------------------------------------------|\n| [java.util.function.LongUnaryOperator](#) |\n\nRepresents an operation on a single `long`-valued operand that produces a `long`-valued result. This is the primitive type specialization of [UnaryOperator](/reference/kotlin/java/util/function/UnaryOperator) for `long`.\n\nThis is a [functional interface](/reference/kotlin/java/util/function/package-summary) whose functional method is [applyAsLong(long)](#applyAsLong(kotlin.Long)).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [LongUnaryOperator](#)! | [andThen](#andThen(java.util.function.LongUnaryOperator))`(`after:` `[LongUnaryOperator](#)!`)` Returns a composed operator that first applies this operator to its input, and then applies the `after` operator to the result. |\n| abstract [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [applyAsLong](#applyAsLong(kotlin.Long))`(`operand:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Applies this operator to the given operand. |\n| open [LongUnaryOperator](#)! | [compose](#compose(java.util.function.LongUnaryOperator))`(`before:` `[LongUnaryOperator](#)!`)` Returns a composed operator that first applies the `before` operator to its input, and then applies this operator to the result. |\n| open static [LongUnaryOperator](#)! | [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: LongUnaryOperator!): LongUnaryOperator!\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` | [LongUnaryOperator](#)!: the operator to apply after this operator is applied |\n\n| Return ||\n|-------------------------|--------------------------------------------------------------------------------------------|\n| [LongUnaryOperator](#)! | 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(LongUnaryOperator)](#compose(java.util.function.LongUnaryOperator)) \n\n### applyAsLong\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun applyAsLong(operand: Long): Long\n```\n\nApplies this operator to the given operand.\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------|\n| `operand` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the operand |\n\n| Return ||\n|------------------------------------------------------------------------------|---------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/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: LongUnaryOperator!): LongUnaryOperator!\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` | [LongUnaryOperator](#)!: the operator to apply before this operator is applied |\n\n| Return ||\n|-------------------------|---------------------------------------------------------------------------------------------|\n| [LongUnaryOperator](#)! | 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(LongUnaryOperator)](#andThen(java.util.function.LongUnaryOperator)) \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(): LongUnaryOperator!\n```\n\nReturns a unary operator that always returns its input argument.\n\n| Return ||\n|-------------------------|---------------------------------------------------------|\n| [LongUnaryOperator](#)! | a unary operator that always returns its input argument |"]]