Phil,

Sorry, I just got around to checking out your change. I understand that you don't want to change the interface, which is fine. And, thank you for making the change so quickly.

I was surprised, though, to find that it didn't help my problem. Eventually it dawned on me that, despite the fact that all my values are Integers, it was still Frequency.addValue(Object) that was being called. The reason is that I was iterating through a collection of Integers, and so my reference type (which is used to select the actual method to be invoked) was Object, not Integer. I added an explicit cast, and it worked as expected.

But, consider the odd result that I got without the cast: I added nothing but Integers to the Frequency object, and then called valuesIterator(), which is documented as returning an Iterator of Longs if all the added values were integral (which they were). However, the Iterator was returning Integers, not Longs (because addValue(Object) does not do the conversion). Even worse, calling getCount() or getPct(), etcetera, on the values (that the Frequency object was giving me!) was always returning 0 (because the get***() methods do the automatic conversion as well).

I think this would be quite a trap for an unsuspecting user of the Frequency class. I understand the reasoning behind the automatic conversion, but it seems that addValue(Object) should do the conversion as well.

With the explicit cast, I am off and running. I just wanted to put in my two cents. Thanks for a great library.

- Jon Langlois

--
This electronic transmission is strictly confidential to NetIDEAS, Inc. and intended 
solely for the addressee. It may contain information, which is covered by legal, 
professional, or other privilege. If you are not the intended addressee, or someone 
authorized by the intended addressee to receive transmissions on the behalf of the 
addressee, you must not retain, disclose in any form, copy or take any action in 
reliance on this transmission. If you have received this transmission in error, please 
notify us as soon as possible and destroy this message.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to