diff options
Diffstat (limited to 'src/jrummikub/ai/fdsolver/constraint/GreaterThanConst.java')
-rw-r--r-- | src/jrummikub/ai/fdsolver/constraint/GreaterThanConst.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jrummikub/ai/fdsolver/constraint/GreaterThanConst.java b/src/jrummikub/ai/fdsolver/constraint/GreaterThanConst.java new file mode 100644 index 0000000..6b00ee3 --- /dev/null +++ b/src/jrummikub/ai/fdsolver/constraint/GreaterThanConst.java @@ -0,0 +1,15 @@ +package jrummikub.ai.fdsolver.constraint; + +import jrummikub.ai.fdsolver.Var; + +public class GreaterThanConst<T extends Comparable<T>> extends + FilterConstraint<T> { + public GreaterThanConst(final boolean allowEqual, Var<T> x, final T y) { + super(new Filter<T>() { + @Override + public boolean accept(T value) { + return y.compareTo(value) < (allowEqual ? 1 : 0); + } + }, x); + } +} |