Example usage for java.util.function DoubleConsumer accept

List of usage examples for java.util.function DoubleConsumer accept

Introduction

In this page you can find the example usage for java.util.function DoubleConsumer accept.

Prototype

void accept(double value);

Source Link

Document

Performs this operation on the given argument.

Usage

From source file:at.gridtec.lambda4j.function.tri.conversion.TriShortToDoubleFunction.java

/**
 * Returns a composed {@link TriShortConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code TriShortConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 */// www.  j  a  va  2 s  .  co m
@Nonnull
default TriShortConsumer consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2, value3) -> consumer.accept(applyAsDouble(value1, value2, value3));
}

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

/**
 * Returns a composed {@link TriDoubleConsumer} that fist applies this operator to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code TriDoubleConsumer} that first applies this operator to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///from ww w.j  a v  a2s.  c  om
@Nonnull
default TriDoubleConsumer consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2, value3) -> consumer.accept(applyAsDouble(value1, value2, value3));
}

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

/**
 * Returns a composed {@link ObjBiBooleanConsumer} that fist applies this function to its input, and then consumes
 * the result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiBooleanConsumer} that first applies this function to its input, and then consumes
 * the result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from w w  w  .j a  v  a2s  .  c om*/
@Nonnull
default ObjBiBooleanConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiByteConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiByteConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 */// w  ww .j  a va2 s.co  m
@Nonnull
default ObjBiByteConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiCharConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiCharConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*w  w w  .  j a v  a 2  s. c o  m*/
@Nonnull
default ObjBiCharConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiDoubleConsumer} that fist applies this function to its input, and then consumes
 * the result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiDoubleConsumer} that first applies this function to its input, and then consumes
 * the result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//* www  .java  2 s  .  c om*/
@Nonnull
default ObjBiDoubleConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiFloatConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiFloatConsumer} that first applies this function to its input, and then consumes
 * the result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from   w w w .j a  va2  s . com*/
@Nonnull
default ObjBiFloatConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiShortConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiShortConsumer} that first applies this function to its input, and then consumes
 * the result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///www .  jav a 2  s . c  o  m
@Nonnull
default ObjBiShortConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiIntConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiIntConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from  ww  w  .j a  va 2s.com*/
@Nonnull
default ObjBiIntConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}

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

/**
 * Returns a composed {@link ObjBiLongConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link DoubleConsumer}. If evaluation of either operation throws an exception, it is
 * relayed to the caller of the composed operation.
 *
 * @param consumer The operation which consumes the result from this operation
 * @return A composed {@code ObjBiLongConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code DoubleConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//* w  w  w .j  a  va  2 s  .c o  m*/
@Nonnull
default ObjBiLongConsumer<T> consume(@Nonnull final DoubleConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value1, value2) -> consumer.accept(applyAsDouble(t, value1, value2));
}