Class ServiceRankingDelegationResultListener<S>
- java.lang.Object
- 
- jadex.commons.future.IntermediateDelegationResultListener<E>
- 
- jadex.commons.future.TerminableIntermediateDelegationResultListener<S>
- 
- jadex.bridge.nonfunctional.search.ServiceRankingDelegationResultListener<S>
 
 
 
- 
- All Implemented Interfaces:
- IFunctionalExceptionListener,- IFunctionalIntermediateFinishedListener<S>,- IFunctionalIntermediateResultCountListener,- IFunctionalIntermediateResultListener<S>,- IFunctionalResultListener<java.util.Collection<S>>,- IFutureCommandResultListener<java.util.Collection<S>>,- IIntermediateResultListener<S>,- IResultListener<java.util.Collection<S>>,- IUndoneIntermediateResultListener<S>,- IUndoneResultListener<java.util.Collection<S>>
 - Direct Known Subclasses:
- ServiceRankingDelegationResultListener2
 
 public class ServiceRankingDelegationResultListener<S> extends TerminableIntermediateDelegationResultListener<S> Listener that ranks results.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IRankingSearchTerminationDecider<S>deciderThe termination decider.protected java.lang.BooleanfinishedThe listener state (false=unfinished, null=finishing, true=finished.protected IServiceRanker<S>rankerThe ranker.protected java.util.List<S>resultsThe saved results.- 
Fields inherited from class jadex.commons.future.IntermediateDelegationResultListenercirlistener, clistener, crlistener, delegate, future, undone
 
- 
 - 
Constructor SummaryConstructors Constructor Description ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> future, ITerminableIntermediateFuture<S> src, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)Create a new ranker.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcustomIntermediateResultAvailable(S result)Process intermediate results for ranking.voidcustomResultAvailable(java.util.Collection<S> result)Called when result is available.voidexceptionOccurred(java.lang.Exception exception)Called when exception occurs.voidfinished()Declare that the future is finished.booleanisFinished()Get the finished.booleanisFinishing()Get the finished.protected voidnotifyException(java.lang.Exception exception)protected voidnotifyResults(java.util.List<Tuple2<S,java.lang.Double>> results)protected voidrankResults()Rank the results and announce them- 
Methods inherited from class jadex.commons.future.IntermediateDelegationResultListenercommandAvailable, exceptionOccurredIfUndone, finishedIfUndone, handleException, intermediateResultAvailable, intermediateResultAvailableIfUndone, maxResultCountAvailable, resultAvailable, resultAvailableIfUndone
 
- 
 
- 
- 
- 
Field Detail- 
resultsprotected java.util.List<S> results The saved results.
 - 
finishedprotected java.lang.Boolean finished The listener state (false=unfinished, null=finishing, true=finished.
 - 
rankerprotected IServiceRanker<S> ranker The ranker.
 - 
deciderprotected IRankingSearchTerminationDecider<S> decider The termination decider.
 
- 
 - 
Constructor Detail- 
ServiceRankingDelegationResultListenerpublic ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> future, ITerminableIntermediateFuture<S> src, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider) Create a new ranker.
 
- 
 - 
Method Detail- 
customIntermediateResultAvailablepublic void customIntermediateResultAvailable(S result) Process intermediate results for ranking.- Overrides:
- customIntermediateResultAvailablein class- IntermediateDelegationResultListener<S>
- Parameters:
- result- The result.
 
 - 
customResultAvailablepublic void customResultAvailable(java.util.Collection<S> result) Called when result is available.- Overrides:
- customResultAvailablein class- IntermediateDelegationResultListener<S>
- Parameters:
- result- The result.
 
 - 
exceptionOccurredpublic void exceptionOccurred(java.lang.Exception exception) Called when exception occurs.- Specified by:
- exceptionOccurredin interface- IFunctionalExceptionListener
- Overrides:
- exceptionOccurredin class- IntermediateDelegationResultListener<S>
- Parameters:
- exception- The exception.
 
 - 
finishedpublic void finished() Description copied from class:IntermediateDelegationResultListenerDeclare that the future is finished.- Specified by:
- finishedin interface- IFunctionalIntermediateFinishedListener<S>
- Specified by:
- finishedin interface- IIntermediateResultListener<S>
- Overrides:
- finishedin class- IntermediateDelegationResultListener<S>
 
 - 
isFinishedpublic boolean isFinished() Get the finished.- Returns:
- The finished.
 
 - 
isFinishingpublic boolean isFinishing() Get the finished.- Returns:
- The finished.
 
 - 
rankResultsprotected void rankResults() Rank the results and announce them
 - 
notifyExceptionprotected void notifyException(java.lang.Exception exception) 
 
- 
 
-