On Thu, 15 Jan 2015 10:02:32 +0100, Adriean Khisbe wrote:
Hi,
Working on a project I had to capture current state of a
DescriptiveStatistics, and choosed to use a StatisticalSummaryValues
to hold the value.
I looked it if was possible to do it in one short method call, but
didn't found the method.
However I found some equivalent in SummaryStatistics:
/** * Return a {@link StatisticalSummaryValues} instance
reporting current * statistics. * @return Current values of
statistics */ public StatisticalSummary getSummary() {
return new StatisticalSummaryValues(getMean(), getVariance(), getN(),
getMax(), getMin(), getSum()); }
Might be a good thing to port this functionnality in
DescriptiveStatistics so ones can do recap.getSummary()instead
of
new StatisticalSummaryValues(recap.getMean(),
recap.getVariance(), recap.getN(), recap.getMax(),
recap.getMin(), recap.getSum())
What do you think about this?
Personally, I don't like the "...Values" class.
I think that it should be a private inner class of "SummaryStatistics"
(or package-private).
I wonder whether, to capture the state, we could have a
Map<DataTypeId, Double> getState()
method, where "DataTypeId" would either be an "enum" or a "String".
Then couldn't "StatisticalSummary" itself be that enum rather than
an interface (since it seems to only enumerate data and have no
"behaviour")?
Regards,
Gilles
Regards :)
Adriean
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]