public class ServiceRankingResultListener<S>
extends java.lang.Object
implements jadex.commons.future.IIntermediateResultListener<S>
Modifier and Type | Field and Description |
---|---|
protected IRankingSearchTerminationDecider<S> |
decider
The termination decider.
|
protected boolean |
finished
The listener state.
|
protected jadex.commons.future.IResultListener<java.util.Collection<S>> |
listener
The delegate listener.
|
protected IServiceRanker<S> |
ranker
The ranker.
|
protected java.util.List<S> |
results
The saved results.
|
protected jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,java.lang.Double>>> |
scorelistener
The delegate listener.
|
Constructor and Description |
---|
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.
|
ServiceRankingResultListener(IServiceRanker<S> ranker,
IRankingSearchTerminationDecider<S> decider,
jadex.commons.future.IResultListener<java.util.Collection<S>> listener)
Create a new ranker.
|
Modifier and Type | Method and Description |
---|---|
void |
exceptionOccurred(java.lang.Exception exception)
Called when exception occurs.
|
void |
finished() |
void |
intermediateResultAvailable(S result)
Process intermediate results for ranking.
|
boolean |
isFinished()
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
|
void |
resultAvailable(java.util.Collection<S> result)
Called when result is available.
|
protected java.util.List<S> results
protected boolean finished
protected IServiceRanker<S> ranker
protected IRankingSearchTerminationDecider<S> decider
protected jadex.commons.future.IResultListener<java.util.Collection<S>> listener
protected jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,java.lang.Double>>> scorelistener
public ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, jadex.commons.future.IResultListener<java.util.Collection<S>> listener)
public ServiceRankingResultListener(jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,java.lang.Double>>> scorelistener, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)
public void intermediateResultAvailable(S result)
public void resultAvailable(java.util.Collection<S> result)
public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface jadex.commons.future.IFunctionalExceptionListener
public void finished()
finished
in interface jadex.commons.future.IFunctionalIntermediateFinishedListener
finished
in interface jadex.commons.future.IIntermediateResultListener<S>
public boolean isFinished()
protected void rankResults()
protected void notifyResults(java.util.List<jadex.commons.Tuple2<S,java.lang.Double>> results)
protected void notifyException(java.lang.Exception exception)