Class ServiceRankingResultListener<S>
- java.lang.Object
- 
- jadex.bridge.nonfunctional.search.ServiceRankingResultListener<S>
 
- 
- All Implemented Interfaces:
- IFunctionalExceptionListener,- IFunctionalIntermediateFinishedListener<S>,- IFunctionalIntermediateResultCountListener,- IFunctionalIntermediateResultListener<S>,- IFunctionalResultListener<java.util.Collection<S>>,- IIntermediateResultListener<S>,- IResultListener<java.util.Collection<S>>
 
 public class ServiceRankingResultListener<S> extends java.lang.Object implements IIntermediateResultListener<S> Listener that ranks results.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IRankingSearchTerminationDecider<S>deciderThe termination decider.protected booleanfinishedThe listener state.protected IResultListener<java.util.Collection<S>>listenerThe delegate listener.protected IServiceRanker<S>rankerThe ranker.protected java.util.List<S>resultsThe saved results.protected IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>>scorelistenerThe delegate listener.
 - 
Constructor SummaryConstructors Constructor Description ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, IResultListener<java.util.Collection<S>> listener)Create a new ranker.ServiceRankingResultListener(IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)Create a new ranker.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexceptionOccurred(java.lang.Exception exception)Called when exception occurs.voidfinished()Declare that the future is finished.voidintermediateResultAvailable(S result)Process intermediate results for ranking.booleanisFinished()Get the finished.voidmaxResultCountAvailable(int max)Declare that the future result count is available.protected voidnotifyException(java.lang.Exception exception)protected voidnotifyResults(java.util.List<Tuple2<S,java.lang.Double>> results)protected voidrankResults()Rank the results and announce themvoidresultAvailable(java.util.Collection<S> result)Called when result is available.
 
- 
- 
- 
Field Detail- 
resultsprotected java.util.List<S> results The saved results.
 - 
finishedprotected boolean finished The listener state.
 - 
rankerprotected IServiceRanker<S> ranker The ranker.
 - 
deciderprotected IRankingSearchTerminationDecider<S> decider The termination decider.
 - 
listenerprotected IResultListener<java.util.Collection<S>> listener The delegate listener.
 - 
scorelistenerprotected IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener The delegate listener.
 
- 
 - 
Constructor Detail- 
ServiceRankingResultListenerpublic ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, IResultListener<java.util.Collection<S>> listener) Create a new ranker.
 - 
ServiceRankingResultListenerpublic ServiceRankingResultListener(IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider) Create a new ranker.
 
- 
 - 
Method Detail- 
intermediateResultAvailablepublic void intermediateResultAvailable(S result) Process intermediate results for ranking.- Specified by:
- intermediateResultAvailablein interface- IFunctionalIntermediateResultListener<S>
- Specified by:
- intermediateResultAvailablein interface- IIntermediateResultListener<S>
- Parameters:
- result- The result.
 
 - 
resultAvailablepublic void resultAvailable(java.util.Collection<S> result) Called when result is available.- Specified by:
- resultAvailablein interface- IFunctionalResultListener<S>
- Parameters:
- result- The result.
 
 - 
exceptionOccurredpublic void exceptionOccurred(java.lang.Exception exception) Called when exception occurs.- Specified by:
- exceptionOccurredin interface- IFunctionalExceptionListener
- Parameters:
- exception- The exception.
 
 - 
finishedpublic void finished() Description copied from interface:IIntermediateResultListenerDeclare 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:
- finishedin interface- IFunctionalIntermediateFinishedListener<S>
- Specified by:
- finishedin interface- IIntermediateResultListener<S>
 
 - 
maxResultCountAvailablepublic void maxResultCountAvailable(int max) Description copied from interface:IIntermediateResultListenerDeclare that the future result count is available. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method will be called as often as the result count indicates except an exception occurs.- Specified by:
- maxResultCountAvailablein interface- IFunctionalIntermediateResultCountListener
- Specified by:
- maxResultCountAvailablein interface- IIntermediateResultListener<S>
 
 - 
isFinishedpublic boolean isFinished() Get the finished.- Returns:
- The finished.
 
 - 
rankResultsprotected void rankResults() Rank the results and announce them
 - 
notifyExceptionprotected void notifyException(java.lang.Exception exception) 
 
- 
 
-