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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
      extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellAbstract
          extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellInt
All Implemented Interfaces:
java.io.Serializable

public class Grid2DSquareCellInt
extends Grid2DSquareCellAbstract
implements java.io.Serializable

A class to represent and manipulate int precision Grid2DSquareCellAbstract instances.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellAbstract
Grid2DSquareCellAbstract.CellID, Grid2DSquareCellAbstract.ChunkID
 
Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellAbstract
chunkNcols, chunkNrows, dimensions, dimensionsScale, directory, grid2DSquareCellChunks, grid2DSquareCells, gridStatistics, name, nChunkCols, nChunkRows, ncols, nrows, unsignedLongPowersOf2
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve
 
Constructor Summary
  Grid2DSquareCellInt()
          Creates a new Grid2DSquareCellInt
protected Grid2DSquareCellInt(java.io.File directory, java.io.File gridFile, java.io.ObjectInputStream ois, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt.
protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt with values obtained from gridFile.
protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt based on values in grid2DSquareCell.
protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long nrows, long ncols, java.math.BigDecimal[] dimensions, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt with each cell value equal to Integer.MinValue.
 
Method Summary
 int addToCell(double x, double y, int valueToAdd)
          Returns current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.
 int addToCell(double x, double y, int valueToAdd, boolean handleOutOfMemoryError)
          Returns current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.
 int addToCell(Grid2DSquareCellAbstract.CellID cellID, int valueToAdd)
          Returns the value of the cell with cell ID cellID and adds valueToAdd to that cell.
 int addToCell(Grid2DSquareCellAbstract.CellID cellID, int valueToAdd, boolean handleOutOfMemoryError)
          Returns the value of the cell with cell ID cellID and adds valueToAdd to that cell.
 int addToCell(long cellRowIndex, long cellColIndex, int valueToAdd)
          Returns current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.
 int addToCell(long cellRowIndex, long cellColIndex, int valueToAdd, boolean handleOutOfMemoryError)
          Returns current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.
 int getCell(double x, double y)
          For returning the value of the cell containing point given by x-coordinate x, y-coordinate y as a int.
 int getCell(double x, double y, boolean handleOutOfMemoryError)
          For returning the value of the cell containing point given by x-coordinate x, y-coordinate y as a int.
 int getCell(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
          For returning the value of the cell with cell ID cellID as a int.
 int getCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
          Returns the value at position given by chunk row index chunkRowIndex, chunk column index chunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.
 int getCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
          Returns the value at position given by chunk row index chunkRowIndex, chunk column index chunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.
protected  int getCell(long cellRowIndex, long cellColIndex)
          Returns the value at cellRowIndex, cellColIndex else returns noDataValue.
 int getCell(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
          Returns the value at cellRowIndex, cellColIndex else returns noDataValue.
 int[] getCells(double x, double y, double distance)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.
 int[] getCells(double x, double y, double distance, boolean handleOutOfMemoryError)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.
protected  int[] getCells(double x, double y, long cellRowIndex, long cellColIndex, double distance)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.
protected  int[] getCells(double x, double y, long cellRowIndex, long cellColIndex, double distance, boolean handleOutOfMemoryError)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.
 int[] getCells(long cellRowIndex, long cellColIndex, double distance)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at centroid of cell given by cell row index cellRowIndex, cell column index cellColIndex, and radius distance.
 int[] getCells(long cellRowIndex, long cellColIndex, double distance, boolean handleOutOfMemoryError)
          Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at centroid of cell given by cell row index cellRowIndex, cell column index cellColIndex, and radius distance.
 Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(Grid2DSquareCellAbstract.ChunkID chunkID)
          Returns grid2DSquareCellIntChunksAbstract for the given ChunkID
 Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
          Returns grid2DSquareCellIntChunksAbstract for the given ChunkID
 Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(int chunkRowIndex, int chunkColIndex)
          Returns grid2DSquareCellIntChunks.
 Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(int chunkRowIndex, int chunkColIndex, boolean handleOutOfMemoryError)
          Returns grid2DSquareCellIntChunks.
 double getNearestValueDouble(double x, double y)
          Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y as a double.
 double getNearestValueDouble(double x, double y, boolean handleOutOfMemoryError)
          Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y as a double.
protected  double getNearestValueDouble(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue)
          Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex as a double.
protected  double getNearestValueDouble(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue, boolean handleOutOfMemoryError)
          Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex as a double.
 double getNearestValueDouble(long cellRowIndex, long cellColIndex)
          Returns the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.
 double getNearestValueDouble(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
          Returns the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.
 double getNearestValueDoubleDistance(double x, double y)
          Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.
 double getNearestValueDoubleDistance(double x, double y, boolean handleOutOfMemoryError)
          Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.
protected  double getNearestValueDoubleDistance(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue)
          Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex.
protected  double getNearestValueDoubleDistance(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue, boolean handleOutOfMemoryError)
          Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex.
 double getNearestValueDoubleDistance(long cellRowIndex, long cellColIndex)
          Returns the distance to the nearest data value from position given by row index rowIndex, column index colIndex.
 double getNearestValueDoubleDistance(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
          Returns the distance to the nearest data value from position given by row index rowIndex, column index colIndex.
 Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x, double y)
          Returns a CellID[] - The CellIDs of the nearest cells with data values to point given by x-coordinate x, y-coordinate y.
 Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x, double y, boolean handleOutOfMemoryError)
          Returns a CellID[] - The CellIDs of the nearest cells with data values to point given by x-coordinate x, y-coordinate y.
protected  Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue)
          Returns a CellID[] - The CellIDs of the nearest cells with data values nearest to point with position given by: x-coordinate x, y-coordinate y; and, cell row index cellRowIndex, cell column index cellColIndex.
protected  Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x, double y, long cellRowIndex, long cellColIndex, int noDataValue, boolean handleOutOfMemoryError)
          Returns a CellID[] - The CellIDs of the nearest cells with data values nearest to point with position given by: x-coordinate x, y-coordinate y; and, cell row index cellRowIndex, cell column index cellColIndex.
 Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(long cellRowIndex, long cellColIndex)
          Returns a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.
 Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
          Returns a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.
protected  int getNoDataValue()
          Returns this noDataValue Integer.MIN_VALUE.
 int getNoDataValue(boolean handleOutOfMemoryError)
          Returns this.noDataValue.
 java.math.BigDecimal getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
          Returns the this.noDataValue converted to a BigDecimal.
protected  void initCell(long cellRowIndex, long cellColIndex, int valueToInitialise)
          Initilises the value at cellRowIndex, cellColIndex
protected  void initCell(long cellRowIndex, long cellColIndex, int valueToInitialise, boolean handleOutOfMemoryError)
          Initilises the value at cellRowIndex, cellColIndex
protected  void initCellFast(long cellRowIndex, long cellColIndex, int valueToInitialise)
          Initilises the value at cellRowIndex, cellColIndex and does nothing about this.gridStatistics
protected  void initCellFast(long cellRowIndex, long cellColIndex, int valueToInitialise, boolean handleOutOfMemoryError)
          Initilises the value at cellRowIndex, cellColIndex and does nothing about this.gridStatistics
protected  void initGrid2DSquareCellInt(Grid2DSquareCellInt grid2DSquareCellInt, boolean initTransientFields)
          Initialises this.
protected  void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, boolean handleOutOfMemoryError)
          Initialises this.
protected  void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Initialises this.
protected  void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Initialises this.
protected  void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.util.HashSet grid2DSquareCells, boolean handleOutOfMemoryError)
          Initialise this.
 java.util.Iterator iterator(boolean handleOutOfMemoryError)
          Returns an iterator over the cell value in this.
 int setCell(double x, double y, int newValue)
          For returning the value at x-coordinate x, y-coordinate y and setting it to newValue.
 int setCell(double x, double y, int newValue, boolean handleOutOfMemoryError)
          For returning the value at x-coordinate x, y-coordinate y and setting it to newValue.
 int setCell(Grid2DSquareCellAbstract.CellID cellID, int newValue, boolean handleOutOfMemoryError)
          For returning the value of the cell with cell ID cellID and setting it to newValue.
 int setCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue)
          Returns the value at cellRowIndex, cellColIndex and sets it to newValue.
 int setCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue, boolean handleOutOfMemoryError)
          Returns the value at cellRowIndex, cellColIndex and sets it to newValue.
 int setCell(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue)
          For returning the value of the cell in chunk given by chunkRowIndex and chunkColIndex and cell in the chunk given by chunkCellColIndex and chunkCellRowIndex and setting it to newValue.
 int setCell(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue, boolean handleOutOfMemoryError)
          For returning the value of the cell in chunk given by chunkRowIndex and chunkColIndex and cell in the chunk given by chunkCellColIndex and chunkCellRowIndex and setting it to newValue.
 double setCell(long cellRowIndex, long cellColIndex, double newValue)
          For returning the value at cellRowIndex, cellColIndex as a double and setting it to ( int ) newValue.
 double setCell(long cellRowIndex, long cellColIndex, double newValue, boolean handleOutOfMemoryError)
          For returning the value at cellRowIndex, cellColIndex as a double and setting it to ( int ) newValue.
 int setCell(long cellRowIndex, long cellColIndex, int newValue)
          For returning the value at cellRowIndex, cellColIndex and setting it to newValue.
 int setCell(long cellRowIndex, long cellColIndex, int newValue, boolean handleOutOfMemoryError)
          For returning the value at cellRowIndex, cellColIndex and setting it to newValue.
 java.lang.String toString(boolean handleOutOfMemoryError)
          Returns a string description of the instance.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellAbstract
clearFromCacheGrid2DSquareCellChunk, clearFromCacheGrid2DSquareCellChunk, clearFromCacheGrid2DSquareCellChunkExcept, clearFromCacheGrid2DSquareCellChunkExcept, clearFromCacheGrid2DSquareCellChunks, clearFromCacheGrid2DSquareCellChunks, clearFromCacheGrid2DSquareCellChunks, clearFromCacheGrid2DSquareCellChunks, clearFromCacheGrid2DSquareCellChunksExcept, clearFromCacheGrid2DSquareCellChunksExcept, clearFromCacheGrid2DSquareCellChunksExcept, clearFromCacheGrid2DSquareCellChunksExcept, getBasicDescription, getBasicDescription, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellColIndex, getCellColIndex, getCellColIndex, getCellColIndex, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellDouble, getCellID, getCellID, getCellID, getCellID, getCellIDs, getCellIDs, getCellIDs, getCellIDs, getCellIDs, getCellIDs, getCellInt, getCellInt, getCellInt, getCellInt, getCellInt, getCellInt, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellsizeDouble, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getChunkCellColIndex, getChunkCellColIndex, getChunkCellColIndex, getChunkCellColIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkColIndex, getChunkColIndex, getChunkColIndex, getChunkColIndex, getChunkNcols, getChunkNcols, getChunkNcols, getChunkNcols, getChunkNcols, getChunkNcolsFinalColChunks, getChunkNcolsFinalColChunks, getChunkNrows, getChunkNrows, getChunkNrows, getChunkNrows, getChunkNrows, getChunkNrowsFinalRowChunks, getChunkNrowsFinalRowChunks, getChunkRowIndex, getChunkRowIndex, getChunkRowIndex, getChunkRowIndex, getDimensions, getDimensionsScale, getDirectory, getDirectory, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCells, getGridBounds, getGridBounds, getGridStatistics, getHeightBigDecimal, getHeightBigDecimal, getHeightDouble, getHeightDouble, getName, getName, getNChunkCols, getNChunkRows, getNChunks, getNChunks, getNcols, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNextChunk, getNextChunk, getNextChunkRowMinor, getNextChunkRowMinor, getNrows, getPreviousChunk, getPreviousChunk, getWidthBigDecimal, getWidthBigDecimal, getWidthDouble, getWidthDouble, initDimensions, initGrid2DSquareCellAbstract, initGrid2DSquareCellAbstract, initGrid2DSquareCellChunks, initMemoryReserve, initNChunkCols, initNChunkRows, isInCache, isInCache, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, loadIntoCacheChunk, loadIntoCacheChunk, loadIntoCacheChunk, loadIntoCacheChunk, setChunk, setGrid2DSquareCells, setName, setName, swapToFileGrid2DSquareCellChunk, swapToFileGrid2DSquareCellChunk, swapToFileGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellChunks, swapToFileGrid2DSquareCellChunks, swapToFileGrid2DSquareCellChunks, swapToFileGrid2DSquareCellChunks, swapToFileGrid2DSquareCellChunksExcept, swapToFileGrid2DSquareCellChunksExcept, swapToFileGrid2DSquareCellsGrid2DSquareCellChunk, swapToFileGrid2DSquareCellsGrid2DSquareCellChunk, swapToFileGrid2DSquareCellsGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellsGrid2DSquareCellChunkExcept, swapToFileGrid2DSquareCellsGrid2DSquareCellChunks, swapToFileGrid2DSquareCellsGrid2DSquareCellChunks, swapToFileGrid2DSquareCellsGrid2DSquareCellChunksExcept, swapToFileGrid2DSquareCellsGrid2DSquareCellChunksExcept, toString, toString, writeToFile, writeToFile, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunkExcept, writeToFileGrid2DSquareCellChunkExcept, writeToFileGrid2DSquareCellChunkExcept, writeToFileGrid2DSquareCellChunkExcept, writeToFileGrid2DSquareCellChunkExceptReverseOrder, writeToFileGrid2DSquareCellChunkExceptReverseOrder, writeToFileGrid2DSquareCellChunkExceptReverseOrder, writeToFileGrid2DSquareCellChunkExceptReverseOrder, writeToFileGrid2DSquareCellChunks, writeToFileGrid2DSquareCellChunks, writeToFileGrid2DSquareCellChunks, writeToFileGrid2DSquareCellChunks, writeToFileGrid2DSquareCellChunksExcept, writeToFileGrid2DSquareCellChunksExcept, writeToFileGrid2DSquareCellChunksExcept, writeToFileGrid2DSquareCellChunksExcept
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
clearMemoryReserve, initMemoryReserve, initMemoryReserve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid2DSquareCellInt

public Grid2DSquareCellInt()
Creates a new Grid2DSquareCellInt


Grid2DSquareCellInt

protected Grid2DSquareCellInt(java.io.File directory,
                              java.io.File gridFile,
                              java.io.ObjectInputStream ois,
                              java.util.HashSet grid2DSquareCells,
                              boolean handleOutOfMemoryError)
Creates a new Grid2DSquareCellInt. Warning!! Concurrent modification may occur if directory is in use. If a completely new instance is wanted then use: Grid2DSquareCellInt( File, Grid2DSquareCellIntAbstract, Grid2DSquareCellIntChunkAbstractFactory, int, int, long, long, long, long, double, HashSet) which can be accessed via a Grid2DSquareCellIntFactory.

Parameters:
directory - The File directory to be used for swapping.
gridFile - The File directory containing the File names thisFile that the ois was constructed from.
ois - The ObjectInputStream used in first attempt to construct this.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.

Grid2DSquareCellInt

protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                              java.io.File directory,
                              Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                              int chunkNrows,
                              int chunkNcols,
                              long nrows,
                              long ncols,
                              java.math.BigDecimal[] dimensions,
                              java.util.HashSet grid2DSquareCells,
                              boolean handleOutOfMemoryError)
Creates a new Grid2DSquareCellInt with each cell value equal to Integer.MinValue. N.B. This method can be used to test which type of chunks are more efficient in different situations. If this becomes clear then it may be possible to automatically optimise chunk storage. Although, optimisiation is going to be difficult owing to the trade off between fast access and low memory.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany this.
directory - The File directory to be used for swapping.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered for creating chunks.
chunkNrows - The number of rows of cells in any chunk.
chunkNcols - The number of columns of cells in any chunk.
nrows - The number of rows of cells.
ncols - The number of columns of cells.
dimensions - The cellsize, xmin, ymin, xmax and ymax.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.

Grid2DSquareCellInt

protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                              java.io.File directory,
                              Grid2DSquareCellAbstract grid2DSquareCell,
                              Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                              int chunkNrows,
                              int chunkNcols,
                              long startRowIndex,
                              long startColIndex,
                              long endRowIndex,
                              long endColIndex,
                              java.util.HashSet grid2DSquareCells,
                              boolean handleOutOfMemoryError)
Creates a new Grid2DSquareCellInt based on values in grid2DSquareCell.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany this.
directory - The File directory to be used for swapping.
grid2DSquareCell - The Grid2DSquareCellAbstract from which this will be constructed.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
chunkNrows - The number of rows of cells in any chunk.
chunkNcols - The number of columns of cells in any chunk.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.

Grid2DSquareCellInt

protected Grid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                              java.io.File directory,
                              java.io.File gridFile,
                              Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                              int chunkNrows,
                              int chunkNcols,
                              long startRowIndex,
                              long startColIndex,
                              long endRowIndex,
                              long endColIndex,
                              java.util.HashSet grid2DSquareCells,
                              boolean handleOutOfMemoryError)
Creates a new Grid2DSquareCellInt with values obtained from gridFile. Currently gridFile must be a directory of a Grid2DSquareCellDouble or Grid2DSquareCellInt or a ESRI Asciigrid format Files with a name ending ".asc".

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany the returned grid.
directory - The File directory to be used for swapping.
gridFile - Either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellDouble to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.
Method Detail

toString

public java.lang.String toString(boolean handleOutOfMemoryError)
Returns a string description of the instance. Basically the values of each field.

Specified by:
toString in class Grid2DSquareCellAbstract
Parameters:
handleOutOfMemoryError - If true then OutOfMemoryErrors are caught in this method then caching operations are initiated prior to retrying. If false then OutOfMemoryErrors are caught and thrown.

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(Grid2DSquareCellInt grid2DSquareCellInt,
                                       boolean initTransientFields)
Initialises this.

Parameters:
grid2DSquareCellInt - The Grid2DSquareCellInt from which the fields of this are set.
initTransientFields - Iff true then transient fields of this are set with those of grid2DSquareCellInt.

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                       java.io.File directory,
                                       Grid2DSquareCellAbstract grid2DSquareCell,
                                       Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                       int chunkNrows,
                                       int chunkNcols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex,
                                       java.util.HashSet grid2DSquareCells,
                                       boolean handleOutOfMemoryError)
Initialise this.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany this.
directory - The File directory to be used for swapping.
grid2DSquareCell - The Grid2DSquareCellAbstract from which this will be constructed.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
chunkNrows - The number of rows of cells in any chunk.
chunkNcols - The number of columns of cells in any chunk.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.
See Also:
initGrid2DSquareCellInt( GridStatisticsAbstract, File, Grid2DSquareCellAbstract, Grid2DSquareCellIntChunkAbstractFactory, int, int, long, long, long, long, HashSet, boolean )

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                       java.io.File directory,
                                       Grid2DSquareCellAbstract grid2DSquareCell,
                                       Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                       int chunkNrows,
                                       int chunkNcols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex)
Initialises this.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany this.
directory - The File directory to be used for swapping.
grid2DSquareCell - The Grid2DSquareCellAbstract from which this will be constructed.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
chunkNrows - The number of rows of cells in any chunk.
chunkNcols - The number of columns of cells in any chunk.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
See Also:
initGrid2DSquareCellInt( GridStatisticsAbstract, File, Grid2DSquareCellAbstract, Grid2DSquareCellIntChunkAbstractFactory, int, int, long, long, long, long, HashSet, boolean )

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                       java.io.File directory,
                                       java.io.File gridFile,
                                       Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                       int chunkNrows,
                                       int chunkNcols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex,
                                       java.util.HashSet grid2DSquareCells,
                                       boolean handleOutOfMemoryError)
Initialises this.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany the returned grid.
directory - The File directory to be used for swapping.
gridFile - Either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellDouble to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
grid2DSquareCells - A HashSet of swappable Grid2DSquareCellAbstract instances.
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.
See Also:
Grid2DSquareCellInt( GridStatisticsAbstract, File, File, Grid2DSquareCellIntChunkAbstractFactory, int, int, long, long, long, long, HashSet, boolean )

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                       java.io.File directory,
                                       java.io.File gridFile,
                                       Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                       int chunkNrows,
                                       int chunkNcols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex,
                                       boolean handleOutOfMemoryError)
Initialises this.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany the returned grid.
directory - The File directory to be used for swapping.
gridFile - Either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellDouble to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory prefered to construct chunks of this.
startRowIndex - The grid2DSquareCell row index which is the bottom most row of this.
startColIndex - The grid2DSquareCell column index which is the left most column of this.
endRowIndex - The grid2DSquareCell row index which is the top most row of this.
endColIndex - The grid2DSquareCell column index which is the right most column of this.
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.
See Also:
Grid2DSquareCellInt( GridStatisticsAbstract, File, File, Grid2DSquareCellIntChunkAbstractFactory, int, int, long, long, long, long, HashSet, boolean )

getGrid2DSquareCellIntChunk

public Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(int chunkRowIndex,
                                                                    int chunkColIndex,
                                                                    boolean handleOutOfMemoryError)
Returns grid2DSquareCellIntChunks.

Parameters:
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.

getGrid2DSquareCellIntChunk

public Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(int chunkRowIndex,
                                                                    int chunkColIndex)
Returns grid2DSquareCellIntChunks.


getGrid2DSquareCellIntChunk

public Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
                                                                    boolean handleOutOfMemoryError)
Returns grid2DSquareCellIntChunksAbstract for the given ChunkID

Parameters:
chunkID -
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.

getGrid2DSquareCellIntChunk

public Grid2DSquareCellIntChunkAbstract getGrid2DSquareCellIntChunk(Grid2DSquareCellAbstract.ChunkID chunkID)
Returns grid2DSquareCellIntChunksAbstract for the given ChunkID

Parameters:
chunkID -

getNoDataValue

public final int getNoDataValue(boolean handleOutOfMemoryError)
Returns this.noDataValue.

Parameters:
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.

getNoDataValue

protected final int getNoDataValue()
Returns this noDataValue Integer.MIN_VALUE.


getNoDataValueBigDecimal

public java.math.BigDecimal getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
Returns the this.noDataValue converted to a BigDecimal.

Specified by:
getNoDataValueBigDecimal in class Grid2DSquareCellAbstract
Parameters:
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.

getCell

public int getCell(long cellRowIndex,
                   long cellColIndex,
                   boolean handleOutOfMemoryError)
Returns the value at cellRowIndex, cellColIndex else returns noDataValue.

Parameters:
cellRowIndex -
cellColIndex -
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.

getCell

protected int getCell(long cellRowIndex,
                      long cellColIndex)
Returns the value at cellRowIndex, cellColIndex else returns noDataValue.

Parameters:
cellRowIndex - .
cellColIndex - .

getCell

public int getCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk,
                   int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   boolean handleOutOfMemoryError)
Returns the value at position given by chunk row index chunkRowIndex, chunk column index chunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.

Parameters:
chunkRowIndex - The chunk row index of the cell thats value is returned.
chunkColIndex - The chunk column index of the cell thats value is returned.
chunkCellRowIndex - The chunk cell row index of the cell thats value is returned.
chunkCellColIndex - The chunk cell column index of the cell thats value is returned.
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.

getCell

public int getCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk,
                   int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex)
Returns the value at position given by chunk row index chunkRowIndex, chunk column index chunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.

Parameters:
chunkRowIndex - The chunk row index of the cell thats value is returned.
chunkColIndex - The chunk column index of the cell thats value is returned.
chunkCellRowIndex - The chunk cell row index of the cell thats value is returned.
chunkCellColIndex - The chunk cell column index of the cell thats value is returned.

getCell

public final int getCell(double x,
                         double y,
                         boolean handleOutOfMemoryError)
For returning the value of the cell containing point given by x-coordinate x, y-coordinate y as a int.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
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.

getCell

public final int getCell(double x,
                         double y)
For returning the value of the cell containing point given by x-coordinate x, y-coordinate y as a int.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.

getCell

public final int getCell(Grid2DSquareCellAbstract.CellID cellID,
                         boolean handleOutOfMemoryError)
For returning the value of the cell with cell ID cellID as a int.

Parameters:
cellID - the CellID of the cell.
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.

setCell

public final int setCell(double x,
                         double y,
                         int newValue,
                         boolean handleOutOfMemoryError)
For returning the value at x-coordinate x, y-coordinate y and setting it to newValue.

Parameters:
x - the x-coordinate of the point.
y - the y-coordinate of the point.
newValue -
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.

setCell

public final int setCell(double x,
                         double y,
                         int newValue)
For returning the value at x-coordinate x, y-coordinate y and setting it to newValue.

Parameters:
x - the x-coordinate of the point.
y - the y-coordinate of the point.
newValue - .

setCell

public final int setCell(Grid2DSquareCellAbstract.CellID cellID,
                         int newValue,
                         boolean handleOutOfMemoryError)
For returning the value of the cell with cell ID cellID and setting it to newValue.

Parameters:
cellID - the CellID of the cell.
newValue -
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.

setCell

public double setCell(long cellRowIndex,
                      long cellColIndex,
                      double newValue,
                      boolean handleOutOfMemoryError)
For returning the value at cellRowIndex, cellColIndex as a double and setting it to ( int ) newValue.

Specified by:
setCell in class Grid2DSquareCellAbstract
Parameters:
cellRowIndex -
cellColIndex -
newValue -
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.

setCell

public double setCell(long cellRowIndex,
                      long cellColIndex,
                      double newValue)
For returning the value at cellRowIndex, cellColIndex as a double and setting it to ( int ) newValue.

Parameters:
cellRowIndex -
cellColIndex -
newValue -

setCell

public int setCell(long cellRowIndex,
                   long cellColIndex,
                   int newValue,
                   boolean handleOutOfMemoryError)
For returning the value at cellRowIndex, cellColIndex and setting it to newValue.

Parameters:
cellRowIndex -
cellColIndex -
newValue -
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.

setCell

public int setCell(long cellRowIndex,
                   long cellColIndex,
                   int newValue)
For returning the value at cellRowIndex, cellColIndex and setting it to newValue.

Parameters:
cellRowIndex -
cellColIndex -
newValue -

setCell

public int setCell(int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int newValue,
                   boolean handleOutOfMemoryError)
For returning the value of the cell in chunk given by chunkRowIndex and chunkColIndex and cell in the chunk given by chunkCellColIndex and chunkCellRowIndex and setting it to newValue.

Parameters:
chunkRowIndex -
chunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
newValue -
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.

setCell

public int setCell(int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int newValue)
For returning the value of the cell in chunk given by chunkRowIndex and chunkColIndex and cell in the chunk given by chunkCellColIndex and chunkCellRowIndex and setting it to newValue.

Parameters:
chunkRowIndex -
chunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
newValue -

setCell

public int setCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk,
                   int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int newValue,
                   boolean handleOutOfMemoryError)
Returns the value at cellRowIndex, cellColIndex and sets it to newValue.

Parameters:
grid2DSquareCellChunk -
chunkRowIndex -
chunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
newValue -
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.

setCell

public int setCell(Grid2DSquareCellIntChunkAbstract grid2DSquareCellChunk,
                   int chunkRowIndex,
                   int chunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int newValue)
Returns the value at cellRowIndex, cellColIndex and sets it to newValue.

Parameters:
grid2DSquareCellChunk -
chunkRowIndex -
chunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
newValue -

initCell

protected void initCell(long cellRowIndex,
                        long cellColIndex,
                        int valueToInitialise,
                        boolean handleOutOfMemoryError)
Initilises the value at cellRowIndex, cellColIndex

Parameters:
cellRowIndex -
cellColIndex -
valueToInitialise -
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.

initCell

protected void initCell(long cellRowIndex,
                        long cellColIndex,
                        int valueToInitialise)
Initilises the value at cellRowIndex, cellColIndex

Parameters:
cellRowIndex -
cellColIndex -
valueToInitialise -

initCellFast

protected void initCellFast(long cellRowIndex,
                            long cellColIndex,
                            int valueToInitialise,
                            boolean handleOutOfMemoryError)
Initilises the value at cellRowIndex, cellColIndex and does nothing about this.gridStatistics

Parameters:
cellRowIndex -
cellColIndex -
valueToInitialise -
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.

initCellFast

protected void initCellFast(long cellRowIndex,
                            long cellColIndex,
                            int valueToInitialise)
Initilises the value at cellRowIndex, cellColIndex and does nothing about this.gridStatistics

Parameters:
cellRowIndex -
cellColIndex -
valueToInitialise -

getCells

public int[] getCells(double x,
                      double y,
                      double distance,
                      boolean handleOutOfMemoryError)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

Parameters:
x - the x-coordinate of the circle centre from which cell values are returned.
y - the y-coordinate of the circle centre from which cell values are returned.
distance - the radius of the circle for which intersected cell values are returned.
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.

getCells

public int[] getCells(double x,
                      double y,
                      double distance)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

Parameters:
x - the x-coordinate of the circle centre from which cell values are returned.
y - the y-coordinate of the circle centre from which cell values are returned.
distance - the radius of the circle for which intersected cell values are returned.

getCells

public int[] getCells(long cellRowIndex,
                      long cellColIndex,
                      double distance,
                      boolean handleOutOfMemoryError)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at centroid of cell given by cell row index cellRowIndex, cell column index cellColIndex, and radius distance.

Parameters:
cellRowIndex - the row index for the cell thats centroid is the circle centre from which cell values are returned.
cellColIndex - the column index for the cell thats centroid is the circle centre from which cell values are returned.
distance - the radius of the circle for which intersected cell values are returned.
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.

getCells

public int[] getCells(long cellRowIndex,
                      long cellColIndex,
                      double distance)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at centroid of cell given by cell row index cellRowIndex, cell column index cellColIndex, and radius distance.

Parameters:
cellRowIndex - the row index for the cell thats centroid is the circle centre from which cell values are returned.
cellColIndex - the column index for the cell thats centroid is the circle centre from which cell values are returned.
distance - the radius of the circle for which intersected cell values are returned.

getCells

protected int[] getCells(double x,
                         double y,
                         long cellRowIndex,
                         long cellColIndex,
                         double distance,
                         boolean handleOutOfMemoryError)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

Parameters:
x - The x-coordinate of the circle centre from which cell values are returned.
y - The y-coordinate of the circle centre from which cell values are returned.
cellRowIndex - The row index at y.
cellColIndex - The col index at x.
distance - The radius of the circle for which intersected cell values are returned.
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.

getCells

protected int[] getCells(double x,
                         double y,
                         long cellRowIndex,
                         long cellColIndex,
                         double distance)
Returns a int[] of all cell values for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

Parameters:
x - The x-coordinate of the circle centre from which cell values are returned.
y - The y-coordinate of the circle centre from which cell values are returned.
cellRowIndex - The row index at y.
cellColIndex - The col index at x.
distance - The radius of the circle for which intersected cell values are returned.

getNearestValueDouble

public double getNearestValueDouble(double x,
                                    double y,
                                    boolean handleOutOfMemoryError)
Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y as a double.

Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
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.

getNearestValueDouble

public double getNearestValueDouble(double x,
                                    double y)
Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y as a double.

Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point

getNearestValueDouble

public double getNearestValueDouble(long cellRowIndex,
                                    long cellColIndex,
                                    boolean handleOutOfMemoryError)
Returns the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.

Parameters:
cellRowIndex - The row index from which average of the nearest data values is returned.
cellColIndex - The column index from which average of the nearest data values is returned.
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.

getNearestValueDouble

public double getNearestValueDouble(long cellRowIndex,
                                    long cellColIndex)
Returns the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.

Parameters:
cellRowIndex - The row index from which average of the nearest data values is returned.
cellColIndex - The column index from which average of the nearest data values is returned.

getNearestValueDouble

protected double getNearestValueDouble(double x,
                                       double y,
                                       long cellRowIndex,
                                       long cellColIndex,
                                       int noDataValue,
                                       boolean handleOutOfMemoryError)
Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex as a double.

Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
cellRowIndex - The row index from which average of the nearest data values is returned.
cellColIndex - The column index from which average of the nearest data values is returned.
noDataValue -
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.

getNearestValueDouble

protected double getNearestValueDouble(double x,
                                       double y,
                                       long cellRowIndex,
                                       long cellColIndex,
                                       int noDataValue)
Returns the average of the nearest data values to point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex as a double.

Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
cellRowIndex - The row index from which average of the nearest data values is returned.
cellColIndex - The column index from which average of the nearest data values is returned.
noDataValue -

getNearestValuesCellIDs

public Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x,
                                                                 double y,
                                                                 boolean handleOutOfMemoryError)
Returns a CellID[] - The CellIDs of the nearest cells with data values to point given by x-coordinate x, y-coordinate y.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
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.

getNearestValuesCellIDs

public Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x,
                                                                 double y)
Returns a CellID[] - The CellIDs of the nearest cells with data values to point given by x-coordinate x, y-coordinate y.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point

getNearestValuesCellIDs

public Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(long cellRowIndex,
                                                                 long cellColIndex,
                                                                 boolean handleOutOfMemoryError)
Returns a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.

Parameters:
cellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
cellColIndex - The column index from which the cell IDs of the nearest cells with data values are returned.
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.

getNearestValuesCellIDs

public Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(long cellRowIndex,
                                                                 long cellColIndex)
Returns a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.

Parameters:
cellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
cellColIndex - The column index from which the cell IDs of the nearest cells with data values are returned.

getNearestValuesCellIDs

protected Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x,
                                                                    double y,
                                                                    long cellRowIndex,
                                                                    long cellColIndex,
                                                                    int noDataValue,
                                                                    boolean handleOutOfMemoryError)
Returns a CellID[] - The CellIDs of the nearest cells with data values nearest to point with position given by: x-coordinate x, y-coordinate y; and, cell row index cellRowIndex, cell column index cellColIndex.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
cellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
cellColIndex - The column index from which the cell IDs of the nearest cells with data values are returned.
noDataValue - The no data value of the this.
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.

getNearestValuesCellIDs

protected Grid2DSquareCellAbstract.CellID[] getNearestValuesCellIDs(double x,
                                                                    double y,
                                                                    long cellRowIndex,
                                                                    long cellColIndex,
                                                                    int noDataValue)
Returns a CellID[] - The CellIDs of the nearest cells with data values nearest to point with position given by: x-coordinate x, y-coordinate y; and, cell row index cellRowIndex, cell column index cellColIndex.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
cellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
cellColIndex - The column index from which the cell IDs of the nearest cells with data values are returned.
noDataValue - The no data value of the this.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(double x,
                                            double y,
                                            boolean handleOutOfMemoryError)
Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
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.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(double x,
                                            double y)
Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(long cellRowIndex,
                                            long cellColIndex,
                                            boolean handleOutOfMemoryError)
Returns the distance to the nearest data value from position given by row index rowIndex, column index colIndex.

Parameters:
cellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
cellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.
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.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(long cellRowIndex,
                                            long cellColIndex)
Returns the distance to the nearest data value from position given by row index rowIndex, column index colIndex.

Parameters:
cellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
cellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.

getNearestValueDoubleDistance

protected double getNearestValueDoubleDistance(double x,
                                               double y,
                                               long cellRowIndex,
                                               long cellColIndex,
                                               int noDataValue,
                                               boolean handleOutOfMemoryError)
Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
cellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
cellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.
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.

getNearestValueDoubleDistance

protected double getNearestValueDoubleDistance(double x,
                                               double y,
                                               long cellRowIndex,
                                               long cellColIndex,
                                               int noDataValue)
Returns the distance to the nearest data value from point given by x-coordinate x, y-coordinate y in position given by row index rowIndex, column index colIndex.

Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
cellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
cellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.

addToCell

public final int addToCell(double x,
                           double y,
                           int valueToAdd,
                           boolean handleOutOfMemoryError)
Returns current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
valueToAdd - the value to be added to the cell containing the point
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.

addToCell

public final int addToCell(double x,
                           double y,
                           int valueToAdd)
Returns current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.

Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
valueToAdd - the value to be added to the cell containing the point

addToCell

public final int addToCell(Grid2DSquareCellAbstract.CellID cellID,
                           int valueToAdd,
                           boolean handleOutOfMemoryError)
Returns the value of the cell with cell ID cellID and adds valueToAdd to that cell.

Parameters:
cellID - the CellID of the cell.
valueToAdd - the value to be added to the cell containing the point
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.

addToCell

public final int addToCell(Grid2DSquareCellAbstract.CellID cellID,
                           int valueToAdd)
Returns the value of the cell with cell ID cellID and adds valueToAdd to that cell.

Parameters:
cellID - the CellID of the cell.
valueToAdd - the value to be added to the cell containing the point

addToCell

public int addToCell(long cellRowIndex,
                     long cellColIndex,
                     int valueToAdd,
                     boolean handleOutOfMemoryError)
Returns current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.

Parameters:
cellRowIndex - the row index of the cell.
cellColIndex - the col index of the cell.
valueToAdd - the value to be added to the cell.
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. NB1. If cell is not contained in this then then returns noDataValue. NB2. Adding to noDataValue is done as if adding to a cell with value of 0. TODO: Check Arithmetic

addToCell

public int addToCell(long cellRowIndex,
                     long cellColIndex,
                     int valueToAdd)
Returns current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.

Parameters:
cellRowIndex - the row index of the cell.
cellColIndex - the col index of the cell.
valueToAdd - the value to be added to the cell. NB1. If cell is not contained in this then then returns noDataValue. NB2. Adding to noDataValue is done as if adding to a cell with value of 0. TODO: Check Arithmetic

iterator

public java.util.Iterator iterator(boolean handleOutOfMemoryError)
Returns an iterator over the cell value in this.

Specified by:
iterator in class Grid2DSquareCellAbstract
Parameters:
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.