Package com.arpnetworking.utility
Class LexicalNumericComparator
java.lang.Object
com.arpnetworking.utility.LexicalNumericComparator
- All Implemented Interfaces:
Serializable
,Comparator<String>
Compares strings lexically and numerically by splitting on digits and using the full number for numerical comparison.
NOTE: does not support negatives or decimal places
- Author:
- Brandon Arp (brandon dot arp at inscopemetrics dot com)
- See Also:
-
Constructor Summary
-
Method Summary
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
-
Constructor Details
-
LexicalNumericComparator
public LexicalNumericComparator()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<String>
-