Example usage for java.util.function IntConsumer accept

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

Introduction

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

Prototype

void accept(int value);

Source Link

Document

Performs this operation on the given argument.

Usage

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

/**
 * Returns a composed {@link BiFloatConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 BiFloatConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from ww w .  ja  v a2 s .  c om*/
@Nonnull
default BiFloatConsumer consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2) -> consumer.accept(applyAsInt(value1, value2));
}

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

/**
 * Returns a composed {@link BiShortConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 BiShortConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///  w  ww. j  a v a 2 s  .  com
@Nonnull
default BiShortConsumer consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2) -> consumer.accept(applyAsInt(value1, value2));
}

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

/**
 * Returns a composed {@link BiLongConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 BiLongConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*  w w  w.  ja v  a  2  s. com*/
@Nonnull
default BiLongConsumer consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2) -> consumer.accept(applyAsInt(value1, value2));
}

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

/**
 * Returns a composed {@link BiDoubleConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 BiDoubleConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//* w ww  . jav  a 2 s  .  com*/
@Nonnull
default BiDoubleConsumer consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (value1, value2) -> consumer.accept(applyAsInt(value1, value2));
}

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

/**
 * Returns a composed {@link ObjIntConsumer2} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjIntConsumer2} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from   w  w  w.ja v  a 2  s  .c om*/
@Nonnull
default ObjIntConsumer2<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}

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

/**
 * Returns a composed {@link ObjByteConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjByteConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *//*from   ww  w  .j a v  a  2  s  .co  m*/
@Nonnull
default ObjByteConsumer<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}

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

/**
 * Returns a composed {@link ObjCharConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjCharConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///from ww w.ja  v  a  2s  .co m
@Nonnull
default ObjCharConsumer<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}

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

/**
 * Returns a composed {@link ObjFloatConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjFloatConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///from www  .  j a v a2s  . c o  m
@Nonnull
default ObjFloatConsumer<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}

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

/**
 * Returns a composed {@link ObjShortConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjShortConsumer} that first applies this function to its input, and then consumes the
 * result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///from   ww w. j a  v a 2 s . c o m
@Nonnull
default ObjShortConsumer<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}

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

/**
 * Returns a composed {@link ObjBooleanConsumer} that fist applies this function to its input, and then consumes the
 * result using the given {@link IntConsumer}. 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 ObjBooleanConsumer} that first applies this function to its input, and then consumes
 * the result using the given {@code IntConsumer}.
 * @throws NullPointerException If given argument is {@code null}
 *///  www . j ava  2s  .  co m
@Nonnull
default ObjBooleanConsumer<T> consume(@Nonnull final IntConsumer consumer) {
    Objects.requireNonNull(consumer);
    return (t, value) -> consumer.accept(applyAsInt(t, value));
}