List of usage examples for java.util.function LongToDoubleFunction applyAsDouble
double applyAsDouble(long value);
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiIntToLongFunction.java
/** * Returns a composed {@link ObjBiIntToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiIntToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}.//from w ww . ja v a 2s . c o m */ @Nonnull default ObjBiIntToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiByteToLongFunction.java
/** * Returns a composed {@link ObjBiByteToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiByteToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}.//w w w . j ava2s . com */ @Nonnull default ObjBiByteToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiCharToLongFunction.java
/** * Returns a composed {@link ObjBiCharToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiCharToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}.//w w w. j a v a 2 s.c o m */ @Nonnull default ObjBiCharToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiFloatToLongFunction.java
/** * Returns a composed {@link ObjBiFloatToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiFloatToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}./*from w w w . ja v a 2s. c om*/ */ @Nonnull default ObjBiFloatToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiShortToLongFunction.java
/** * Returns a composed {@link ObjBiShortToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiShortToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}.// www . ja v a2s. co m */ @Nonnull default ObjBiShortToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiBooleanToLongFunction.java
/** * Returns a composed {@link ObjBiBooleanToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiBooleanToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}.//from ww w.j av a 2 s .c o m */ @Nonnull default ObjBiBooleanToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiDoubleToLongFunction.java
/** * Returns a composed {@link ObjBiDoubleToDoubleFunction} 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. This method is just convenience, to provide the ability to * transform this primitive function to an operation returning {@code double}. * * @param after The function to apply after this function is applied * @return A composed {@code ObjBiDoubleToDoubleFunction} 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 a able to return primitive values. In this case this is {@code * double}./* w ww . j a v a 2 s . co m*/ */ @Nonnull default ObjBiDoubleToDoubleFunction<T> andThenToDouble(@Nonnull final LongToDoubleFunction after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.applyAsDouble(applyAsLong(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToByteFunction.java
/** * Returns a composed {@link BiLongToByteFunction} that first applies the {@code before} functions to * its input, and then applies this function 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 function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second function to apply before this function is applied * @return A composed {@code BiLongToByteFunction} that first applies the {@code before} functions to its input, and * then applies this function to the result. * @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}./*from w w w. j a v a2 s . com*/ */ @Nonnull default BiLongToByteFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongToDoubleFunction before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsByte(before1.apply(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToCharFunction.java
/** * Returns a composed {@link BiLongToCharFunction} that first applies the {@code before} functions to * its input, and then applies this function 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 function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second function to apply before this function is applied * @return A composed {@code BiLongToCharFunction} that first applies the {@code before} functions to its input, and * then applies this function to the result. * @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}.//from w w w .j a v a 2 s . c om */ @Nonnull default BiLongToCharFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongToDoubleFunction before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsChar(before1.apply(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToFloatFunction.java
/** * Returns a composed {@link BiLongToFloatFunction} that first applies the {@code before} functions to * its input, and then applies this function 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 function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second function to apply before this function is applied * @return A composed {@code BiLongToFloatFunction} that first applies the {@code before} functions to its input, * and then applies this function to the result. * @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}./*from w w w . j av a 2 s.c om*/ */ @Nonnull default BiLongToFloatFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1, @Nonnull final LongToDoubleFunction before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsDouble(value2)); }