commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim van der Linde <>
Subject Re: [math] evaluate methods
Date Sun, 03 Oct 2004 19:13:54 GMT
Ok, my question then becomes: why this structure?


Phil Steitz wrote:

> 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:
> For additional commands, e-mail:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message