public class ServiceRankingResultListener<S> extends java.lang.Object implements IIntermediateResultListener<S>
Modifier and Type | Field and Description |
---|---|
protected IRankingSearchTerminationDecider<S> |
decider
The termination decider.
|
protected boolean |
finished
The listener state.
|
protected 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 IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> |
scorelistener
The delegate listener.
|
Constructor and Description |
---|
ServiceRankingResultListener(IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener,
IServiceRanker<S> ranker,
IRankingSearchTerminationDecider<S> decider)
Create a new ranker.
|
ServiceRankingResultListener(IServiceRanker<S> ranker,
IRankingSearchTerminationDecider<S> decider,
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()
Declare that the future is 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<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 IResultListener<java.util.Collection<S>> listener
protected IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener
public ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, IResultListener<java.util.Collection<S>> listener)
public ServiceRankingResultListener(IResultListener<java.util.Collection<Tuple2<S,java.lang.Double>>> scorelistener, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)
public void intermediateResultAvailable(S result)
intermediateResultAvailable
in interface IFunctionalIntermediateResultListener<S>
intermediateResultAvailable
in interface IIntermediateResultListener<S>
result
- The result.public void resultAvailable(java.util.Collection<S> result)
resultAvailable
in interface IFunctionalResultListener<java.util.Collection<S>>
resultAvailable
in interface IIntermediateResultListener<S>
result
- The final result.public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface IFunctionalExceptionListener
exception
- The exception.public void finished()
IIntermediateResultListener
finished
in interface IFunctionalIntermediateFinishedListener
finished
in interface IIntermediateResultListener<S>
public boolean isFinished()
protected void rankResults()
protected void notifyException(java.lang.Exception exception)