Example usage for java.util.function DoubleFunction apply

List of usage examples for java.util.function DoubleFunction apply

Introduction

In this page you can find the example usage for java.util.function DoubleFunction apply.

Prototype

R apply(double value);

Source Link

Document

Applies this function to the given argument.

Usage

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

/**
 * Returns a composed {@link BiDoubleToShortFunction} 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 double} 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 BiDoubleToShortFunction} 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
 * double}.//www .j  a  v a2  s .  c o  m
 */
@Nonnull
default BiDoubleToShortFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToFloatFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsFloat(value2));
}

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

/**
 * Returns a composed {@link BiDoubleToFloatFunction} 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 double} 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 BiDoubleToFloatFunction} 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
 * double}.//from  w  w  w.  j  a  v  a2  s.  c o  m
 */
@Nonnull
default BiDoubleToFloatFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToShortFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsShort(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}.// ww  w  .  ja va2 s.  c  o m
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToByteFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsByte(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}./*w w w.  j  ava 2s . co m*/
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToCharFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsChar(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}.//from w w  w . j  av a  2s  . c om
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToIntFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsInt(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}.// w ww. j  av  a  2  s .c o m
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToFloatFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsFloat(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}.//  w  ww  . ja  va  2s .  co  m
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToLongFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsLong(value2));
}

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

/**
 * Returns a composed {@link DoubleBinaryOperator2} 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 double} 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 DoubleBinaryOperator2} 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
 * double}.//from  ww w  . j av  a2s.c  o m
 */
@Nonnull
default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToShortFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsShort(value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiBooleanFunction.java

/**
 * Returns a composed {@link TriDoubleFunction} 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 double} input, before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second predicate to apply before this function is applied
 * @param before3 The third predicate to apply before this function is applied
 * @return A composed {@code TriDoubleFunction} 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
 * double}./*  w  w w.j  av  a2s .  c om*/
 */
@Nonnull
default TriDoubleFunction<R> composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoublePredicate before2, @Nonnull final DoublePredicate before3) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    Objects.requireNonNull(before3);
    return (value1, value2, value3) -> apply(before1.apply(value1), before2.test(value2), before3.test(value3));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiIntFunction.java

/**
 * Returns a composed {@link TriDoubleFunction} 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 double} 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
 * @param before3 The third function to apply before this function is applied
 * @return A composed {@code TriDoubleFunction} 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
 * double}./*from  w  w  w . j  a  va2 s. co m*/
 */
@Nonnull
default TriDoubleFunction<R> composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToIntFunction before2, @Nonnull final DoubleToIntFunction before3) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    Objects.requireNonNull(before3);
    return (value1, value2, value3) -> apply(before1.apply(value1), before2.applyAsInt(value2),
            before3.applyAsInt(value3));
}