[flaptor-util] r208 committed - added inverse comparator

1 view
Skip to first unread message

codesite...@google.com

unread,
May 3, 2010, 3:04:04 PM5/3/10
to flaptor-o...@googlegroups.com
Revision: 208
Author: san...@santip.com.ar
Date: Mon May 3 12:03:53 2010
Log: added inverse comparator
http://code.google.com/p/flaptor-util/source/detail?r=208

Modified:
/trunk/src/com/flaptor/util/CollectionsUtil.java

=======================================
--- /trunk/src/com/flaptor/util/CollectionsUtil.java Fri Apr 16 16:28:17
2010
+++ /trunk/src/com/flaptor/util/CollectionsUtil.java Mon May 3 12:03:53
2010
@@ -88,6 +88,14 @@
}
};
}
+
+ public static <T> Comparator<T> inverseComparator(final Comparator<T>
comp) {
+ return new Comparator<T>() {
+ public int compare(T o1, T o2) {
+ return comp.compare(o2, o1);
+ }
+ };
+ }

/**
* Merges any number of sorted lists of comparable elements into a new
sorted list in linear time O(N) where N is

--
You received this message because you are subscribed to the Google Groups "flaptor-open-source" group.
To post to this group, send email to flaptor-o...@googlegroups.com.
To unsubscribe from this group, send email to flaptor-open-so...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flaptor-open-source?hl=en.

Reply all
Reply to author
Forward
0 new messages