Class ServiceRankingDelegationResultListener<S>
- java.lang.Object
-
- jadex.commons.future.IntermediateDelegationResultListener<S>
-
- jadex.bridge.nonfunctional.search.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.
-
Constructor Summary
Constructors Constructor Description ServiceRankingDelegationResultListener(jadex.commons.future.TerminableIntermediateDelegationFuture<S> future, jadex.commons.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()
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
-
-
-
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(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 classjadex.commons.future.IntermediateDelegationResultListener<S>
-
customResultAvailable
public void customResultAvailable(java.util.Collection<S> result)
Called when result is available.- Overrides:
customResultAvailable
in classjadex.commons.future.IntermediateDelegationResultListener<S>
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Called when exception occurs.
-
finished
public void finished()
-
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)
-
-