Added in API level 24

LongUnaryOperator

@FunctionalInterface interface LongUnaryOperator
java.util.function.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
applyAsLong(operand: 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

Added in API level 24
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

Added in API level 24
abstract fun applyAsLong(operand: Long): Long

Applies this operator to the given operand.

Parameters
operand Long: the operand
Return
Long the operator result

compose

Added in API level 24
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

Added in API level 24
open static fun identity(): LongUnaryOperator!

Returns a unary operator that always returns its input argument.

Return
LongUnaryOperator! a unary operator that always returns its input argument