Example usage for java.util.function DoubleUnaryOperator applyAsDouble

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

Introduction

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

Prototype

double applyAsDouble(double operand);

Source Link

Document

Applies this operator to the given operand.

Usage

From source file:at.gridtec.lambda4j.operator.ternary.DoubleTernaryOperator.java

/**
 * Returns a composed {@link DoubleTernaryOperator} that first applies this operator 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 operator to an operation returning {@code double}.
 *
 * @param after The operator to apply after this operator is applied
 * @return A composed {@code DoubleTernaryOperator} that first applies this operator 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. j a va  2s.  c  o  m
 */
@Nonnull
default DoubleTernaryOperator andThenToDouble(@Nonnull final DoubleUnaryOperator after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.applyAsDouble(applyAsDouble(value1, value2, value3));
}

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

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

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

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

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

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

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

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

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

/**
 * Returns a composed {@link ObjBiFloatToDoubleFunction} 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 ObjBiFloatToDoubleFunction} 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 . ja  va 2 s .com
 */
@Nonnull
default ObjBiFloatToDoubleFunction<T> andThenToDouble(@Nonnull final DoubleUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsDouble(t, value1, value2));
}

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

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

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

/**
 * Returns a composed {@link ObjBiIntToDoubleFunction} 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 ObjBiIntToDoubleFunction} 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 . co  m
 */
@Nonnull
default ObjBiIntToDoubleFunction<T> andThenToDouble(@Nonnull final DoubleUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value1, value2) -> after.applyAsDouble(applyAsDouble(t, value1, value2));
}

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

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

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