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

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.Grid2DSquareCellIntChunkArray
All Implemented Interfaces:
java.io.Serializable

public class Grid2DSquareCellIntChunkArray
extends Grid2DSquareCellIntChunkAbstract
implements java.io.Serializable

Grid2DSquareCellIntChunkAbstract extension that stores cell values in a int[][].

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, isSwapUpToDate
 
Constructor Summary
  Grid2DSquareCellIntChunkArray()
          Default constructor
protected Grid2DSquareCellIntChunkArray(Grid2DSquareCellIntChunkAbstract grid2DSquareCellIntChunk, Grid2DSquareCellAbstract.ChunkID chunkID)
          TODO: 1.
protected Grid2DSquareCellIntChunkArray(Grid2DSquareCellInt grid2DSquareCellInt, Grid2DSquareCellAbstract.ChunkID chunkID)
          Creates a new Grid2DSquareCellInt grid containing all no data values.
 
Method Summary
protected  void clearData()
          Clears the data associated with this.
protected  int getCell(int chunkCellRowIndex, int chunkCellColIndex, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.
protected  int[][] getData()
          Returns this.data.
protected  void initCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToInitialise)
          Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex.
protected  void initData()
          Initialises the data associated with this.
protected  IteratorAbstract iterator()
          Returns a Grid2DSquareCellIntChunkArrayIterator for iterating over the cells in this.
protected  int setCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToSet, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex and sets it to valueToSet
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntChunkAbstract
getArithmeticMeanBigDecimal, getArithmeticMeanBigDecimal, getArithmeticMeanDouble, getArithmeticMeanDouble, getCell, getCellDouble, getGrid2DSquareCellInt, getMaxInt, getMaxInt, getMedianDouble, getMedianDouble, getMinInt, getMinInt, getModeTIntHashSet, getModeTIntHashSet, getNonNoDataValueCountBigInteger, getNonNoDataValueCountBigInteger, getNonNoDataValueCountInt, getNonNoDataValueCountInt, getStandardDeviationDouble, getStandardDeviationDouble, getSumBigDecimal, getSumBigDecimal, initCell, initCells, initCells, setCell, sort1, toArrayIncludingNoDataValues, toArrayIncludingNoDataValues, toArrayNotIncludingNoDataValues, toArrayNotIncludingNoDataValues
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
getChunkID, getChunkID, getDescription, getGrid2DSquareCell, getGrid2DSquareCell, getIsSwapUpToDate, getIsSwapUpToDate, getName, getName, inChunk, inChunk, initChunkID, initGrid2DSquareCell, iterator, setIsSwapUpToDate, setIsSwapUpToDate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid2DSquareCellIntChunkArray

public Grid2DSquareCellIntChunkArray()
Default constructor


Grid2DSquareCellIntChunkArray

protected Grid2DSquareCellIntChunkArray(Grid2DSquareCellInt grid2DSquareCellInt,
                                        Grid2DSquareCellAbstract.ChunkID chunkID)
Creates a new Grid2DSquareCellInt grid containing all no data values.

Parameters:
grid2DSquareCellInt -
chunkID -

Grid2DSquareCellIntChunkArray

protected Grid2DSquareCellIntChunkArray(Grid2DSquareCellIntChunkAbstract grid2DSquareCellIntChunk,
                                        Grid2DSquareCellAbstract.ChunkID chunkID)
TODO: 1. docs 2. A fast toArray() method in Grid2DSquareCellIntChunkMap could be coded then a constructor based on an int[] or int[][] might be faster?

Method Detail

initData

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

Specified by:
initData in class Grid2DSquareCellIntChunkAbstract

getData

protected int[][] getData()
Returns this.data. TODO: Should the array be copied and the copy returned?


clearData

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

Specified by:
clearData in class Grid2DSquareCellIntChunkAbstract

getCell

protected 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

protected int setCell(int chunkCellRowIndex,
                      int chunkCellColIndex,
                      int valueToSet,
                      int noDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row 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

iterator

protected IteratorAbstract iterator()
Returns a Grid2DSquareCellIntChunkArrayIterator for iterating over the cells in this.

Specified by:
iterator in class Grid2DSquareCellChunkAbstract