summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/ai/fdsolver/constraint/LessThan.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/ai/fdsolver/constraint/LessThan.java')
-rw-r--r--src/jrummikub/ai/fdsolver/constraint/LessThan.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jrummikub/ai/fdsolver/constraint/LessThan.java b/src/jrummikub/ai/fdsolver/constraint/LessThan.java
new file mode 100644
index 0000000..b79252c
--- /dev/null
+++ b/src/jrummikub/ai/fdsolver/constraint/LessThan.java
@@ -0,0 +1,17 @@
+package jrummikub.ai.fdsolver.constraint;
+
+import java.util.Comparator;
+
+import jrummikub.ai.fdsolver.Var;
+
+public class LessThan<T extends Comparable<T>> extends ComparatorConstraint<T> {
+
+ public LessThan(boolean allowEqual, Var<T> x, Var<T> y) {
+ super(new Comparator<T>() {
+ @Override
+ public int compare(T o1, T o2) {
+ return o1.compareTo(o2);
+ }
+ }, allowEqual, x, y);
+ }
+}