-package org.simantics.document.linking.report.templates;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Comparator;\r
-import java.util.List;\r
-\r
-public class NestedComparator<T> implements Comparator<T> {\r
- List<Comparator<T>> comparators = new ArrayList<Comparator<T>>();\r
- \r
- public void addComparator(Comparator<T> c) {\r
- comparators.add(c);\r
- }\r
- \r
- public int compare(T o1, T o2) {\r
- for (Comparator<T> c : comparators) {\r
- int v = c.compare(o1, o2);\r
- if (v != 0)\r
- return v;\r
- }\r
- return 0;\r
- };\r
-}\r
+package org.simantics.document.linking.report.templates;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+public class NestedComparator<T> implements Comparator<T> {
+ List<Comparator<T>> comparators = new ArrayList<Comparator<T>>();
+
+ public void addComparator(Comparator<T> c) {
+ comparators.add(c);
+ }
+
+ public int compare(T o1, T o2) {
+ for (Comparator<T> c : comparators) {
+ int v = c.compare(o1, o2);
+ if (v != 0)
+ return v;
+ }
+ return 0;
+ };
+}