de.matthiasmann.twl.utils
Class NaturalSortComparator

java.lang.Object
  extended by de.matthiasmann.twl.utils.NaturalSortComparator

public class NaturalSortComparator
extends java.lang.Object

Natural sorting of string containing numbers


Field Summary
static java.util.Comparator<java.lang.String> stringComparator
           
static java.util.Comparator<java.lang.String> stringPathComparator
           
 
Method Summary
static int naturalCompare(java.lang.String n1, java.lang.String n2)
           
static int naturalCompareWithPaths(java.lang.String n1, java.lang.String n2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stringComparator

public static final java.util.Comparator<java.lang.String> stringComparator

stringPathComparator

public static final java.util.Comparator<java.lang.String> stringPathComparator
Method Detail

naturalCompareWithPaths

public static int naturalCompareWithPaths(java.lang.String n1,
                                          java.lang.String n2)

naturalCompare

public static int naturalCompare(java.lang.String n1,
                                 java.lang.String n2)