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 Details

    • results

      protected Collection<E> results
      The results.
  • Constructor Details

    • CollectingIntermediateResultListener

      public CollectingIntermediateResultListener()
  • Method Details

    • resultAvailable

      public abstract void resultAvailable(Collection<E> result)
      Called when the result is available.
      Specified by:
      resultAvailable in interface IResultListener<E>
      Parameters:
      result - The final result.
    • intermediateResultAvailable

      public void intermediateResultAvailable(E result)
      Called when an intermediate result is available.
      Specified by:
      intermediateResultAvailable in interface IIntermediateResultListener<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 interface IIntermediateResultListener<E>
    • exceptionOccurred

      public abstract void exceptionOccurred(Exception exception)
      Called when an exception occurred.
      Specified by:
      exceptionOccurred in interface IResultListener<E>
      Parameters:
      exception - The exception.