List of usage examples for java.util.function DoubleUnaryOperator applyAsDouble
double applyAsDouble(double operand);
From source file:at.gridtec.lambda4j.function.bi.conversion.BiDoubleToLongFunction.java
/** * Returns a composed {@link BiDoubleToLongFunction} that first applies the {@code before} operators 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 double} input, before this primitive function is executed. * * @param before1 The first operator to apply before this function is applied * @param before2 The second operator to apply before this function is applied * @return A composed {@code BiDoubleToLongFunction} that first applies the {@code before} operators 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 * double}.//from ww w . j a v a2 s. c o m */ @Nonnull default BiDoubleToLongFunction composeFromDouble(@Nonnull final DoubleUnaryOperator before1, @Nonnull final DoubleUnaryOperator before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsLong(before1.applyAsDouble(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiDoubleToShortFunction.java
/** * Returns a composed {@link BiDoubleToShortFunction} that first applies the {@code before} operators 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 double} input, before this primitive function is executed. * * @param before1 The first operator to apply before this function is applied * @param before2 The second operator to apply before this function is applied * @return A composed {@code BiDoubleToShortFunction} that first applies the {@code before} operators 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 * double}.//from www . j a v a 2 s.c om */ @Nonnull default BiDoubleToShortFunction composeFromDouble(@Nonnull final DoubleUnaryOperator before1, @Nonnull final DoubleUnaryOperator before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsShort(before1.applyAsDouble(value1), before2.applyAsDouble(value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjByteToDoubleFunction.java
/** * Returns a composed {@link BiObjByteToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjByteToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 . j a va2s . c o m */ @Nonnull default BiObjByteToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjCharToDoubleFunction.java
/** * Returns a composed {@link BiObjCharToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjCharToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 a2 s. c om */ @Nonnull default BiObjCharToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjFloatToDoubleFunction.java
/** * Returns a composed {@link BiObjFloatToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjFloatToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 .ja va 2s .c om */ @Nonnull default BiObjFloatToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjShortToDoubleFunction.java
/** * Returns a composed {@link BiObjShortToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjShortToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 .j a v a 2s . c om*/ */ @Nonnull default BiObjShortToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjDoubleToDoubleFunction.java
/** * Returns a composed {@link BiObjDoubleToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjDoubleToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 a2 s. c om */ @Nonnull default BiObjDoubleToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjIntToDoubleFunction.java
/** * Returns a composed {@link BiObjIntToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjIntToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 av a2 s . c o m*/ */ @Nonnull default BiObjIntToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.obj.BiObjLongToDoubleFunction.java
/** * Returns a composed {@link BiObjLongToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 operator to apply after this function is applied * @return A composed {@code BiObjLongToDoubleFunction} that first applies this function to its input, and then * applies the {@code after} operator 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 BiObjLongToDoubleFunction<T, U> andThenToDouble(@Nonnull final DoubleUnaryOperator after) { Objects.requireNonNull(after); return (t, u, value) -> after.applyAsDouble(applyAsDouble(t, u, value)); }
From source file:at.gridtec.lambda4j.function.tri.TriDoubleFunction.java
/** * Returns a composed {@link TriDoubleFunction} that first applies the {@code before} operators 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 double} input, before this primitive function is executed. * * @param before1 The first operator to apply before this function is applied * @param before2 The second operator to apply before this function is applied * @param before3 The third operator to apply before this function is applied * @return A composed {@code TriDoubleFunction} that first applies the {@code before} operators 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 * double}./*from w w w . j ava 2 s. c o m*/ */ @Nonnull default TriDoubleFunction<R> composeFromDouble(@Nonnull final DoubleUnaryOperator before1, @Nonnull final DoubleUnaryOperator before2, @Nonnull final DoubleUnaryOperator before3) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); Objects.requireNonNull(before3); return (value1, value2, value3) -> apply(before1.applyAsDouble(value1), before2.applyAsDouble(value2), before3.applyAsDouble(value3)); }