T - type of elementspublic static class AsyncCollection.Keep<T> extends Object implements AsyncCollection<T>
AsyncCollection.Aggregator<T>, AsyncCollection.Keep<T>, AsyncCollection.Listen<T>, AsyncCollection.OneByOne<T>| Constructor and Description |
|---|
Keep() |
| 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.
|
List<T> |
getCurrentElements()
Return the list containing the elements kept so far.
|
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 |
ondone(Runnable listener)
Add a listener to be called when the done method is called.
|
void |
onerror(Consumer<Exception> listener)
Add a listener to be called when the error method is called.
|
void |
provideTo(AsyncCollection<T> col)
Send the elements of this collection to the given collection.
|
public void newElements(Collection<T> elements)
AsyncCollectionnewElements in interface AsyncCollection<T>public void done()
AsyncCollectiondone in interface AsyncCollection<T>public boolean isDone()
AsyncCollectionisDone in interface AsyncCollection<T>public void ondone(Runnable listener)
public void error(Exception error)
AsyncCollectionerror in interface AsyncCollection<T>public boolean hasError()
AsyncCollectionhasError in interface AsyncCollection<T>public void onerror(Consumer<Exception> listener)
public void provideTo(AsyncCollection<T> col)
Copyright © 2019. All rights reserved.