@FunctionalInterface
public interface ShortUnaryOperator
extends java.util.function.UnaryOperator<java.lang.Short>, java.util.function.IntUnaryOperator
UnaryOperator
; provides methods operating both on objects
and on primitives.UnaryOperator
Modifier and Type | Method and Description |
---|---|
short |
apply(short x)
Computes the operator on the given input.
|
default java.lang.Short |
apply(java.lang.Short x)
Deprecated.
Please use the corresponding type-specific method instead.
|
default int |
applyAsInt(int x)
Deprecated.
Please use
apply(short) . |
static ShortUnaryOperator |
identity()
Returns a
UnaryOperator that always returns the input unmodified. |
static ShortUnaryOperator |
negation()
Returns a
UnaryOperator that always returns the arithmetic negation of the input. |
short apply(short x)
x
- the input.static ShortUnaryOperator identity()
UnaryOperator
that always returns the input unmodified.identity
in interface java.util.function.Function<java.lang.Short,java.lang.Short>
identity
in interface java.util.function.IntUnaryOperator
identity
in interface java.util.function.UnaryOperator<java.lang.Short>
UnaryOperator.identity()
static ShortUnaryOperator 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(short)
.applyAsInt
in interface java.util.function.IntUnaryOperator
java.lang.IllegalArgumentException
- If the given operands are not an element of the key domain.apply(short)
after narrowing down the argument to the
actual key type, throwing an exception if the argument cannot be
represented in the restricted domain. This is done for interoperability
with the Java 8 function environment. The use of this method discouraged, as
unexpected errors can occur.@Deprecated default java.lang.Short apply(java.lang.Short x)
apply
in interface java.util.function.Function<java.lang.Short,java.lang.Short>