Example usage for java.util.function LongToDoubleFunction applyAsDouble

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

Introduction

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

Prototype

double applyAsDouble(long value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:at.gridtec.lambda4j.function.bi.to.ToLongBiFunction2.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}./*  w  w w . j av a  2s  .co m*/
 */
@Nonnull
default ToDoubleBiFunction2<T, U> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, u) -> after.applyAsDouble(applyAsLong(t, u));
}

From source file:at.gridtec.lambda4j.function.tri.to.ToLongTriFunction.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  w ww.  j  av  a  2s.  com*/
 */
@Nonnull
default ToDoubleTriFunction<T, U, V> andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (t, u, v) -> after.applyAsDouble(applyAsLong(t, u, v));
}

From source file:at.gridtec.lambda4j.function.bi.BiDoubleFunction.java

/**
 * Returns a composed {@link BiLongFunction} 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 long} 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 BiLongFunction} that first applies the {@code before} functions to its input, and then
 * applies this function to the result./* w ww  . j a  va  2  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
 * long}.
 */
@Nonnull
default BiLongFunction<R> composeFromLong(@Nonnull final LongToDoubleFunction before1,
        @Nonnull final LongToDoubleFunction 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 BiLongFunction} 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 long} 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 BiLongFunction} that first applies the {@code before} functions to its input, and then
 * applies this function to the result.// w  w  w.  ja  va  2  s .  c  om
 * @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
 * long}.
 */
@Nonnull
default BiLongFunction<R> composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction 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.BiBooleanToLongFunction.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 ww.j  a  v  a 2s.c o  m
 */
@Nonnull
default BiBooleanToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiByteToLongFunction.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}./*ww w.  ja  v a2  s  .c  om*/
 */
@Nonnull
default BiByteToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiCharToLongFunction.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}.//from  www  . j  ava 2 s.c o  m
 */
@Nonnull
default BiCharToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiFloatToLongFunction.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}./* ww  w  . j a  va 2s  . c  o m*/
 */
@Nonnull
default BiFloatToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiShortToLongFunction.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   w ww  .j a  va2 s.c  o  m
 */
@Nonnull
default BiShortToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiIntToLongFunction.java

/**
 * Returns a composed {@link BiIntToDoubleFunction} 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 BiIntToDoubleFunction} 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 .c  o m
 */
@Nonnull
default BiIntToDoubleFunction andThenToDouble(@Nonnull final LongToDoubleFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsDouble(applyAsLong(value1, value2));
}