commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject Re: [math] Fwd: Re: Change utility class to singleton with interface?
Date Thu, 03 Jul 2003 20:21:30 GMT
This could be something a simple as:

package org.apache.commons.math.stat2;

import org.apache.commons.math.stat2.univariate.moment.Mean;
import org.apache.commons.math.stat2.univariate.moment.Variance;

public class StatUtils {
   
    private static Mean _mean;
    private static Variance _variance;
   
    public double mean(double[] values) {
        return _mean.evaluate(values);       
    }

    public double variance(double[] values) {
        return _variance.evaluate(values);       
    }
   
    static {
        _mean = new Mean();
        _variance = new Variance();
    }
}

thanks Al,
Mark

Al Chou wrote:

>The beginnings of a thread in the Refactoring Yahoo list that may be of
>interest for our current design discussions:
>
>Change utility class to singleton with interface?
>http://groups.yahoo.com/group/refactoring/message/3797
>
>
>Al
>
>=====
>Albert Davidson Chou
>
>    Get answers to Mac questions at http://www.Mac-Mgrs.org/ .
>
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message