|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.leeds.ccg.andyt.grids.core.AbstractGridStatistics
public abstract class AbstractGridStatistics
An abstract class to be extended and methods overridden to provide statistics about the data in AbstractGrid2DSquareCell and Grid2DSquareCellChunkAbstract more optimally.
| Field Summary | |
|---|---|
protected AbstractGrid2DSquareCell |
_Grid2DSquareCell
A reference to the AbstractGrid2DSquareCell 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. |
| Constructor Summary | |
|---|---|
AbstractGridStatistics()
|
|
| Method Summary | |
|---|---|
protected 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. |
long |
count(Grid2DSquareCellDouble grid2DSquareCellDouble,
long row,
long col,
long _NRows,
long _NCols,
double value,
boolean handleOutOfMemoryError)
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. |
protected 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. |
long |
count(Grid2DSquareCellInt grid2DSquareCellInt,
long row,
long col,
long _NRows,
long _NCols,
int value,
boolean handleOutOfMemoryError)
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. |
protected abstract java.math.BigDecimal |
getArithmeticMeanBigDecimal(int numberOfDecimalPlaces)
For returning the arithmetic mean of all non noDataValues as a BigDecimal |
java.math.BigDecimal |
getArithmeticMeanBigDecimal(int numberOfDecimalPlaces,
boolean handleOutOfMemoryError)
For returning the arithmetic mean of all non noDataValues as a BigDecimal |
protected java.lang.String |
getDescription()
Returns a string describing this instance |
protected abstract java.math.BigDecimal |
getMaxBigDecimal()
For returning the maximum of all non noDataValues as a BigInteger. |
java.math.BigDecimal |
getMaxBigDecimal(boolean handleOutOfMemoryError)
For returning the maximum of all non noDataValues as a BigDecimal. |
protected java.math.BigInteger |
getMaxBigInteger()
For returning the maximum of all non noDataValues as a BigInteger. |
java.math.BigInteger |
getMaxBigInteger(boolean handleOutOfMemoryError)
For returning the maximum of all non noDataValues as a BigInteger. |
protected double |
getMaxDouble()
For returning the maximum of all non noDataValues as a double. |
double |
getMaxDouble(boolean handleOutOfMemoryError)
For returning the maximum of all non noDataValues as a double. |
protected int |
getMaxInt()
For returning the minimum of all non noDataValues as a int. |
int |
getMaxInt(boolean handleOutOfMemoryError)
For returning the maximum of all non noDataValues as a int. |
protected long |
getMaxLong()
For returning the minimum of all non noDataValues as a long. |
long |
getMaxLong(boolean handleOutOfMemoryError)
For returning the maximum of all non noDataValues as a long. |
protected abstract java.math.BigDecimal |
getMinBigDecimal()
For returning the minimum of all non noDataValues as a BigInteger. |
java.math.BigDecimal |
getMinBigDecimal(boolean handleOutOfMemoryError)
For returning the minimum of all non noDataValues as a BigDecimal. |
protected java.math.BigInteger |
getMinBigInteger()
For returning the minimum of all non noDataValues as a BigInteger. |
java.math.BigInteger |
getMinBigInteger(boolean handleOutOfMemoryError)
For returning the minimum of all non noDataValues as a BigInteger. |
protected double |
getMinDouble()
For returning the minimum of all non noDataValues as a double. |
double |
getMinDouble(boolean handleOutOfMemoryError)
For returning the minimum of all non noDataValues as a double. |
protected int |
getMinInt()
For returning the minimum of all non noDataValues as a int. |
int |
getMinInt(boolean handleOutOfMemoryError)
For returning the minimum of all non noDataValues as a int. |
protected long |
getMinLong()
For returning the minimum of all non noDataValues as a long |
long |
getMinLong(boolean handleOutOfMemoryError)
For returning the minimum of all non noDataValues as a long. |
protected 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 ). |
protected java.lang.String |
getName()
Returns the name of the this class |
protected abstract java.math.BigInteger |
getNonNoDataValueCountBigInteger()
For returning the number of cells with noDataValues as a BigInteger. |
java.math.BigInteger |
getNonNoDataValueCountBigInteger(boolean handleOutOfMemoryError)
For returning the number of cells with noDataValues as a BigInteger. |
protected int |
getNonNoDataValueCountInt()
For returning the number of cells with noDataValues as a int. |
int |
getNonNoDataValueCountInt(boolean handleOutOfMemoryError)
For returning the number of cells with noDataValues as a int. |
protected long |
getNonNoDataValueCountLong()
For returning the number of cells with noDataValues as a long. |
long |
getNonNoDataValueCountLong(boolean handleOutOfMemoryError)
For returning the number of cells with noDataValues as a long. |
protected java.math.BigDecimal |
getStandardDeviationBigDecimal(int numberOfDecimalPlaces)
Returns the standard deviation of all non noDataValues as a double. |
java.math.BigDecimal |
getStandardDeviationBigDecimal(int numberOfDecimalPlaces,
boolean handleOutOfMemoryError)
Returns the standard deviation of all non noDataValues as a BigDecimal. |
protected abstract java.math.BigDecimal |
getSumBigDecimal()
For returning the sum of all non noDataValues as a BigDecimal. |
java.math.BigDecimal |
getSumBigDecimal(boolean handleOutOfMemoryError)
For returning the sum of all non noDataValues as a BigDecimal. |
protected java.math.BigInteger |
getSumBigInteger()
For returning the sum of all non noDataValues as a BigInteger. |
java.math.BigInteger |
getSumBigInteger(boolean handleOutOfMemoryError)
For returning the sum of all non noDataValues as a BigInteger. |
protected double |
getSumDouble()
For returning the sum of all non noDataValues as a double. |
double |
getSumDouble(boolean handleOutOfMemoryError)
For returning the sum of all non noDataValues as a double. |
protected int |
getSumInt()
For returning the sum of all non noDataValues as a int. |
int |
getSumInt(boolean handleOutOfMemoryError)
For returning the sum of all non noDataValues as a int. |
protected long |
getSumLong()
For returning the sum of all non noDataValues as a long. |
long |
getSumLong(boolean handleOutOfMemoryError)
For returning the sum of all non noDataValues as a long. |
protected void |
init()
For intitialisation |
protected void |
init(AbstractGrid2DSquareCell grid2DSquareCell)
For intitialisation |
java.lang.String |
toString(boolean handleOutOfMemoryError)
Returns a String describing this instance |
protected 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(AbstractGridStatistics _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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AbstractGrid2DSquareCell _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 AbstractGridStatistics()
| Method Detail |
|---|
protected void init()
protected void init(AbstractGrid2DSquareCell grid2DSquareCell)
protected void update(AbstractGridStatistics _GridStatistics)
_GridStatistics - the _GridStatistics instance which fields are used
to update this.protected 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 java.lang.String toString(boolean handleOutOfMemoryError)
handleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected java.lang.String getName()
protected java.lang.String getDescription()
public final java.math.BigInteger getNonNoDataValueCountBigInteger(boolean handleOutOfMemoryError)
getNonNoDataValueCountBigInteger in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected abstract java.math.BigInteger getNonNoDataValueCountBigInteger()
public final long getNonNoDataValueCountLong(boolean handleOutOfMemoryError)
getNonNoDataValueCountLong in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final long getNonNoDataValueCountLong()
public final int getNonNoDataValueCountInt(boolean handleOutOfMemoryError)
getNonNoDataValueCountInt in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final int getNonNoDataValueCountInt()
public final java.math.BigDecimal getSumBigDecimal(boolean handleOutOfMemoryError)
getSumBigDecimal in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected abstract java.math.BigDecimal getSumBigDecimal()
public final java.math.BigInteger getSumBigInteger(boolean handleOutOfMemoryError)
getSumBigInteger in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final java.math.BigInteger getSumBigInteger()
public final double getSumDouble(boolean handleOutOfMemoryError)
getSumDouble in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final double getSumDouble()
public final long getSumLong(boolean handleOutOfMemoryError)
getSumLong in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final long getSumLong()
public final int getSumInt(boolean handleOutOfMemoryError)
getSumInt in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected int getSumInt()
public final java.math.BigDecimal getMinBigDecimal(boolean handleOutOfMemoryError)
getMinBigDecimal in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected abstract java.math.BigDecimal getMinBigDecimal()
public final java.math.BigInteger getMinBigInteger(boolean handleOutOfMemoryError)
getMinBigInteger in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final java.math.BigInteger getMinBigInteger()
public final double getMinDouble(boolean handleOutOfMemoryError)
getMinDouble in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final double getMinDouble()
public final long getMinLong(boolean handleOutOfMemoryError)
getMinLong in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final long getMinLong()
public final int getMinInt(boolean handleOutOfMemoryError)
getMinInt in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final int getMinInt()
public final java.math.BigInteger getMaxBigInteger(boolean handleOutOfMemoryError)
getMaxBigInteger in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final java.math.BigInteger getMaxBigInteger()
public final java.math.BigDecimal getMaxBigDecimal(boolean handleOutOfMemoryError)
getMaxBigDecimal in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected abstract java.math.BigDecimal getMaxBigDecimal()
public final double getMaxDouble(boolean handleOutOfMemoryError)
getMaxDouble in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final double getMaxDouble()
public final long getMaxLong(boolean handleOutOfMemoryError)
getMaxLong in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final long getMaxLong()
public final int getMaxInt(boolean handleOutOfMemoryError)
getMaxInt in interface GridStatisticsInterfacehandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected final int getMaxInt()
protected java.lang.Object getMode()
public long count(Grid2DSquareCellInt grid2DSquareCellInt,
long row,
long col,
long _NRows,
long _NCols,
int value,
boolean handleOutOfMemoryError)
row - The row index of the cell from which counting startscol - The column index of the cell from which counting starts_NRows - The number of rows in grid2DSquareCellInt._NCols - The number of columns in grid2DSquareCellInt.value - The value to be counted.handleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.
protected 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 starts_NRows - The number of rows in grid2DSquareCellInt._NCols - The number of columns in grid2DSquareCellInt.value - The value to be counted.
public long count(Grid2DSquareCellDouble grid2DSquareCellDouble,
long row,
long col,
long _NRows,
long _NCols,
double value,
boolean handleOutOfMemoryError)
row - The row index of the cell from which counting startscol - The column index of the cell from which counting starts_NRows - The number of rows in grid2DSquareCellInt._NCols - The number of columns in grid2DSquareCellInt.value - The value to be counted.handleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.
protected 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 starts_NRows - The number of rows in grid2DSquareCellInt._NCols - The number of columns in grid2DSquareCellInt.value - The value to be counted.
public java.math.BigDecimal getArithmeticMeanBigDecimal(int numberOfDecimalPlaces,
boolean handleOutOfMemoryError)
getArithmeticMeanBigDecimal in interface GridStatisticsInterfacenumberOfDecimalPlaces - The number of places for which the standard
deviation will be correct.handleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected abstract java.math.BigDecimal getArithmeticMeanBigDecimal(int numberOfDecimalPlaces)
numberOfDecimalPlaces - The number of decimal places to which
the result is precise.
public java.math.BigDecimal getStandardDeviationBigDecimal(int numberOfDecimalPlaces,
boolean handleOutOfMemoryError)
numberOfDecimalPlaces - The number of places for which the standard
deviation will be correct.handleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected 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 | |||||||||