FileDocCategorySizeDatePackage
StatUtil.javaAPI DocExample1568Wed May 18 09:39:02 BST 2005com.discursive.jccook.script.velocity.extend

StatUtil

public class StatUtil extends Object

Fields Summary
Constructors Summary
Methods Summary
public intaverage(int[] pArray)

        int sum = 0;
        for (int i = 0; i < pArray.length; i++) {
            sum += pArray[i];
        }
        return (sum / pArray.length);
    
public intmax(int[] pArray)

        int max = Integer.MIN_VALUE;
        for (int i = 0; i < pArray.length; i++) {
            if (pArray[i] > max) {
                max = pArray[i];
            }
        }
        return (max);
    
public intmin(int[] pArray)

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < pArray.length; i++) {
            if (pArray[i] < min) {
                min = pArray[i];
            }
        }
        return (min);