Class ServiceRankingResultListener<S>
- java.lang.Object
-
- jadex.bridge.nonfunctional.search.ServiceRankingResultListener<S>
-
- All Implemented Interfaces:
jadex.commons.future.IIntermediateResultListener<S>
,jadex.commons.future.IResultListener<java.util.Collection<S>>
public class ServiceRankingResultListener<S> extends java.lang.Object implements jadex.commons.future.IIntermediateResultListener<S>
Listener that ranks results.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, jadex.commons.future.IResultListener<java.util.Collection<S>> listener)
Create a new ranker.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.void
maxResultCountAvailable(int max)
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 themvoid
resultAvailable(java.util.Collection<S> result)
Called when result is available.
-
-
-
Field Detail
-
results
protected java.util.List<S> results
The saved results.
-
finished
protected boolean finished
The listener state.
-
ranker
protected IServiceRanker<S> ranker
The ranker.
-
decider
protected IRankingSearchTerminationDecider<S> decider
The termination decider.
-
listener
protected jadex.commons.future.IResultListener<java.util.Collection<S>> listener
The delegate listener.
-
scorelistener
protected jadex.commons.future.IResultListener<java.util.Collection<jadex.commons.Tuple2<S,java.lang.Double>>> scorelistener
The delegate listener.
-
-
Constructor Detail
-
ServiceRankingResultListener
public ServiceRankingResultListener(IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider, jadex.commons.future.IResultListener<java.util.Collection<S>> listener)
Create a new ranker.
-
ServiceRankingResultListener
public 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.
-
-
Method Detail
-
intermediateResultAvailable
public void intermediateResultAvailable(S result)
Process intermediate results for ranking.- Specified by:
intermediateResultAvailable
in interfacejadex.commons.future.IIntermediateResultListener<S>
-
resultAvailable
public void resultAvailable(java.util.Collection<S> result)
Called when result is available.- Specified by:
resultAvailable
in interfacejadex.commons.future.IResultListener<S>
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Called when exception occurs.- Specified by:
exceptionOccurred
in interfacejadex.commons.future.IResultListener<S>
-
finished
public void finished()
- Specified by:
finished
in interfacejadex.commons.future.IIntermediateResultListener<S>
-
maxResultCountAvailable
public void maxResultCountAvailable(int max)
- Specified by:
maxResultCountAvailable
in interfacejadex.commons.future.IIntermediateResultListener<S>
-
isFinished
public boolean isFinished()
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)
-
-