public class ServiceRankingDelegationResultListener<S> extends TerminableIntermediateDelegationResultListener<S>
Modifier and Type | Field and 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.
|
customIntermediateResultListener, future, undone
Constructor and Description |
---|
ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> future,
ITerminableIntermediateFuture<S> src,
IServiceRanker<S> ranker,
IRankingSearchTerminationDecider<S> decider)
Create a new ranker.
|
Modifier and Type | Method and 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
|
commandAvailable, exceptionOccurredIfUndone, finishedIfUndone, intermediateResultAvailable, intermediateResultAvailableIfUndone, resultAvailable, resultAvailableIfUndone
protected java.util.List<S> results
protected java.lang.Boolean finished
protected IServiceRanker<S> ranker
protected IRankingSearchTerminationDecider<S> decider
public ServiceRankingDelegationResultListener(TerminableIntermediateDelegationFuture<S> future, ITerminableIntermediateFuture<S> src, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider)
public void customIntermediateResultAvailable(S result)
customIntermediateResultAvailable
in class IntermediateDelegationResultListener<S>
result
- The result.public void customResultAvailable(java.util.Collection<S> result)
customResultAvailable
in class IntermediateDelegationResultListener<S>
result
- The result.public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface IFunctionalExceptionListener
exceptionOccurred
in class IntermediateDelegationResultListener<S>
exception
- The exception.public void finished()
IntermediateDelegationResultListener
finished
in interface IIntermediateResultListener<S>
finished
in class IntermediateDelegationResultListener<S>
public boolean isFinished()
public boolean isFinishing()
protected void rankResults()
protected void notifyException(java.lang.Exception exception)