From 1ed7683a750b5eeec2eda074bbaf0dcfd258eed5 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Tue, 18 May 2004 04:19:53 +0000 Subject: [PATCH] Added getSummary method returning StatisticalSummaryValues VO. git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/math/trunk@141229 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/stat/univariate/SummaryStatistics.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/commons/math/stat/univariate/SummaryStatistics.java b/src/java/org/apache/commons/math/stat/univariate/SummaryStatistics.java index f8e79fd43..076d3f4d4 100644 --- a/src/java/org/apache/commons/math/stat/univariate/SummaryStatistics.java +++ b/src/java/org/apache/commons/math/stat/univariate/SummaryStatistics.java @@ -22,9 +22,9 @@ import org.apache.commons.discovery.tools.DiscoverClass; /** * Abstract factory class for univariate statistical summaries. * - * @version $Revision: 1.3 $ $Date: 2004/04/27 04:37:59 $ + * @version $Revision: 1.4 $ $Date: 2004/05/18 04:19:53 $ */ -public abstract class SummaryStatistics implements Serializable, StatisticalSummary{ +public abstract class SummaryStatistics implements Serializable, StatisticalSummary { /** * Create an instance of a SummaryStatistics @@ -73,6 +73,17 @@ public abstract class SummaryStatistics implements Serializable, StatisticalSumm return factory; } + + /** + * Return a StatisticalSummaryValues instance reporting current statistics. + * + * @return Current values of statistics + */ + public StatisticalSummary getSummary() { + return new StatisticalSummaryValues(getMean(), getVariance(), getN(), + getMax(), getMin(), getSum()); + } + /** * Adds the value to the data to be summarized * @param v the value to be added