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/BEANUTILS] Is there a comparator that can dynamically pick a method to call on a bean?
Date Mon, 10 Jun 2002 21:53:29 GMT
I see your question..  If there is no Comparator passed in then the
ComparableComparator is used..  The reason I was getting weird results was
that for the method getPrimaryKey() in my objects, there where two matching
methods, one that returned String objects, the other returned BigDecimal
objects..  However BeanComparator (via PropertyUtils) was returning the
String version..  So the comparision was "2" versus "22", not 2 versus 22
etc...

Eric


-----Original Message-----
From: Henri Yandell [mailto:bayard@generationjava.com]
Sent: Monday, June 10, 2002 5:44 PM
To: Jakarta Commons Developers List
Subject: RE: [COLLECTIONS/BEANUTILS] Is there a comparator that can
dynamically pick a method to call on a bean?




On Mon, 10 Jun 2002, Eric Pugh wrote:

> The other reason, and why I started down this path was the original big
> decimals: 2, 12, and 22, when compared as strings come out as 12, 2, 22!

I still don't get this. Why are they compared as strings??

Is it if a Comparator isn't passed in the constructor? Why not
ComparableComparator?

Hen


--
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