Class ServiceRankingDelegationResultListener<S>

  • All Implemented Interfaces:
    jadex.commons.future.IFutureCommandResultListener<java.util.Collection<S>>, jadex.commons.future.IIntermediateResultListener<S>, jadex.commons.future.IResultListener<java.util.Collection<S>>, jadex.commons.future.IUndoneIntermediateResultListener<S>, jadex.commons.future.IUndoneResultListener<java.util.Collection<S>>
    Direct Known Subclasses:
    ServiceRankingDelegationResultListener2

    public class ServiceRankingDelegationResultListener<S>
    extends jadex.commons.future.IntermediateDelegationResultListener<S>
    Listener that ranks results.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IRankingSearchTerminationDecider<S> decider
      The termination decider.
      protected java.lang.Boolean finished
      The listener state (false=unfinished, null=finishing, true=finished.
      protected IServiceRanker<S> ranker
      The ranker.
      protected java.util.List<S> results
      The saved results.
      • Fields inherited from class jadex.commons.future.IntermediateDelegationResultListener

        delegate, future, undone
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void customIntermediateResultAvailable​(S result)
      Process intermediate results for ranking.
      void customResultAvailable​(java.util.Collection<S> result)
      Called when result is available.
      void exceptionOccurred​(java.lang.Exception exception)
      Called when exception occurs.
      void finished()  
      boolean isFinished()
      Get the finished.
      boolean isFinishing()
      Get the finished.
      protected void notifyException​(java.lang.Exception exception)  
      protected void notifyResults​(java.util.List<jadex.commons.Tuple2<S,​java.lang.Double>> results)  
      protected void rankResults()
      Rank the results and announce them
      • Methods inherited from class jadex.commons.future.IntermediateDelegationResultListener

        commandAvailable, exceptionOccurredIfUndone, finishedIfUndone, handleException, intermediateResultAvailable, intermediateResultAvailableIfUndone, maxResultCountAvailable, resultAvailable, resultAvailableIfUndone
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • results

        protected java.util.List<S> results
        The saved results.
      • finished

        protected java.lang.Boolean finished
        The listener state (false=unfinished, null=finishing, true=finished.
    • Constructor Detail

      • ServiceRankingDelegationResultListener

        public ServiceRankingDelegationResultListener​(jadex.commons.future.TerminableIntermediateDelegationFuture<S> future,
                                                      jadex.commons.future.ITerminableIntermediateFuture<S> src,
                                                      IServiceRanker<S> ranker,
                                                      IRankingSearchTerminationDecider<S> decider)
        Create a new ranker.
    • Method Detail

      • customIntermediateResultAvailable

        public void customIntermediateResultAvailable​(S result)
        Process intermediate results for ranking.
        Overrides:
        customIntermediateResultAvailable in class jadex.commons.future.IntermediateDelegationResultListener<S>
      • customResultAvailable

        public void customResultAvailable​(java.util.Collection<S> result)
        Called when result is available.
        Overrides:
        customResultAvailable in class jadex.commons.future.IntermediateDelegationResultListener<S>
      • exceptionOccurred

        public void exceptionOccurred​(java.lang.Exception exception)
        Called when exception occurs.
        Specified by:
        exceptionOccurred in interface jadex.commons.future.IResultListener<S>
        Overrides:
        exceptionOccurred in class jadex.commons.future.IntermediateDelegationResultListener<S>
      • finished

        public void finished()
        Specified by:
        finished in interface jadex.commons.future.IIntermediateResultListener<S>
        Overrides:
        finished in class jadex.commons.future.IntermediateDelegationResultListener<S>
      • isFinished

        public boolean isFinished()
        Get the finished.
        Returns:
        The finished.
      • isFinishing

        public boolean isFinishing()
        Get the finished.
        Returns:
        The finished.
      • rankResults

        protected void rankResults()
        Rank the results and announce them
      • notifyResults

        protected void notifyResults​(java.util.List<jadex.commons.Tuple2<S,​java.lang.Double>> results)
      • notifyException

        protected void notifyException​(java.lang.Exception exception)