T - type of elementspublic interface AsyncCollection<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
AsyncCollection.Aggregator<T>
Aggregates several AsyncCollection into a single one:
each time new elements come, the newElements method is called into the main collection,
then the done method is called on the main collection only after the done method
has been called nbSubCollection times.
|
static class |
AsyncCollection.Keep<T>
Implementation that keeps the elements in a list.
|
static class |
AsyncCollection.Listen<T>
Simple implementation with a listener on both operations: newElements and done.
|
static interface |
AsyncCollection.OneByOne<T>
AsyncCollection but where elements are expected to come only one by one instead of by bunch.
|
| Modifier and Type | Method and Description |
|---|---|
void |
done()
Called when no more elements will come, and no error was encountered.
|
void |
error(Exception error)
Called if an error occured before all elements have been retrieved.
|
boolean |
hasError()
Return true if the method error has been called.
|
boolean |
isDone()
Return true if the method done has been called already.
|
void |
newElements(Collection<T> elements)
Called when new elements are ready.
|
void newElements(Collection<T> elements)
void done()
boolean isDone()
void error(Exception error)
boolean hasError()
Copyright © 2019. All rights reserved.