Interface IODoubleConsumer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IODoubleConsumer
    Represents an operation that accepts a single double-valued argument and returns no result. This is the primitive type specialization of Consumer for double. Unlike most other functional interfaces, DoubleConsumer is expected to operate via side-effects.

    This interface is similar to DoubleConsumer except that it is allowed to throw an IOException.

    Author:
    Magno N A Cruz
    See Also:
    IOConsumer
    • Method Detail

      • accept

        void accept​(double value)
             throws java.io.IOException

        This method is the same as DoubleConsumer.accept(double), but with a support for IOException.

        Parameters:
        value - The input argument.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.
      • andThen

        default IODoubleConsumer andThen​(@Nonnull
                                         IODoubleConsumer after)
                                  throws java.io.IOException

        This method is the same as DoubleConsumer.andThen(DoubleConsumer), but with a support for IOException.

        Parameters:
        after - The operation to perform after this operation.
        Returns:
        A composed DoubleConsumer that performs in sequence this operation followed by the after operation.
        Throws:
        java.io.IOException - if there is an I/O error performing the operation.