java.lang.Object
org.bsc.async.AsyncGenerator.Base<E>
org.bsc.async.AsyncGenerator.BaseCancellable<E>
- All Implemented Interfaces:
Iterable<E>,AsyncGenerator<E>,AsyncGenerator.Cancellable<E>,AsyncGenerator.IsCancellable
- Direct Known Subclasses:
AsyncGenerator.WithEmbed,AsyncGenerator.WithResult,AsyncGeneratorQueue.Generator
- Enclosing interface:
- AsyncGenerator<E>
public abstract static class AsyncGenerator.BaseCancellable<E>
extends AsyncGenerator.Base<E>
implements AsyncGenerator.Cancellable<E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bsc.async.AsyncGenerator
AsyncGenerator.Base<E>, AsyncGenerator.BaseCancellable<E>, AsyncGenerator.Cancellable<E>, AsyncGenerator.Data<E>, AsyncGenerator.Embed<E>, AsyncGenerator.EmbedCompletionHandler, AsyncGenerator.HasResultValue, AsyncGenerator.IsCancellable, AsyncGenerator.WithEmbed<E>, AsyncGenerator.WithResult<E> -
Field Summary
Fields inherited from interface org.bsc.async.AsyncGenerator.IsCancellable
CANCELLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) method that request to cancel generatorbooleanChecks if the asynchronous generation has been cancelled.Methods inherited from class org.bsc.async.AsyncGenerator.Base
executorMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bsc.async.AsyncGenerator
executor, flatMap, forEachAsync, iterator, map, next, reduce, reduceAsync, stream, toCompletableFutureMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BaseCancellable
public BaseCancellable()
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:AsyncGenerator.IsCancellableChecks if the asynchronous generation has been cancelled.The default implementation always returns
false. Implementations that support cancellation should override this method.- Specified by:
isCancelledin interfaceAsyncGenerator.IsCancellable- Returns:
trueif the generator has been cancelled,falseotherwise.
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Description copied from interface:AsyncGenerator.IsCancellablemethod that request to cancel generator- Specified by:
cancelin interfaceAsyncGenerator.IsCancellable
-