public class NaturalStringComparator extends Object implements Comparator<String>
A google search revealed that this class was probably taken from this blog post: http://weblogs.java.net/blog/skelvin/archive/2006/01/natural_string.html
I refactored the original static util class into a comparator because static util classes are bad.
Constructor and Description |
---|
NaturalStringComparator()
Constructs a comparator for the default system locale.
|
NaturalStringComparator(Locale locale)
Constructs a comparator using the specified locale.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(String arg0,
String arg1) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public NaturalStringComparator()
Collator.getInstance()
public NaturalStringComparator(Locale locale)
Collator.getInstance(Locale)
public int compare(String arg0, String arg1)
compare
in interface Comparator<String>
Copyright © 2003–2016 Atlassian. All rights reserved.