summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/ai/fdsolver/constraint/LessThanConst.java
blob: 18d882788b78e214a341f9f200ec1050215b8902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package jrummikub.ai.fdsolver.constraint;

import java.util.Collection;

import jrummikub.ai.fdsolver.Propagator;
import jrummikub.ai.fdsolver.Solver;
import jrummikub.ai.fdsolver.Var;

public class LessThanConst<T extends Comparable<T>> extends FilterConstraint<T> {
	public LessThanConst(final boolean allowEqual, Var<T> x, final T y) {
		super(new Filter<T>() {
			@Override
			public boolean accept(T value) {
				return value.compareTo(y) < (allowEqual ? 1 : 0);
			}
		}, x);
	}
}