Example usage for java.util.function IntFunction apply

List of usage examples for java.util.function IntFunction apply

Introduction

In this page you can find the example usage for java.util.function IntFunction apply.

Prototype

R apply(int value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToIntFunction.java

/**
 * Returns a composed {@link ObjBooleanFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjBooleanFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *//*from w ww  . j ava 2 s. c  o m*/
@Nonnull
default <S> ObjBooleanFunction<T, S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.apply(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToIntFunction.java

/**
 * Returns a composed {@link ObjLongFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjLongFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *///from   w w w  .  ja va  2s . c o m
@Nonnull
default <S> ObjLongFunction<T, S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.apply(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToIntFunction.java

/**
 * Returns a composed {@link ObjDoubleFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjDoubleFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *//* w  w w . j  a va2s .co m*/
@Nonnull
default <S> ObjDoubleFunction<T, S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.apply(applyAsInt(t, value));
}

From source file:at.gridtec.lambda4j.operator.binary.IntBinaryOperator2.java

/**
 * Returns a composed {@link BiIntFunction} that first applies this operator to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this operator is applied
 * @return A composed {@code BiIntFunction} that first applies this operator to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *///from w  ww. j ava2 s  .com
@Nonnull
default <S> BiIntFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.apply(applyAsInt(value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriByteToIntFunction.java

/**
 * Returns a composed {@link TriByteFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriByteFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *///from  w  ww  .  j  ava  2 s  . com
@Nonnull
default <S> TriByteFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriCharToIntFunction.java

/**
 * Returns a composed {@link TriCharFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriCharFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 */// www.j  a va  2 s  . co m
@Nonnull
default <S> TriCharFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriFloatToIntFunction.java

/**
 * Returns a composed {@link TriFloatFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriFloatFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *//*from w ww . j  a  v  a 2 s  .  c  o  m*/
@Nonnull
default <S> TriFloatFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriLongToIntFunction.java

/**
 * Returns a composed {@link TriLongFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriLongFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *///from  w  ww.  j a va 2  s  .  c o m
@Nonnull
default <S> TriLongFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriShortToIntFunction.java

/**
 * Returns a composed {@link TriShortFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriShortFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 */// w w  w  .j  a v  a  2  s  .c o  m
@Nonnull
default <S> TriShortFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriBooleanToIntFunction.java

/**
 * Returns a composed {@link TriBooleanFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation.
 *
 * @param <S> The type of return value from the {@code after} function, and of the composed function
 * @param after The function to apply after this function is applied
 * @return A composed {@code TriBooleanFunction} that first applies this function to its input, and then applies the
 * {@code after} function to the result.
 * @throws NullPointerException If given argument is {@code null}
 * @implSpec The input argument of this method is able to return every type.
 *//*w ww  .  j a v  a  2  s  . co m*/
@Nonnull
default <S> TriBooleanFunction<S> andThen(@Nonnull final IntFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsInt(value1, value2, value3));
}