|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler uk.ac.leeds.ccg.andyt.grids.core.GridStatisticsAbstract
public abstract class GridStatisticsAbstract
TODO: docs
Field Summary | |
---|---|
protected Grid2DSquareCellAbstract |
grid2DSquareCell
A reference to the Grid2DSquareCellAbstract this is for. |
protected java.math.BigDecimal |
maxBigDecimal
For storing the maximum of all non noDataValues as a BigDecimal. |
protected java.math.BigInteger |
maxCountBigInteger
For storing the number of max values as a BigInteger. |
protected java.math.BigDecimal |
minBigDecimal
For storing the minimum of all non noDataValues as a BigDecimal. |
protected java.math.BigInteger |
minCountBigInteger
For storing the number of min values as a BigInteger. |
protected java.math.BigInteger |
nonNoDataValueCountBigInteger
For storing the number of cells with non noDataValues. |
protected java.math.BigDecimal |
sumBigDecimal
For storing the sum of all non noDataValues as a BigDecimal. |
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
---|
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve |
Constructor Summary | |
---|---|
GridStatisticsAbstract()
|
Method Summary | |
---|---|
static long |
count(Grid2DSquareCellDouble grid2DSquareCellDouble,
long row,
long col,
long nrows,
long ncols,
double value)
Counts the remaining number of values in grid2DSquareCellDouble equal to value from cell given by row p and column q counting in row major order. |
static long |
count(Grid2DSquareCellInt grid2DSquareCellInt,
long row,
long col,
long nrows,
long ncols,
int value)
Counts the remaining number of values in grid2DSquareCellInt equal to value from cell given by row p and column q counting in row major order. |
java.math.BigInteger |
getMaxBigInteger()
For returning the maximum of all non noDataValues as a BigInteger |
double |
getMaxDouble()
For returning the maximum of all non noDataValues as a double If this.minBigDecimal is to big/small to represent as a double then an Arithmetic Exception is thrown and Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY are returned as appropriate. |
int |
getMaxInt()
For returning the minimum of all non noDataValues as a int |
long |
getMaxLong()
For returning the minimum of all non noDataValues as a long |
java.math.BigInteger |
getMinBigInteger()
For returning the minimum of all non noDataValues as a BigInteger |
double |
getMinDouble()
For returning the minimum of all non noDataValues as a double If this.minBigDecimal is to big/small to represent as a double then an Arithmetic Exception is thrown and Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY are returned as appropriate. |
int |
getMinInt()
For returning the minimum of all non noDataValues as a int |
long |
getMinLong()
For returning the minimum of all non noDataValues as a long |
java.lang.Object |
getMode()
For returning the mode of all non noDataValues either as a TDoubleHashSet or as a TIntHashSet respectively depending on if ( this.grid2DSquareCell.getClass() == Grid2DSquareCellInt.class ) or if ( this.grid2DSquareCell.getClass() == Grid2DSquareCellDouble.class ). |
abstract java.lang.String |
getName()
Returns the name of this instasnced |
int |
getNonNoDataValueCountInt()
For returning the number of cells with noDataValues as a int |
long |
getNonNoDataValueCountLong()
For returning the number of cells with noDataValues as a long |
java.math.BigDecimal |
getStandardDeviationBigDecimal(int numberOfDecimalPlaces)
Returns the standard deviation of all non noDataValues as a double. |
java.math.BigInteger |
getSumBigInteger()
For returning the sum of all non noDataValues as a BigInteger |
double |
getSumDouble()
For returning the sum of all non noDataValues as a double. |
int |
getSumInt()
For returning the sum of all non noDataValues as a int |
long |
getSumLong()
For returning the sum of all non noDataValues as a long |
protected void |
init()
For intitialisation |
protected void |
init(Grid2DSquareCellAbstract grid2DSquareCell)
For intitialisation |
java.lang.String |
toString()
Returns a string describing this instance |
abstract void |
update()
Updates fields (statistics) by going through all values in this.grid2DSquareCellAbstract if they might not be up to date. |
protected void |
update(GridStatisticsAbstract gridStatistics)
Updates fields from gridStatistics except this.grid2DSquareCell |
protected void |
update(long nrows,
long ncols)
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.utilities.ErrorHandler |
---|
clearMemoryReserve, initMemoryReserve, initMemoryReserve |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface uk.ac.leeds.ccg.andyt.grids.core.GridStatisticsInterface |
---|
getArithmeticMeanBigDecimal, getMaxBigDecimal, getMinBigDecimal, getNonNoDataValueCountBigInteger, getSumBigDecimal |
Field Detail |
---|
protected Grid2DSquareCellAbstract grid2DSquareCell
protected java.math.BigInteger nonNoDataValueCountBigInteger
protected java.math.BigDecimal sumBigDecimal
protected java.math.BigDecimal minBigDecimal
protected java.math.BigInteger minCountBigInteger
protected java.math.BigDecimal maxBigDecimal
protected java.math.BigInteger maxCountBigInteger
Constructor Detail |
---|
public GridStatisticsAbstract()
Method Detail |
---|
protected void init()
protected void init(Grid2DSquareCellAbstract grid2DSquareCell)
protected void update(GridStatisticsAbstract gridStatistics)
gridStatistics
- the gridStatistics instance which fields are used
to update this.public abstract void update()
protected void update(long nrows, long ncols)
nrows
- The number of rows in the grid.ncols
- The number of columns in the grid.public abstract java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public final long getNonNoDataValueCountLong()
getNonNoDataValueCountLong
in interface GridStatisticsInterface
public final int getNonNoDataValueCountInt()
getNonNoDataValueCountInt
in interface GridStatisticsInterface
public final java.math.BigInteger getSumBigInteger()
getSumBigInteger
in interface GridStatisticsInterface
public final double getSumDouble()
getSumDouble
in interface GridStatisticsInterface
public final long getSumLong()
getSumLong
in interface GridStatisticsInterface
public int getSumInt()
getSumInt
in interface GridStatisticsInterface
public final java.math.BigInteger getMinBigInteger()
getMinBigInteger
in interface GridStatisticsInterface
public final double getMinDouble()
getMinDouble
in interface GridStatisticsInterface
public final long getMinLong()
getMinLong
in interface GridStatisticsInterface
public final int getMinInt()
getMinInt
in interface GridStatisticsInterface
public final java.math.BigInteger getMaxBigInteger()
getMaxBigInteger
in interface GridStatisticsInterface
public final double getMaxDouble()
getMaxDouble
in interface GridStatisticsInterface
public final long getMaxLong()
getMaxLong
in interface GridStatisticsInterface
public final int getMaxInt()
getMaxInt
in interface GridStatisticsInterface
public java.lang.Object getMode()
public static long count(Grid2DSquareCellInt grid2DSquareCellInt, long row, long col, long nrows, long ncols, int value)
row
- The row index of the cell from which counting startscol
- The column index of the cell from which counting startsnrows
- The number of rows in grid2DSquareCellInt.ncols
- The number of columns in grid2DSquareCellInt.value
- The value to be counted.public static long count(Grid2DSquareCellDouble grid2DSquareCellDouble, long row, long col, long nrows, long ncols, double value)
row
- The row index of the cell from which counting startscol
- The column index of the cell from which counting startsnrows
- The number of rows in grid2DSquareCellInt.ncols
- The number of columns in grid2DSquareCellInt.value
- The value to be counted.public java.math.BigDecimal getStandardDeviationBigDecimal(int numberOfDecimalPlaces)
numberOfDecimalPlaces
- The number of places for which the standard
deviation will be correct.
TODO:
test
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |