Class AlphanumComparator
- java.lang.Object
-
- com.openindex.openestate.tool.utils.AlphanumComparator
-
- All Implemented Interfaces:
Comparator<String>
public class AlphanumComparator extends Object implements Comparator<String>
This is an updated version with enhancements made by Daniel Migowski, Andre Bogus, and David KoelleTo convert to use Templates (Java 1.5+): - Change "implements Comparator" to "implements Comparator
" - Change "compare(Object o1, Object o2)" to "compare(String s1, String s2)" - Remove the type checking and casting in compare(). To use this class: Use the static "sort" method from the java.util.Collections class: Collections.sort(your list, new AlphanumComparator());
-
-
Constructor Summary
Constructors Constructor Description AlphanumComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(String o1, String o2)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(String o1, String o2)
- Specified by:
compare
in interfaceComparator<String>
-
-