Package jadex.future
Class CollectingIntermediateResultListener<E>
java.lang.Object
jadex.future.CollectingIntermediateResultListener<E>
- All Implemented Interfaces:
IIntermediateResultListener<E>
,IResultListener<Collection<E>>
public abstract class CollectingIntermediateResultListener<E>
extends Object
implements IIntermediateResultListener<E>
A listener that collects intermediate results and calls resultAvailable() on setFinished().
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
exceptionOccurred
(Exception exception) Called when an exception occurred.void
finished()
Declare that the future is finished.void
intermediateResultAvailable
(E result) Called when an intermediate result is available.abstract void
resultAvailable
(Collection<E> result) Called when the result is available.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jadex.future.IIntermediateResultListener
maxResultCountAvailable
-
Field Details
-
results
The results.
-
-
Constructor Details
-
CollectingIntermediateResultListener
public CollectingIntermediateResultListener()
-
-
Method Details
-
resultAvailable
Called when the result is available.- Specified by:
resultAvailable
in interfaceIResultListener<E>
- Parameters:
result
- The final result.
-
intermediateResultAvailable
Called when an intermediate result is available.- Specified by:
intermediateResultAvailable
in interfaceIIntermediateResultListener<E>
- Parameters:
result
- The result.
-
finished
public void finished()Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.- Specified by:
finished
in interfaceIIntermediateResultListener<E>
-
exceptionOccurred
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIResultListener<E>
- Parameters:
exception
- The exception.
-