commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject [Math] MATH-894
Date Mon, 12 Nov 2012 14:05:17 GMT

What do you think about deprecating "getInternalValues"?
Its only use is in "DescriptiveStatistics". I guess that the current usage
could save some time (by avoiding the creation of an array and copying the
elements), so that acces to the internal representation should be retained.
If so, I think that the name "getInternalValues" should be changed in order
to make it explicit that we are exposing an instance's field (whose
modification will be reflected in the object's state). The suffix
"...Values" is misleading; I suggest "getInternalArray" since current API
(and current usage) anyways forbids that another data structure be used.
[The alternative would be to enhance encapsulation by hiding the internal
representation altogether, thus removing the methods "getInternalValues()"
and "start()".]

I also notice that the "clear()" method reallocates the internal array.
IMO, it is unnecessarily inefficient. If one wanted to get this behaviour,
one could just create a new object. However, when reusing the same object,
users could legitimately expect that no allocation occurs and that it is
only the _contents_ that is discarded.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message