![JAR search and dependency download from the Maven repository](/logo.png)
jadex.bridge.nonfunctional.search.CountThresholdSearchTerminationDecider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-platform-bridge Show documentation
Show all versions of jadex-platform-bridge Show documentation
Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.
package jadex.bridge.nonfunctional.search;
import java.util.Collection;
import jadex.commons.future.IFuture;
/**
* Service search ranking decider based on a simple service count threshold.
*/
public class CountThresholdSearchTerminationDecider implements IRankingSearchTerminationDecider
{
/** The threshold of found services after which the ranking starts. */
protected int threshold;
/**
* Creates the decider.
* @param threshold The threshold of found services after which the ranking starts.
*/
public CountThresholdSearchTerminationDecider(int threshold)
{
this.threshold = threshold;
}
/**
* Decides if the search should start ranking.
*/
public IFuture isStartRanking(Collection currentresults, IServiceEvaluator evaluator)
{
return currentresults.size()>=threshold ? IFuture.TRUE : IFuture.FALSE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy