Package io.deephaven.function
Interface ToIntFunction<T>
- Type Parameters:
T
- the input type
- All Superinterfaces:
ToIntFunction<T>
,ToPrimitiveFunction<T>
,TypedFunction<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ToIntFunction<T>
extends ToPrimitiveFunction<T>, ToIntFunction<T>
An
int
function.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.function.ToPrimitiveFunction
ToPrimitiveFunction.Visitor<T,
R> -
Method Summary
Modifier and TypeMethodDescriptionint
applyAsInt
(T value) static <T> ToIntFunction<T>
cast()
Assumes the object value is directly castable to an int.static <T,
R> ToIntFunction<T> map
(Function<? super T, ? extends R> f, ToIntFunction<? super R> g) Creates the function compositiong ∘ f
.default IntType
This function's return type.default <R> R
walk
(ToPrimitiveFunction.Visitor<T, R> visitor) Methods inherited from interface io.deephaven.function.ToPrimitiveFunction
walk
-
Method Details
-
cast
Assumes the object value is directly castable to an int. Equivalent tox -> (int)x
.- Type Parameters:
T
- the value type- Returns:
- the int function
-
map
Creates the function compositiong ∘ f
.Equivalent to
x -> g.applyAsInt(f.apply(x))
.- Type Parameters:
T
- the input typeR
- the intermediate type- Parameters:
f
- the inner functiong
- the outer function- Returns:
- the int function
-
applyAsInt
- Specified by:
applyAsInt
in interfaceToIntFunction<T>
-
returnType
Description copied from interface:TypedFunction
This function's return type.- Specified by:
returnType
in interfaceToPrimitiveFunction<T>
- Specified by:
returnType
in interfaceTypedFunction<T>
- Returns:
- the type
-
walk
- Specified by:
walk
in interfaceToPrimitiveFunction<T>
-