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.ObjCharToFloatFunction.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}.//w ww .j  a va 2s  .c om
 */
@Nonnull
default BiDoubleToFloatFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToCharFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsChar(value2));
}

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

/**
 * Returns a composed {@link BiDoubleToLongFunction} 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 BiDoubleToLongFunction} 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  ww.j a va  2s  .c o m
 */
@Nonnull
default BiDoubleToLongFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToCharFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsLong(before1.apply(value1), before2.applyAsChar(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjCharToShortFunction.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}./*from  ww w .java2s .  c  om*/
 */
@Nonnull
default BiDoubleToShortFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToCharFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsChar(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToFloatFunction.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 operator 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 ww w.j  a  v  a 2  s . c  o m*/
 */
@Nonnull
default BiDoubleToFloatFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiDoubleToIntFunction} 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 operator to apply before this function is applied
 * @return A composed {@code BiDoubleToIntFunction} 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 va  2s  .  c om*/
 */
@Nonnull
default BiDoubleToIntFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsInt(before1.apply(value1), before2.applyAsDouble(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToShortFunction.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 operator 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}./*from w w w . ja  va  2  s .  c  om*/
 */
@Nonnull
default BiDoubleToShortFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsDouble(value2));
}

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

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

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

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

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

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

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

/**
 * Returns a composed {@link BiDoubleToLongFunction} 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 BiDoubleToLongFunction} 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 a  v a 2s  .c  o m
 */
@Nonnull
default BiDoubleToLongFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleToIntFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsLong(before1.apply(value1), before2.applyAsInt(value2));
}