Example usage for java.util.function LongFunction apply

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

Introduction

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

Prototype

R apply(long value);

Source Link

Document

Applies this function to the given argument.

Usage

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

/**
 * Returns a composed {@link TriIntFunction} 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 TriIntFunction} 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 .j av  a  2s.  c  om
@Nonnull
default <S> TriIntFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriShortToLongFunction.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.
 *///from  w w  w .ja  va 2s  .  com
@Nonnull
default <S> TriShortFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriBooleanToLongFunction.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.
 *///from   www . java2  s  .com
@Nonnull
default <S> TriBooleanFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}

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

/**
 * Returns a composed {@link TriDoubleFunction} 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 TriDoubleFunction} 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  v a2  s  .com*/
@Nonnull
default <S> TriDoubleFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.operator.ternary.LongTernaryOperator.java

/**
 * Returns a composed {@link TriLongFunction} 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 TriLongFunction} 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.
 *///w  w w .  j av  a 2  s. com
@Nonnull
default <S> TriLongFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiLongToLongFunction.java

/**
 * Returns a composed {@link ObjBiLongFunction} 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 ObjBiLongFunction} 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 av  a2  s  .  co  m*/
@Nonnull
default <S> ObjBiLongFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.apply(applyAsLong(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiIntToLongFunction.java

/**
 * Returns a composed {@link ObjBiIntFunction} 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 ObjBiIntFunction} 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  om
@Nonnull
default <S> ObjBiIntFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.apply(applyAsLong(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiByteToLongFunction.java

/**
 * Returns a composed {@link ObjBiByteFunction} 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 ObjBiByteFunction} 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  . j  a  v a 2s .  co  m
@Nonnull
default <S> ObjBiByteFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.apply(applyAsLong(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiCharToLongFunction.java

/**
 * Returns a composed {@link ObjBiCharFunction} 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 ObjBiCharFunction} 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  www . j a v a2s  .c om
@Nonnull
default <S> ObjBiCharFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.apply(applyAsLong(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiFloatToLongFunction.java

/**
 * Returns a composed {@link ObjBiFloatFunction} 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 ObjBiFloatFunction} 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.
 *///ww  w.  j  a v a2 s . c  o  m
@Nonnull
default <S> ObjBiFloatFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.apply(applyAsLong(t, value1, value2));
}