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 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
cirlistener, clistener, crlistener, delegate, future, undone
-
-
Constructor Summary
Constructors Constructor Description ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> future, ITerminableIntermediateFuture<S> src, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)
Create a new ranker.
-
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()
Declare that the future is finished.boolean
isFinished()
Get the finished.boolean
isFinishing()
Get the finished.protected void
notifyException(java.lang.Exception exception)
protected void
notifyResults(java.util.List<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
-
-
-
-
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.
-
ranker
protected IServiceRanker<S> ranker
The ranker.
-
decider
protected IRankingSearchTerminationDecider<S> decider
The termination decider.
-
-
Constructor Detail
-
ServiceRankingDelegationResultListener
public ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> 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 classIntermediateDelegationResultListener<S>
- Parameters:
result
- The result.
-
customResultAvailable
public void customResultAvailable(java.util.Collection<S> result)
Called when result is available.- Overrides:
customResultAvailable
in classIntermediateDelegationResultListener<S>
- Parameters:
result
- The result.
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Called when exception occurs.- Specified by:
exceptionOccurred
in interfaceIFunctionalExceptionListener
- Overrides:
exceptionOccurred
in classIntermediateDelegationResultListener<S>
- Parameters:
exception
- The exception.
-
finished
public void finished()
Description copied from class:IntermediateDelegationResultListener
Declare that the future is finished.- Specified by:
finished
in interfaceIFunctionalIntermediateFinishedListener<S>
- Specified by:
finished
in interfaceIIntermediateResultListener<S>
- Overrides:
finished
in classIntermediateDelegationResultListener<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
-
notifyException
protected void notifyException(java.lang.Exception exception)
-
-