Interface DoubleStreamEx.DoubleEmitter

    • Method Detail

      • next

        DoubleStreamEx.DoubleEmitter next​(DoubleConsumer action)
        Calls the supplied consumer zero or more times to emit some elements, then returns the next emitter which will emit more, or null if nothing more to emit.

        Normally one element is emitted during the next() method call. However, it's not restricted: you may emit as many elements as you want, though in some cases if many elements were emitted they might be buffered consuming additional memory.

        It's allowed not to emit anything (don't call the consumer). However if you do this and return new emitter which also does not emit anything, you will end up in endless loop.

        Parameters:
        action - consumer to be called to emit elements
        Returns:
        next emitter or null
      • spliterator

        default Spliterator.OfDouble spliterator()
        Returns the spliterator which covers all the elements emitted by this emitter.
        Returns:
        the new spliterator
      • stream

        default DoubleStreamEx stream()
        Returns the stream which covers all the elements emitted by this emitter.
        Returns:
        the new stream