commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EP...@upstate.com
Subject [collections] possible contribution, LowercaseComparator and Numb erComparator
Date Fri, 04 Oct 2002 13:25:14 GMT
Hi all,

I am trying to clean up my bits of code that I have put all over the place,
and realized that I have a LowercaseComparator and a NumberComparator that
might be of interest for Commons collections.

LowercaseComparator (which should be called IgnoreCaseComparator) allows you
to compare two strings, say "Eric" and "eric" and get back that they are the
same.  This is useful when you are sorting strings that are in multiple
types of case, and you don't care about the case for sorting purposes.

NumberComparator works in a similar fashing.  When sorting (as strings) "1",
"5", and "10" you get back them in the order: "1","10","5" when you really
want them back in the order 1,5,10.  So this comparator, if both sides are
Strings that are numbers, does that for you.

If one of the committers wants to add this code, then I will be happy to
make any changes requested, fix the javadocs, and add a unit test for each.

Thanks,

Eric Pugh


Mime
View raw message