Class ServiceRankingResultListener<S>

  • All Implemented Interfaces:
    jadex.commons.future.IIntermediateResultListener<S>, jadex.commons.future.IResultListener<java.util.Collection<S>>

    public class ServiceRankingResultListener<S>
    extends java.lang.Object
    implements jadex.commons.future.IIntermediateResultListener<S>
    Listener that ranks results.
    • Field Detail

      • results

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

        protected boolean finished
        The listener state.
      • listener

        protected jadex.commons.future.IResultListener<java.util.Collection<S>> listener
        The delegate listener.
      • scorelistener

        protected jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,​java.lang.Double>>> scorelistener
        The delegate listener.
    • Constructor Detail

      • ServiceRankingResultListener

        public ServiceRankingResultListener​(jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,​java.lang.Double>>> scorelistener,
                                            IServiceRanker<S> ranker,
                                            IRankingSearchTerminationDecider<S> decider)
        Create a new ranker.
    • Method Detail

      • intermediateResultAvailable

        public void intermediateResultAvailable​(S result)
        Process intermediate results for ranking.
        Specified by:
        intermediateResultAvailable in interface jadex.commons.future.IIntermediateResultListener<S>
      • resultAvailable

        public void resultAvailable​(java.util.Collection<S> result)
        Called when result is available.
        Specified by:
        resultAvailable in interface jadex.commons.future.IResultListener<S>
      • exceptionOccurred

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

        public void finished()
        Specified by:
        finished in interface jadex.commons.future.IIntermediateResultListener<S>
      • maxResultCountAvailable

        public void maxResultCountAvailable​(int max)
        Specified by:
        maxResultCountAvailable in interface jadex.commons.future.IIntermediateResultListener<S>
      • isFinished

        public boolean isFinished()
        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)