List of usage examples for java.util.function IntToDoubleFunction applyAsDouble
double applyAsDouble(int value);
From source file:at.gridtec.lambda4j.function.bi.to.ToIntBiFunction2.java
/** * Returns a composed {@link ToDoubleBiFunction2} 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 ToDoubleBiFunction2} 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. co m*/ */ @Nonnull default ToDoubleBiFunction2<T, U> andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (t, u) -> after.applyAsDouble(applyAsInt(t, u)); }
From source file:at.gridtec.lambda4j.function.tri.to.ToIntTriFunction.java
/** * Returns a composed {@link ToDoubleTriFunction} 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 ToDoubleTriFunction} 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 www . j a v a 2 s .c o m */ @Nonnull default ToDoubleTriFunction<T, U, V> andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (t, u, v) -> after.applyAsDouble(applyAsInt(t, u, v)); }
From source file:at.gridtec.lambda4j.function.bi.BiDoubleFunction.java
/** * Returns a composed {@link BiIntFunction} 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 int} 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 BiIntFunction} that first applies the {@code before} functions to its input, and then * applies this function to the result./*from w w w .java2 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 * int}. */ @Nonnull default BiIntFunction<R> composeFromInt(@Nonnull final IntToDoubleFunction before1, @Nonnull final IntToDoubleFunction before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> apply(before1.applyAsDouble(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleFunction.java
/** * Returns a composed {@link BiIntFunction} 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 int} 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 BiIntFunction} that first applies the {@code before} functions to its input, and then * applies this function to the result./*from ww w. j a v a2s. com*/ * @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 * int}. */ @Nonnull default BiIntFunction<R> composeFromInt(@Nonnull final IntFunction<? extends T> before1, @Nonnull final IntToDoubleFunction before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> apply(before1.apply(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToIntFunction.java
/** * Returns a composed {@link BiBooleanToDoubleFunction} 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 BiBooleanToDoubleFunction} 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 om*/ */ @Nonnull default BiBooleanToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiByteToIntFunction.java
/** * Returns a composed {@link BiByteToDoubleFunction} 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 BiByteToDoubleFunction} 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. ja v a2s.com */ @Nonnull default BiByteToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiCharToIntFunction.java
/** * Returns a composed {@link BiCharToDoubleFunction} 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 BiCharToDoubleFunction} 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 . jav a 2s . c o m */ @Nonnull default BiCharToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiFloatToIntFunction.java
/** * Returns a composed {@link BiFloatToDoubleFunction} 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 BiFloatToDoubleFunction} 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 a va 2 s .c o m*/ */ @Nonnull default BiFloatToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiShortToIntFunction.java
/** * Returns a composed {@link BiShortToDoubleFunction} 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 BiShortToDoubleFunction} 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 a va2s .c o m*/ */ @Nonnull default BiShortToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiLongToIntFunction.java
/** * Returns a composed {@link BiLongToDoubleFunction} 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 BiLongToDoubleFunction} 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 ava 2 s . c o m*/ */ @Nonnull default BiLongToDoubleFunction andThenToDouble(@Nonnull final IntToDoubleFunction after) { Objects.requireNonNull(after); return (value1, value2) -> after.applyAsDouble(applyAsInt(value1, value2)); }