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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
      extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntChunkAbstract
          extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntChunk64CellMap
All Implemented Interfaces:
java.io.Serializable

public class Grid2DSquareCellIntChunk64CellMap
extends Grid2DSquareCellIntChunkAbstract

The maximum size of this Grid2DSquareCellIntChunkAbstract is 64 cells.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
Grid2DSquareCellChunkAbstract.ChunkCellID
 
Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
chunkID, grid2DSquareCell
 
Constructor Summary
protected Grid2DSquareCellIntChunk64CellMap()
          Default constructor.
protected Grid2DSquareCellIntChunk64CellMap(Grid2DSquareCellIntChunkAbstract grid2DSquareCellIntChunk, Grid2DSquareCellAbstract.ChunkID chunkID)
          TODO: docs
protected Grid2DSquareCellIntChunk64CellMap(Grid2DSquareCellInt grid2DSquareCellInt, Grid2DSquareCellAbstract.ChunkID chunkID)
          TODO: docs
 
Method Summary
 void clearData()
          Clears the data associated with this.
 java.math.BigDecimal getArithmeticMeanBigDecimal()
          For returning the Arithmetic Mean of all non noDataValues as a BigDecimal.
 int getCell(int chunkCellRowIndex, int chunkCellColIndex, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.
 gnu.trove.TIntLongHashMap getData()
          Returns this.data
 java.math.BigInteger getDiversity()
          For returning the number of different values.
 java.math.BigDecimal getGeometricMeanBigDecimal()
          For returning the Geometric Mean of all non noDataValues as a BigDecimal Warning! This is imprecise and it can happen that Math.pow does not return what might be expected! (For example, negative powers in the range (0,1) for negative numbers.) TODO: Develop a pow function such as com.ibm.icu.math.BigDecimal.pow This resource is not used here due to licensing, but it could be...
 java.math.BigDecimal getHarmonicMeanBigDecimal()
          Returns the Harmonic Mean of all non noDataValues as a BigDecimal.
 int getMaxInt()
          For returning the maximum of all non noDataValues as a int.
 double getMedianDouble()
          For returning the median of all non noDataValues as a double
 int getMinInt()
          For returning the minimum of all non noDataValues as a int.
 gnu.trove.TIntHashSet getModeTIntHashSet()
          For returning the mode of all non noDataValues as a TDoubleHashSet
 java.math.BigInteger getNonNoDataValueCountBigInteger()
          Returns the number of cells with noDataValues as a BigInteger
 int getNonNoDataValueCountInt()
          Returns the number of cells with noDataValues as an int
 double getStandardDeviationDouble()
          For returning the standard deviation of all non noDataValues as a double
 java.math.BigDecimal getSumBigDecimal()
          For returning the sum of all non noDataValues as a BigDecimal
protected  void initCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToInitialise)
          Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex.
 void initData()
          Initialises the data associated with this.
 AbstractIterator iterator()
          Returns a Grid2DSquareCellIntChunk64CellMapIterator for iterating over the cells in this.
 long powerOf2(int value)
          Returns 2 raised to the power of value as a long.
 int setCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToSet, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex and sets it to valueToSet
 int[] toArrayIncludingNoDataValues()
          TODO: docs
 int[] toArrayNotIncludingNoDataValues()
          TODO: docs
 java.lang.String toString()
          Returns a description of this.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntChunkAbstract
getArithmeticMeanDouble, getCellDouble, getGrid2DSquareCellInt, initCells, sort1
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
getChunkID, getGrid2DSquareCell, getName, inChunk, initChunkID, initGrid2DSquareCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Grid2DSquareCellIntChunk64CellMap

protected Grid2DSquareCellIntChunk64CellMap()
Default constructor.


Grid2DSquareCellIntChunk64CellMap

protected Grid2DSquareCellIntChunk64CellMap(Grid2DSquareCellInt grid2DSquareCellInt,
                                            Grid2DSquareCellAbstract.ChunkID chunkID)
TODO: docs


Grid2DSquareCellIntChunk64CellMap

protected Grid2DSquareCellIntChunk64CellMap(Grid2DSquareCellIntChunkAbstract grid2DSquareCellIntChunk,
                                            Grid2DSquareCellAbstract.ChunkID chunkID)
TODO: docs

Method Detail

toString

public java.lang.String toString()
Returns a description of this.

Specified by:
toString in class Grid2DSquareCellChunkAbstract

initData

public void initData()
Initialises the data associated with this.

Specified by:
initData in class Grid2DSquareCellIntChunkAbstract

clearData

public void clearData()
Clears the data associated with this.

Specified by:
clearData in class Grid2DSquareCellIntChunkAbstract

getData

public gnu.trove.TIntLongHashMap getData()
Returns this.data


toArrayIncludingNoDataValues

public int[] toArrayIncludingNoDataValues()
TODO: docs

Overrides:
toArrayIncludingNoDataValues in class Grid2DSquareCellIntChunkAbstract

toArrayNotIncludingNoDataValues

public int[] toArrayNotIncludingNoDataValues()
TODO: docs

Overrides:
toArrayNotIncludingNoDataValues in class Grid2DSquareCellIntChunkAbstract

getCell

public int getCell(int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int noDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.

Specified by:
getCell in class Grid2DSquareCellIntChunkAbstract
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
noDataValue - the noDataValue of this.grid2DSquareCellInt

initCell

protected void initCell(int chunkCellRowIndex,
                        int chunkCellColIndex,
                        int valueToInitialise)
Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex. Utility method for constructor.

Specified by:
initCell in class Grid2DSquareCellIntChunkAbstract
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
valueToInitialise - the value with which the cell is initialised

setCell

public int setCell(int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int valueToSet,
                   int noDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex and sets it to valueToSet

Specified by:
setCell in class Grid2DSquareCellIntChunkAbstract
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
valueToSet - the value the cell is to be set to
noDataValue - the noDataValue of this.grid2DSquareCellInt

powerOf2

public long powerOf2(int value)
Returns 2 raised to the power of value as a long. TODO: move this to the chunk master and have as a long[]. The look up should be faster than the creation on the fly.


getNonNoDataValueCountBigInteger

public java.math.BigInteger getNonNoDataValueCountBigInteger()
Returns the number of cells with noDataValues as a BigInteger

Overrides:
getNonNoDataValueCountBigInteger in class Grid2DSquareCellIntChunkAbstract

getNonNoDataValueCountInt

public int getNonNoDataValueCountInt()
Returns the number of cells with noDataValues as an int

Overrides:
getNonNoDataValueCountInt in class Grid2DSquareCellIntChunkAbstract

getSumBigDecimal

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

Overrides:
getSumBigDecimal in class Grid2DSquareCellIntChunkAbstract

getMinInt

public int getMinInt()
For returning the minimum of all non noDataValues as a int.

Overrides:
getMinInt in class Grid2DSquareCellIntChunkAbstract

getMaxInt

public int getMaxInt()
For returning the maximum of all non noDataValues as a int.

Overrides:
getMaxInt in class Grid2DSquareCellIntChunkAbstract

getArithmeticMeanBigDecimal

public java.math.BigDecimal getArithmeticMeanBigDecimal()
For returning the Arithmetic Mean of all non noDataValues as a BigDecimal. Using BigDecimal this should be as precise as possible with doubles.


getGeometricMeanBigDecimal

public java.math.BigDecimal getGeometricMeanBigDecimal()
For returning the Geometric Mean of all non noDataValues as a BigDecimal Warning! This is imprecise and it can happen that Math.pow does not return what might be expected! (For example, negative powers in the range (0,1) for negative numbers.) TODO: Develop a pow function such as com.ibm.icu.math.BigDecimal.pow This resource is not used here due to licensing, but it could be...


getHarmonicMeanBigDecimal

public java.math.BigDecimal getHarmonicMeanBigDecimal()
Returns the Harmonic Mean of all non noDataValues as a BigDecimal. Zero values are ignored in the calculation.


getModeTIntHashSet

public gnu.trove.TIntHashSet getModeTIntHashSet()
For returning the mode of all non noDataValues as a TDoubleHashSet

Overrides:
getModeTIntHashSet in class Grid2DSquareCellIntChunkAbstract

getMedianDouble

public double getMedianDouble()
For returning the median of all non noDataValues as a double

Overrides:
getMedianDouble in class Grid2DSquareCellIntChunkAbstract

getStandardDeviationDouble

public double getStandardDeviationDouble()
For returning the standard deviation of all non noDataValues as a double

Overrides:
getStandardDeviationDouble in class Grid2DSquareCellIntChunkAbstract

getDiversity

public java.math.BigInteger getDiversity()
For returning the number of different values.


iterator

public AbstractIterator iterator()
Returns a Grid2DSquareCellIntChunk64CellMapIterator for iterating over the cells in this.

Specified by:
iterator in class Grid2DSquareCellChunkAbstract