/* * GridStatisticsInterface.java * * Created on 18 February 2002, 14:13 */ package uk.ac.leeds.ccg.cluster.grids; /** * * @author andyt */ public abstract class AbstractGridStatistics { /** * A reference to the AbstractGrid2DSquareCellDouble instance to which this class applies */ AbstractGrid2DSquareCellDouble grid; /** * Proportion of Grid cells with values=noDataValue. * This should be considered for moving up into AbstractGrid2DSquareCellDouble. * (sparseness=1.0d means all values are noDataValues) * (sparseness=0.0d means all values are not noDataValues) */ protected double sparseness; /** * For storing the sum of all values in the Grid. */ protected double sum; /** * For storing the minimum value in the Grid */ protected double min; /** * Stores the number of minimum values in the Grid. */ protected int minCount; /** * For storing the maximum value in the Grid */ protected double max; /** * Stores the number of maximum values in the Grid. */ protected int maxCount; /** * Returns a description */ public abstract String toString(); /** * Sets the grid reference to grid */ protected void setGrid(AbstractGrid2DSquareCellDouble grid) {this.grid=grid;} /** * Returns the reference to grid */ protected AbstractGrid2DSquareCellDouble getGrid() {return this.grid;} /** * Returns the sparseness of the grid. */ public abstract double getSparseness(); /** * Sets sparseness to the value passed in or ignores it. */ public abstract void setSparseness(double sparseness); /** * Returns the sum of all values in the grid. */ public abstract double getSum(); /** * Sets sum to the value passed in or ignores it. */ public abstract void setSum(double sum); /** * Returns the minimum value in the Grid. */ public abstract double getMin(); /** * Sets min to the value passed in or ignores it. */ public abstract void setMin(double min); /** * Gets minCount. */ public abstract int getMinCount(); /** * Sets minCount to the value passed in or ignores it. */ public abstract void setMinCount(int minCount); /** * Sets min to the minimum of it and d1 and corrects minCount or ignores. */ public abstract void doMin(double d1); /** * Returns the maximum value in the Grid. */ public abstract double getMax(); /** * Sets max to the value passed in or ignores it. */ public abstract void setMax(double max); /** * Gets maxCount. */ public abstract int getMaxCount(); /** * Sets maxCount to the value passed in or ignores it. */ public abstract void setMaxCount(int maxCount); /** * Sets max to the maximum of it and d1 and corrects maxCount or ignores. */ public abstract void doMax(double d1); /** * Calculates or recalculates GridStatistics. */ public abstract void doStats(); /** * May update sum min minCount recalculateMin max maxCount recalculateMax * from inputGridStatistics. */ public abstract void updateGridStatisticsFrom(AbstractGridStatistics inputGridStatistics); }