com.github.k0zka.finder4j.backtrack.termination.AndTerminationStrategy Maven / Gradle / Ivy
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