Author: mvitenkov
Date: 2008-05-12 03:57:11 -0400 (Mon, 12 May 2008)
New Revision: 8522
Added:
trunk/test-applications/jsp/src/main/java/util/comparator/
trunk/test-applications/jsp/src/main/java/util/comparator/ColumnsComparator.java
Log:
Added: trunk/test-applications/jsp/src/main/java/util/comparator/ColumnsComparator.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/comparator/ColumnsComparator.java
(rev 0)
+++
trunk/test-applications/jsp/src/main/java/util/comparator/ColumnsComparator.java 2008-05-12
07:57:11 UTC (rev 8522)
@@ -0,0 +1,21 @@
+package util.comparator;
+
+import java.util.Comparator;
+
+public class ColumnsComparator implements Comparator {
+
+ public int compare(Object o1, Object o2) {
+ String[] str1 = o1.toString().split(":");
+ String[] str2 = o2.toString().split(":");
+ int k = 0;
+ for (int i=0;i<str1.length;i++){
+ try {
+ k += str1[i].compareTo(str2[i]);
+ } catch (NullPointerException e) {
+ e.printStackTrace();
+ }
+ }
+ return k;
+ }
+
+}