@FunctionalInterface
public interface IntUnaryOperator
extends java.util.function.UnaryOperator<java.lang.Integer>, java.util.function.IntUnaryOperator
UnaryOperator
; provides methods operating both on objects
and on primitives.UnaryOperator
Modifier and Type | Method and Description |
---|---|
int |
apply(int x)
Computes the operator on the given input.
|
default java.lang.Integer |
apply(java.lang.Integer x)
Deprecated.
Please use the corresponding type-specific method instead.
|
default int |
applyAsInt(int x)
Deprecated.
Please use
apply(int) . |
static IntUnaryOperator |
identity()
Returns a
UnaryOperator that always returns the input unmodified. |
static IntUnaryOperator |
negation()
Returns a
UnaryOperator that always returns the arithmetic negation of the input. |
int apply(int x)
x
- the input.static IntUnaryOperator identity()
UnaryOperator
that always returns the input unmodified.identity
in interface java.util.function.Function<java.lang.Integer,java.lang.Integer>
identity
in interface java.util.function.IntUnaryOperator
identity
in interface java.util.function.UnaryOperator<java.lang.Integer>
UnaryOperator.identity()
static IntUnaryOperator negation()
UnaryOperator
that always returns the arithmetic negation of the input.Integer.MIN_VALUE
will result in Integer.MIN_VALUE
(still negative),
as the positive value of Integer.MIN_VALUE
is too big for int
(it would be 1 greater then Integer.MAX_VALUE
).@Deprecated default int applyAsInt(int x)
apply(int)
.applyAsInt
in interface java.util.function.IntUnaryOperator
apply(int)
.@Deprecated default java.lang.Integer apply(java.lang.Integer x)
apply
in interface java.util.function.Function<java.lang.Integer,java.lang.Integer>