Package org.bsc.async
Class AsyncGenerator.WithEmbed<E>
- java.lang.Object
-
- org.bsc.async.AsyncGenerator.WithEmbed<E>
-
- Type Parameters:
E
- the type of elements in the generator
- All Implemented Interfaces:
Iterable<E>
,AsyncGenerator<E>
,AsyncGeneratorOperators<E>
- Enclosing interface:
- AsyncGenerator<E>
public static class AsyncGenerator.WithEmbed<E> extends Object implements AsyncGenerator<E>
An asynchronous generator decorator that allows to generators composition embedding other generators.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bsc.async.AsyncGenerator
AsyncGenerator.Data<E>, AsyncGenerator.Embed<E>, AsyncGenerator.EmbedCompletionHandler, AsyncGenerator.WithEmbed<E>, AsyncGenerator.WithResult<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected Deque<AsyncGenerator.Embed<E>>
generatorsStack
-
Constructor Summary
Constructors Constructor Description WithEmbed(AsyncGenerator<E> delegate)
WithEmbed(AsyncGenerator<E> delegate, AsyncGenerator.EmbedCompletionHandler onGeneratorDoneWithResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
isLastGenerator()
AsyncGenerator.Data<E>
next()
Retrieves the next asynchronous element.Deque<AsyncGenerator.Data<E>>
resultValues()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bsc.async.AsyncGenerator
async, collectAsync, collectAsync, iterator, stream, toCompletableFuture
-
Methods inherited from interface org.bsc.async.AsyncGeneratorOperators
collectAsync, executor, filter, flatMap, forEachAsync, map
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
generatorsStack
protected final Deque<AsyncGenerator.Embed<E>> generatorsStack
-
-
Constructor Detail
-
WithEmbed
public WithEmbed(AsyncGenerator<E> delegate, AsyncGenerator.EmbedCompletionHandler onGeneratorDoneWithResult)
-
WithEmbed
public WithEmbed(AsyncGenerator<E> delegate)
-
-
Method Detail
-
resultValues
public Deque<AsyncGenerator.Data<E>> resultValues()
-
isLastGenerator
protected boolean isLastGenerator()
-
next
public AsyncGenerator.Data<E> next()
Description copied from interface:AsyncGenerator
Retrieves the next asynchronous element.- Specified by:
next
in interfaceAsyncGenerator<E>
- Specified by:
next
in interfaceAsyncGeneratorOperators<E>
- Returns:
- the next element from the generator
-
-