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.bi.obj.ObjCharToLongFunction.java

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

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

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

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

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

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToLongFunction.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 w  w. j  a v  a 2 s  .com*/
@Nonnull
default <S> ObjBooleanFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.apply(applyAsLong(t, value));
}

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

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

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToLongFunction.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.
 *///  ww w  .j  ava  2  s .  co  m
@Nonnull
default <S> ObjDoubleFunction<T, S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.apply(applyAsLong(t, value));
}

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

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

From source file:at.gridtec.lambda4j.function.tri.conversion.TriByteToLongFunction.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.
 */// w ww  .j  a v  a  2s.  co m
@Nonnull
default <S> TriByteFunction<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.TriCharToLongFunction.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.
 *//*from w  w w  . j a v  a 2s .  c o m*/
@Nonnull
default <S> TriCharFunction<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.TriFloatToLongFunction.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.
 *///  www .  j av  a  2s  . c  o  m
@Nonnull
default <S> TriFloatFunction<S> andThen(@Nonnull final LongFunction<? extends S> after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.apply(applyAsLong(value1, value2, value3));
}