From commons-dev-return-59982-apmail-jakarta-commons-dev-archive=jakarta.apache.org@jakarta.apache.org Sun Oct 03 15:02:15 2004 Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 48658 invoked from network); 3 Oct 2004 15:02:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Oct 2004 15:02:15 -0000 Received: (qmail 6522 invoked by uid 500); 3 Oct 2004 15:02:11 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 6439 invoked by uid 500); 3 Oct 2004 15:02:10 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 6423 invoked by uid 99); 3 Oct 2004 15:02:10 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [209.249.229.10] (HELO ricouer.tsdinc.steitz.com) (209.249.229.10) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 03 Oct 2004 08:02:09 -0700 Received: from Lavoie.tsdinc.steitz.com ([209.249.229.4]) by ricouer.tsdinc.steitz.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 3 Oct 2004 11:02:06 -0400 Received: from [192.168.1.200] ([130.13.71.41]) by Lavoie.tsdinc.steitz.com with Microsoft SMTPSVC(5.0.2195.6713); Sun, 3 Oct 2004 11:02:03 -0400 Message-ID: <415FEA3A.90601@steitz.com> Date: Sun, 03 Oct 2004 08:02:02 -0400 From: Phil Steitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: Re: [math] evaluate methods References: <415F6B23.5010903@kimvdlinde.com> In-Reply-To: <415F6B23.5010903@kimvdlinde.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Oct 2004 15:02:03.0436 (UTC) FILETIME=[F109EEC0:01C4A959] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Kim van der Linde wrote: > Hi All, > > I have a question. All evaluate methods are non-static, but they do not > depend on information stored already in the class. That would suggest > for me to make them static.... So, I guess that there is a compelling > reason not to do that, but one that I do not know.... Can anyone > enlighten me? You are right that conceptually these methods could be static (at least from the API contract standpoint). They are not static, however, because static methods cannot be overridden in Java (just "hidden") and the evaluate methods are designed to be overridden. Evaluate is declared as abstract in the base class AbstractUnivariateStatistic and also provided with a default implementation in AbstractStorelessUnivariateStatistic. The default impl uses the non-static incrementAll method (which actually does change the state of the instance), so it can't be static in any case. Phil > > Cheers, > > Kim --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org