List of usage examples for java.util.function LongFunction apply
R apply(long value);
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiShortToLongFunction.java
/** * Returns a composed {@link ObjBiShortFunction} 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 ObjBiShortFunction} 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 v a2 s.c o m*/ @Nonnull default <S> ObjBiShortFunction<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.ObjBiBooleanToLongFunction.java
/** * Returns a composed {@link ObjBiBooleanFunction} 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 ObjBiBooleanFunction} 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 va2s .c o m @Nonnull default <S> ObjBiBooleanFunction<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.ObjBiDoubleToLongFunction.java
/** * Returns a composed {@link ObjBiDoubleFunction} 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 ObjBiDoubleFunction} 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 av a 2s. c o m*/ @Nonnull default <S> ObjBiDoubleFunction<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.consumer.tri.obj.BiObjBooleanConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third predicate to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result.//www .ja va 2s.c o m * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongPredicate before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.test(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjByteConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third function to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result.//from w ww. j a va2 s. c o m * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongToByteFunction before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsByte(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjCharConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third function to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result.// w w w. j a v a 2 s.c o m * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongToCharFunction before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsChar(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjIntConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third function to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result./*from w w w . ja v a 2 s . c om*/ * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongToIntFunction before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsInt(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjLongConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third operator to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result.//from ww w . j ava 2s . co m * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongUnaryOperator before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsLong(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjFloatConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third function to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result./* w w w.j av a2 s . c o m*/ * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongToFloatFunction before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsFloat(value3)); }
From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjShortConsumer.java
/** * Returns a composed {@link TriLongConsumer} that first applies the {@code before} functions to * its input, and then applies this consumer to the result. * If evaluation of either operation throws an exception, it is relayed to the caller of the composed operation. * This method is just convenience, to provide the ability to execute an operation which accepts {@code long} input, * before this primitive consumer is executed. * * @param before1 The first function to apply before this consumer is applied * @param before2 The second function to apply before this consumer is applied * @param before3 The third function to apply before this consumer is applied * @return A composed {@code TriLongConsumer} that first applies the {@code before} functions to its input, and then * applies this consumer to the result.//from w w w.j a v a 2 s. c o m * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * long}. */ @Nonnull default TriLongConsumer composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongFunction<? extends U> before2, @Nonnull final LongToShortFunction before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2), before3.applyAsShort(value3)); }