Hi.

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.


Regards,
Gilles

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

Reply via email to