All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.k0zka.finder4j.backtrack.termination.AndTerminationStrategy Maven / Gradle / Ivy

There is a newer version: 0.7
Show newest version
package com.github.k0zka.finder4j.backtrack.termination;

import java.util.ArrayList;
import java.util.List;

import com.github.k0zka.finder4j.backtrack.State;
import com.github.k0zka.finder4j.backtrack.TerminationStrategy;

public class AndTerminationStrategy implements
		TerminationStrategy {

	private final List> strategies;

	public AndTerminationStrategy(List> strategies) {
		super();
		this.strategies = new ArrayList<>(strategies);
	}

	@Override
	public boolean stop(X state) {
		for (TerminationStrategy strategy : strategies) {
			if (!strategy.stop(state)) {
				return false;
			}
		}
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy