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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to