public class IntermediateFuture<E> extends Future<Collection<E>> implements IIntermediateFuture<E>
IForwardCommandFuture.TypeDEBUG, EMPTY, NO_STACK_COMPACTION, STACKDONE| Constructor and Description |
|---|
IntermediateFuture()
Create a future that is already done.
|
IntermediateFuture(Collection<E> results)
Create a future that is already done.
|
IntermediateFuture(Exception exception)
Create a future that is already done (failed).
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIntermediateResult(E result)
Add an intermediate result.
|
boolean |
addIntermediateResultIfUndone(E result)
Set the result.
|
void |
addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener)
Add a functional result listener, which called on intermediate results.
|
void |
addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener,
IFunctionalResultListener<Void> finishedListener)
Add a functional result listener, which called on intermediate results.
|
void |
addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener,
IFunctionalResultListener<Void> finishedListener,
IFunctionalExceptionListener exceptionListener)
Add a functional result listener, which called on intermediate results.
|
void |
addIntermediateResultListener(IIntermediateResultListener<E> intermediateListener)
Add an result listener, which called on intermediate results.
|
void |
addResultListener(IResultListener<Collection<E>> listener)
Add a result listener.
|
Collection<E> |
getIntermediateResults()
Get the intermediate results that are available.
|
E |
getNextIntermediateResult()
Iterate over the intermediate results in a blocking fashion.
|
E |
getNextIntermediateResult(ISuspendable sus)
Iterate over the intermediate results in a blocking fashion.
|
boolean |
hasNextIntermediateResult()
Check if there are more results for iteration for the given caller.
|
void |
setFinished()
Declare that the future is finished.
|
boolean |
setFinishedIfUndone()
Declare that the future is finished.
|
void |
setResult(Collection<E> result)
Set the result.
|
boolean |
setResultIfUndone(Collection<E> result)
Set the result.
|
abortGet, addForwardCommand, addResultListener, addResultListener, get, get, get, get, getEmptyFuture, getException, isDone, removeForwardCommand, sendForwardCommand, setException, setExceptionIfUndoneequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddResultListener, addResultListener, get, get, get, get, getException, isDonepublic IntermediateFuture()
result - The result, if any.public IntermediateFuture(Collection<E> results)
result - The result, if any.public IntermediateFuture(Exception exception)
exception - The exception.public Collection<E> getIntermediateResults()
getIntermediateResults in interface IIntermediateFuture<E>public void addIntermediateResult(E result)
public boolean addIntermediateResultIfUndone(E result)
result - The result.public void setResult(Collection<E> result)
setResult in class Future<Collection<E>>result - The result.public boolean setResultIfUndone(Collection<E> result)
setResultIfUndone in class Future<Collection<E>>result - The result.public void setFinished()
public boolean setFinishedIfUndone()
public void addResultListener(IResultListener<Collection<E>> listener)
addResultListener in interface IFuture<Collection<E>>addResultListener in class Future<Collection<E>>listsner - The listener.public void addIntermediateResultListener(IIntermediateResultListener<E> intermediateListener)
addIntermediateResultListener in interface IIntermediateFuture<E>intermediateListener - The intermediate listener.public void addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener)
addIntermediateResultListener in interface IIntermediateFuture<E>intermediateListener - The intermediate listener.public void addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener, IFunctionalResultListener<Void> finishedListener)
addIntermediateResultListener in interface IIntermediateFuture<E>intermediateListener - The intermediate listener.finishedListener - The finished listener, called when no more
intermediate results will arrive. If null, the finish
event will be ignored.public void addIntermediateResultListener(IFunctionalResultListener<E> intermediateListener, IFunctionalResultListener<Void> finishedListener, IFunctionalExceptionListener exceptionListener)
addIntermediateResultListener in interface IIntermediateFuture<E>intermediateListener - The intermediate listener.finishedListener - The finished listener, called when no more
intermediate results will arrive. If null, the finish
event will be ignored.exListener - The listener that is called on exceptions. Passing
null enables default exception logging.public boolean hasNextIntermediateResult()
hasNextIntermediateResult in interface IIntermediateFuture<E>public E getNextIntermediateResult()
getNextIntermediateResult in interface IIntermediateFuture<E>NoSuchElementException, - when there are no more intermediate results and the future is finished.public E getNextIntermediateResult(ISuspendable sus)
NoSuchElementException, - when there are no more intermediate results and the future is finished.Copyright © 2015. All Rights Reserved.