Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3AFD810B8B for ; Thu, 15 Jan 2015 16:51:36 +0000 (UTC) Received: (qmail 27453 invoked by uid 500); 15 Jan 2015 16:51:37 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 27308 invoked by uid 500); 15 Jan 2015 16:51:37 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 27294 invoked by uid 99); 15 Jan 2015 16:51:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jan 2015 16:51:37 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.74.71.26] (HELO hel.is.scarlet.be) (193.74.71.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jan 2015 16:51:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1421340659; bh=ELYNffxDFbtUrgH51KoKFf8r3o47WWTUbp820xWnwLo=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Subject:In-Reply-To:References:Message-ID; b=VP8kQJnvUL1CQishZijFQrRvxGlRFwPNFsZQ4zV2CdY9Od4HitlZmjVyuhwPcBUba T1AJVj1/guPzp8b5H8BRuoQ/T+1Rp8M1cKiEH3FVQPP+w0koBTJnoskIi55A5pe8QR 5mV1tIn3zdFBTDisKxwTMVusasohfAJiDVTh/qMg= Received: from webmail.scarlet.be (gresham.is.scarlet.be [193.74.71.215]) by hel.is.scarlet.be (8.14.9/8.14.9) with ESMTP id t0FGowUu023228 for ; Thu, 15 Jan 2015 17:50:59 +0100 X-Scarlet: d=1421340659 c=193.74.71.215 Received: from pno-astro-26.ulb.ac.be ([164.15.138.26]) via pno-astro-26.ulb.ac.be ([164.15.138.26]) by webmail.scarlet.be with HTTP (HTTP/1.1 POST); Thu, 15 Jan 2015 17:50:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 15 Jan 2015 17:50:58 +0100 From: Gilles To: Subject: Re: [math] suggestion: introducing getSummary method on descriptive statistics In-Reply-To: References: Message-ID: X-Sender: gilles@harfang.homelinux.org User-Agent: Scarlet Webmail X-DCC-scarlet.be-Metrics: hel; whitelist X-Virus-Scanned: clamav-milter 0.98.1-exp at hel X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org 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 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: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org