Package zone.lamprey.function
Interface IntFunction<R>
- Type Parameters:
R- the type of the result of the function
- All Superinterfaces:
Function<Integer,R>,Function<Integer,R>,IntFunction<R>
- All Known Subinterfaces:
IntPredicate,IntToDoubleFunction,IntToLongFunction,IntUnaryOperator
- 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 IntFunction<R> extends Function<Integer,R>, IntFunction<R>
Represents a function that accepts an int-valued argument and produces a
result. This is the
int-consuming primitive specialization for
Function.
This is a functional interface whose
functional method is apply(int).
- Since:
- 1.8
- See Also:
Function
-
Field Summary
Fields Modifier and Type Field Description static IntFunction<String>TO_STRINGFunctional interface toString.valueOf(int) -
Method Summary
Modifier and Type Method Description Rapply(int value)Applies this function to the given argument.default Rapply(Integer t)Applies this function to the given argument.default Supplier<R>applyPartial(int t)Partially apply a parameter such that a single param function becomes a no-param supplier.default IntConsumerconsume(Consumer<R> consumer)Consume a function.static DoubleUnaryOperatoridentity()Returns a unary operator that always returns its input argument.default <S> IntFunction<S>map(Function<? super R,? extends S> functor)Lift a function.default IntToDoubleFunctionmapToDouble(ToDoubleFunction<? super R> functor)Lift a function.default IntUnaryOperatormapToInt(ToIntFunction<? super R> functor)Lift a function.default IntToLongFunctionmapToLong(ToLongFunction<? super R> functor)Lift a function.default IntPredicatemapToPredicate(Predicate<? super R> functor)Lift a function.
-
Field Details
-
TO_STRING
Functional interface toString.valueOf(int)
-
-
Method Details
-
apply
Applies this function to the given argument.- Specified by:
applyin interfaceIntFunction<R>- Parameters:
value- the function argument- Returns:
- the function result
-
apply
Applies this function to the given argument. -
applyPartial
Partially apply a parameter such that a single param function becomes a no-param supplier.- Parameters:
t- The parameter to apply.- Returns:
- A partially-applied function.
-
consume
Consume a function. -
mapToPredicate
Lift a function.- Specified by:
mapToPredicatein interfaceFunction<Integer,R>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
map
Lift a function. -
mapToDouble
Lift a function.- Specified by:
mapToDoublein interfaceFunction<Integer,R>- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToInt
Lift a function. -
mapToLong
Lift a function. -
identity
Returns a unary operator that always returns its input argument.- Returns:
- a unary operator that always returns its input argument
-