Example usage for java.util.function IntToDoubleFunction applyAsDouble

List of usage examples for java.util.function IntToDoubleFunction applyAsDouble

Introduction

In this page you can find the example usage for java.util.function IntToDoubleFunction applyAsDouble.

Prototype

double applyAsDouble(int value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiByteToIntFunction.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}.//from   ww w . j  a  v a 2s  . com
 */
@Nonnull
default ObjBiByteToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiCharToIntFunction.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}./*from  w w  w. j a  v  a 2  s. co  m*/
 */
@Nonnull
default ObjBiCharToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiLongToDoubleFunction} 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 ObjBiLongToDoubleFunction} 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  a2  s .c  o m
 */
@Nonnull
default ObjBiLongToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiFloatToIntFunction.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. j  av  a 2  s  . c  o  m*/
 */
@Nonnull
default ObjBiFloatToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiShortToIntFunction.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}./*from  w  ww.  j a  va2 s .  c om*/
 */
@Nonnull
default ObjBiShortToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiBooleanToIntFunction.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   w  ww  . j  a v  a2s  .  c  o m*/
 */
@Nonnull
default ObjBiBooleanToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiDoubleToIntFunction.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}.//from   w  w  w .  ja v a 2s.com
 */
@Nonnull
default ObjBiDoubleToDoubleFunction<T> andThenToDouble(@Nonnull final IntToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsInt(t, value1, value2));
}

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

/**
 * Returns a composed {@link BiIntToByteFunction} 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 BiIntToByteFunction} 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
 * int}./*  w w  w. j ava 2 s.c  om*/
 */
@Nonnull
default BiIntToByteFunction composeFromInt(@Nonnull final IntFunction<? extends T> before1,
        @Nonnull final IntToDoubleFunction 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 BiIntToCharFunction} 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 BiIntToCharFunction} 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
 * int}./* www.  ja v a 2s  . c om*/
 */
@Nonnull
default BiIntToCharFunction composeFromInt(@Nonnull final IntFunction<? extends T> before1,
        @Nonnull final IntToDoubleFunction 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 BiIntToFloatFunction} 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 BiIntToFloatFunction} 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
 * int}.//from   ww w .  j  a  va  2s  . c  om
 */
@Nonnull
default BiIntToFloatFunction composeFromInt(@Nonnull final IntFunction<? extends T> before1,
        @Nonnull final IntToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsDouble(value2));
}