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