At present the Frequency class seems to treat NaN as just another Comparable.
On my system it sorts as above POSITIVE_INFINITY.

So getMode() can return NaN entries, as can the iterators.

Is this reasonable behaviour?
Should it be documented and therefore tested?

Or should NaN be disallowed from entering the frequency table?

I suppose it would be easy enough to subclass Frequency and override
incrementValue(Comparable<?> v, long increment) to reject NaNs.

But then we would need to document that addValue(Comparable<?> v)
calls it - or the subclass would need to override both to be sure.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to