Java implementation of Alpha-numeric comparator

Ivan Gerasimov ivan.gerasimov at oracle.com
Wed Dec 17 11:11:00 UTC 2014


Thanks Sherman for the comments!

>> By the way, the Microsoft's StrCmpLogicalW() does it in the opposite 
>> direction, i.e. strings with more leading zeros come earlier.
>> If people find it useful, we can make it configurable.
>>
>
> It's always desired to have a "customizable" approach for numeric 
> order collation:-)

Agreed.
Given it's almost trivial to add this customization, I've added it.
I've also done a minor optimization pass over the code.

Here's the updated webrev:
http://cr.openjdk.java.net/~igerasim/XXXXXXX-AlphaNumeric/2/webrev/

Sincerely yours,
Ivan



More information about the core-libs-dev mailing list