I am doing running statistics over an ordered set of data, storing the statistics at each new value I come across. One way of doing this would be to have an array of SummaryStatistics and do
for (int i = 0; i < length; i++)
{
for (int j = i; j < length; j++)
{
statsArray[j].addValue(values[i]);
}
}another way is to do
for (int i = 0; i < length; i++)
{
stats.addValue(values[i]);
statsArray[i] = SerializationUtils.clone(stats);
}A lot of these objects are marked Serializable, but clone methods do not exist. That's why I use commons-lang SerializationUtils. Unfortunately, that makes the cloning take up 50% of my runtime because (de)serialization is expensive.
I will probably patch the statistics classes, implementing enough of clone() to make me happy. Would you like this patch?
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
