uk.ac.leeds.ccg.andyt.grids.core
Class GridStatistics1

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.AbstractGridStatistics
      extended by uk.ac.leeds.ccg.andyt.grids.core.GridStatistics1
All Implemented Interfaces:
java.io.Serializable, GridStatisticsInterface

public class GridStatistics1
extends AbstractGridStatistics
implements java.io.Serializable

Used by AbstractGrid2DSquareCell instances to access statistics. This class to be instantiated for AbstractGrid2DSquareCell that do not keep all statistic fields up to date as the underlying data is changed. (Keeping statistic fields up to date as the underlying data is changed can be expensive.)

See Also:
Serialized Form

Field Summary
protected  boolean isUpToDate
          Is true iff fields are upToDate else is false.
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGridStatistics
_Grid2DSquareCell, maxBigDecimal, maxCountBigInteger, minBigDecimal, minCountBigInteger, nonNoDataValueCountBigInteger, sumBigDecimal
 
Constructor Summary
GridStatistics1()
          Creates a new instance of GridStatistics1
GridStatistics1(AbstractGrid2DSquareCell _Grid2DSquareCell)
          Creates a new instance of GridStatistics1
 
Method Summary
protected  java.math.BigDecimal getArithmeticMeanBigDecimal(int numberOfDecimalPlaces)
          For returning the arithmetic mean of all non noDataValues as a BigDecimal Throws an ArithmeticException if nonNoDataValueCountBigInteger is equal to zero.
protected  boolean getIsUpToDate()
          Returns upToDate
protected  java.math.BigDecimal getMaxBigDecimal()
          For returning the maximum of all non noDataValues as a BigDecimal
protected  java.math.BigDecimal getMinBigDecimal()
          For returning the minimum of all non noDataValues as a BigDecimal
protected  java.math.BigInteger getNonNoDataValueCountBigInteger()
          For returning the number of cells with noDataValues as a BigInteger
protected  java.math.BigDecimal getSumBigDecimal()
          For returning the sum of all non noDataValues as a BigDecimal
protected  void setIsUpToDate(boolean isUpToDate)
          Sets this.isUpToDate to isUpToDate
protected  void update()
          Updates fields (statistics) by going through all values in this.grid2DSquareCellAbstract if they might not be up to date.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGridStatistics
count, count, count, count, getArithmeticMeanBigDecimal, getDescription, getMaxBigDecimal, getMaxBigInteger, getMaxBigInteger, getMaxDouble, getMaxDouble, getMaxInt, getMaxInt, getMaxLong, getMaxLong, getMinBigDecimal, getMinBigInteger, getMinBigInteger, getMinDouble, getMinDouble, getMinInt, getMinInt, getMinLong, getMinLong, getMode, getName, getNonNoDataValueCountBigInteger, getNonNoDataValueCountInt, getNonNoDataValueCountInt, getNonNoDataValueCountLong, getNonNoDataValueCountLong, getStandardDeviationBigDecimal, getStandardDeviationBigDecimal, getSumBigDecimal, getSumBigInteger, getSumBigInteger, getSumDouble, getSumDouble, getSumInt, getSumInt, getSumLong, getSumLong, init, init, toString, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isUpToDate

protected boolean isUpToDate
Is true iff fields are upToDate else is false.

Constructor Detail

GridStatistics1

public GridStatistics1()
Creates a new instance of GridStatistics1


GridStatistics1

public GridStatistics1(AbstractGrid2DSquareCell _Grid2DSquareCell)
Creates a new instance of GridStatistics1

Parameters:
_Grid2DSquareCell -
Method Detail

getIsUpToDate

protected boolean getIsUpToDate()
Returns upToDate


setIsUpToDate

protected void setIsUpToDate(boolean isUpToDate)
Sets this.isUpToDate to isUpToDate


update

protected void update()
Updates fields (statistics) by going through all values in this.grid2DSquareCellAbstract if they might not be up to date. (NB. After calling this it is inexpensive to convert to GridStatistics0.)

Specified by:
update in class AbstractGridStatistics

getNonNoDataValueCountBigInteger

protected java.math.BigInteger getNonNoDataValueCountBigInteger()
For returning the number of cells with noDataValues as a BigInteger

Specified by:
getNonNoDataValueCountBigInteger in class AbstractGridStatistics

getSumBigDecimal

protected java.math.BigDecimal getSumBigDecimal()
For returning the sum of all non noDataValues as a BigDecimal

Specified by:
getSumBigDecimal in class AbstractGridStatistics

getMinBigDecimal

protected java.math.BigDecimal getMinBigDecimal()
For returning the minimum of all non noDataValues as a BigDecimal

Specified by:
getMinBigDecimal in class AbstractGridStatistics

getMaxBigDecimal

protected java.math.BigDecimal getMaxBigDecimal()
For returning the maximum of all non noDataValues as a BigDecimal

Specified by:
getMaxBigDecimal in class AbstractGridStatistics

getArithmeticMeanBigDecimal

protected java.math.BigDecimal getArithmeticMeanBigDecimal(int numberOfDecimalPlaces)
For returning the arithmetic mean of all non noDataValues as a BigDecimal Throws an ArithmeticException if nonNoDataValueCountBigInteger is equal to zero.

Specified by:
getArithmeticMeanBigDecimal in class AbstractGridStatistics
Parameters:
numberOfDecimalPlaces - The number of decimal places to which the result is precise.