commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Pugh" <ep...@upstate.com>
Subject RE: [Collections] ComparableComparator - nulls OK
Date Fri, 07 Jun 2002 19:40:00 GMT
+1,  In my sorts, having to deal with nulls is causing me difficulties as
well..  Although I could see something like any nulls being ignored as a
type of behavior..  Sort everything, and drop the nulls!

Eric

-----Original Message-----
From: Jonathan Carlson [mailto:joncrlsn2@yahoo.com]
Sent: Friday, June 07, 2002 3:38 PM
To: commons-dev@jakarta.apache.org
Subject: [Collections] ComparableComparator - nulls OK


I'd like to make the case for a ComparableComparator that
allows the sorting of nulls to the bottom.  This could be a
flag to set on the existing class or another Comparator
called something like NullableComparableComparator (or
ComparableNullComparator?).

This becomes a big issue when sorting a collection of
things based on one of their getter methods with generic
components like the TransformingComparator I just
submitted.  Too often the returned value can be a null.

It's not too hard to write my own (I already have), but I
prefer having things like this standardized in one library
rather than written differently for each project.

My two cents.  I'd appreciate feedback, even negative
feedback if it's appropriate.

Jonathan

=====
Jonathan Carlson
joncrlsn@users.sf.net
Minneapolis, Minnesota

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message