/** * Rank the services of a search with a specific ranker and emit the scores. */ public static <S> ITerminableIntermediateFuture<Tuple2<S, Double>> rankServicesWithScores(ITerminableIntermediateFuture<S> searchfut, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider) { TerminableIntermediateDelegationFuture<Tuple2<S, Double>> ret = new TerminableIntermediateDelegationFuture<Tuple2<S, Double>>(); searchfut.addResultListener(new ServiceRankingDelegationResultListener2<S>(ret, searchfut, ranker, decider)); return ret; }
/** * Notify the results, */ protected void notifyResults(List<Tuple2<S, Double>> results) { if(!isFinished()) { finished = Boolean.TRUE; TerminableIntermediateDelegationFuture<Tuple2<S, Double>> fut = (TerminableIntermediateDelegationFuture<Tuple2<S, Double>>)future; for(Tuple2<S, Double> res: results) { fut.addIntermediateResult(res); } fut.setFinished(); } } }
/** * Notify the results, */ protected void notifyResults(List<Tuple2<S, Double>> results) { if(!isFinished()) { finished = Boolean.TRUE; TerminableIntermediateDelegationFuture<Tuple2<S, Double>> fut = (TerminableIntermediateDelegationFuture<Tuple2<S, Double>>)future; for(Tuple2<S, Double> res: results) { fut.addIntermediateResult(res); } fut.setFinished(); } } }
/** * Rank the services of a search with a specific ranker and emit the scores. */ public static <S> ITerminableIntermediateFuture<Tuple2<S, Double>> rankServicesWithScores(ITerminableIntermediateFuture<S> searchfut, IServiceRanker<S> ranker, IRankingSearchTerminationDecider<S> decider) { TerminableIntermediateDelegationFuture<Tuple2<S, Double>> ret = new TerminableIntermediateDelegationFuture<Tuple2<S, Double>>(); searchfut.addResultListener(new ServiceRankingDelegationResultListener2<S>(ret, searchfut, ranker, decider)); return ret; }