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

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

public class Grid2DSquareCellInt
extends AbstractGrid2DSquareCell
implements java.io.Serializable

A class to represent and manipulate int precision AbstractGrid2DSquareCell instances.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCell
AbstractGrid2DSquareCell.CellID, AbstractGrid2DSquareCell.ChunkID
 
Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCell
_ChunkID_AbstractGrid2DSquareCellChunk_HashMap, _ChunkNCols, _ChunkNRows, _Dimensions, _DimensionsScale, _Directory, _Grids_Environment, _GridStatistics, _Name, _NChunkCols, _NChunkRows, _NCols, _NRows, _UnsignedLongPowersOf2
 
Constructor Summary
protected Grid2DSquareCellInt(AbstractGridStatistics _GridStatistics, java.io.File _Directory, AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory, int _ChunkNRows, int _ChunkNCols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt based on values in _Grid2DSquareCell.
protected Grid2DSquareCellInt(AbstractGridStatistics _GridStatistics, java.io.File _Directory, AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory, int _ChunkNRows, int _ChunkNCols, long _NRows, long _NCols, java.math.BigDecimal[] _Dimensions, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt with each cell value equal to Integer.MinValue.
protected Grid2DSquareCellInt(AbstractGridStatistics _GridStatistics, java.io.File _Directory, java.io.File gridFile, AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory, int _ChunkNRows, int _ChunkNCols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt with values obtained from gridFile.
protected Grid2DSquareCellInt(java.io.File _Directory, java.io.File gridFile, java.io.ObjectInputStream ois, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Creates a new Grid2DSquareCellInt.
  Grid2DSquareCellInt(Grids_Environment a_Grids_Environment)
          Creates a new Grid2DSquareCellInt
 
Method Summary
protected  int addToCell(AbstractGrid2DSquareCell.CellID cellID, int valueToAdd)
           
 int addToCell(AbstractGrid2DSquareCell.CellID cellID, int valueToAdd, boolean handleOutOfMemoryError)
           
protected  int addToCell(double x, double y, int valueToAdd)
           
 int addToCell(double x, double y, int valueToAdd, boolean handleOutOfMemoryError)
           
protected  int addToCell(long cellRowIndex, long cellColIndex, int valueToAdd)
           
 int addToCell(long _CellRowIndex, long _CellColIndex, int valueToAdd, boolean handleOutOfMemoryError)
           
 int getCell(AbstractGrid2DSquareCell.CellID _CellID, boolean handleOutOfMemoryError)
           
protected  int getCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 int getCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
           
protected  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.
protected  int getCell(long _CellRowIndex, long _CellColIndex)
           
 int getCell(long _CellRowIndex, long _CellColIndex, boolean handleOutOfMemoryError)
           
protected  int[] getCells(double x, double y, double distance)
           
 int[] getCells(double x, double y, double distance, boolean handleOutOfMemoryError)
           
protected  int[] getCells(double x, double y, long _CellRowIndex, long _CellColIndex, double distance)
           
 int[] getCells(double x, double y, long _CellRowIndex, long _CellColIndex, double distance, boolean handleOutOfMemoryError)
           
protected  int[] getCells(long _CellRowIndex, long _CellColIndex, double distance)
           
 int[] getCells(long _CellRowIndex, long _CellColIndex, double distance, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(int _ChunkRowIndex, int _ChunkColIndex)
           
 AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(int _ChunkRowIndex, int _ChunkColIndex, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDouble(double x, double y)
           
 double getNearestValueDouble(double x, double y, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDouble(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue)
           
 double getNearestValueDouble(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDouble(long _CellRowIndex, long _CellColIndex)
           
 double getNearestValueDouble(long _CellRowIndex, long _CellColIndex, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDoubleDistance(double x, double y)
           
 double getNearestValueDoubleDistance(double x, double y, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDoubleDistance(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue)
           
 double getNearestValueDoubleDistance(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue, boolean handleOutOfMemoryError)
           
protected  double getNearestValueDoubleDistance(long _CellRowIndex, long _CellColIndex)
           
 double getNearestValueDoubleDistance(long _CellRowIndex, long _CellColIndex, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x, double y)
           
 AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x, double y, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue)
           
 AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x, double y, long _CellRowIndex, long _CellColIndex, int _NoDataValue, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(long _CellRowIndex, long _CellColIndex)
           
 AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(long _CellRowIndex, long _CellColIndex, boolean handleOutOfMemoryError)
           
protected  int getNoDataValue()
           
 int getNoDataValue(boolean handleOutOfMemoryError)
           
 java.math.BigDecimal getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
           
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 a_CellRowIndex, long a_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(AbstractGridStatistics _GridStatistics, java.io.File _Directory, AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory, int _ChunkNRows, int _ChunkNCols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Initialise this.
protected  void initGrid2DSquareCellInt(AbstractGridStatistics _GridStatistics, java.io.File _Directory, java.io.File gridFile, AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory, int _ChunkNRows, int _ChunkNCols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Initialises this.
protected  void initGrid2DSquareCellInt(Grid2DSquareCellInt _Grid2DSquareCellInt, boolean initTransientFields)
          Initialises this.
 java.util.Iterator iterator(boolean handleOutOfMemoryError)
           
 int setCell(AbstractGrid2DSquareCell.CellID cellID, int newValue, boolean handleOutOfMemoryError)
          For returning the value of the cell with cell ID cellID and setting it to newValue.
protected  int setCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue)
           
 int setCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, int newValue, boolean handleOutOfMemoryError)
           
protected  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.
protected  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.
protected  double setCell(long _CellRowIndex, long _CellColIndex, double newValue)
          For returning the value at _CellRowIndex, _CellColIndex as a double and setting it to ( int ) newValue.
protected  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)
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCell
clearFromCacheGrid2DSquareCellChunk, clearFromCacheGrid2DSquareCellChunk, clearFromCacheGrid2DSquareCellChunks, clearFromCacheGrid2DSquareCellChunks, get_ChunkNCols, get_ChunkNCols, get_ChunkNCols, get_ChunkNCols, get_ChunkNCols, get_ChunkNRows, get_ChunkNRows, get_ChunkNRows, get_ChunkNRows, get_Dimensions, get_DimensionsScale, get_Directory, get_Directory, get_Name, get_Name, get_NChunkCols, get_NChunkCols, get_NChunkRows, get_NChunkRows, get_NCols, get_NRows, getBasicDescription, getBasicDescription, getCellBounds_BigDecimalArray, getCellBounds_BigDecimalArray, getCellBounds_BigDecimalArray, getCellBounds_BigDecimalArray, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellBoundsDoubleArray, getCellColIndex, getCellColIndex, getCellColIndex, getCellColIndex, getCellColIndex, 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, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellRowIndex, getCellsizeDouble, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXBigDecimal, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellXDouble, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYBigDecimal, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getCellYDouble, getChunkCellColIndex, getChunkCellColIndex, getChunkCellColIndex, getChunkCellColIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkCellRowIndex, getChunkColIndex, getChunkColIndex, getChunkColIndex, getChunkColIndex, getChunkIDs, getChunkNCols, getChunkNCols, getChunkNcolsFinalColChunks, getChunkNcolsFinalColChunks, getChunkNRows, getChunkNRows, getChunkNrowsFinalRowChunks, getChunkNrowsFinalRowChunks, getChunkRowIndex, getChunkRowIndex, getChunkRowIndex, getChunkRowIndex, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCellChunk, getGrid2DSquareCellChunkIDHashSet, getGrid2DSquareCellChunkIDHashSet, getGrid2DSquareCells, getGridBounds, getGridBounds, getGridStatistics, getGridStatistics, getHalfCellsize, getHeightBigDecimal, getHeightBigDecimal, getHeightDouble, getHeightDouble, getNChunks, getNChunks, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNearestCellID, getNextChunk, getNextChunk, getNextChunkRowMinor, getNextChunkRowMinor, getPreviousChunk, getPreviousChunk, getWidthBigDecimal, getWidthBigDecimal, getWidthDouble, getWidthDouble, init_Dimensions, init_NChunkCols, init_NChunkRows, initGrid2DSquareCell, initGrid2DSquareCell, initGrid2DSquareCell, initGrid2DSquareCellChunks, initGrid2DSquareCellChunks, isInCache, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, isInGrid, loadIntoCacheChunk, loadIntoCacheChunk, set_Name, setCell, setChunk, setName, swapToFile_Grid2DSquareCellChunk_Account, swapToFile_Grid2DSquareCellChunk_Account, swapToFile_Grid2DSquareCellChunk_AccountChunk, swapToFile_Grid2DSquareCellChunk_AccountChunk, swapToFile_Grid2DSquareCellChunk_AccountDetail, swapToFile_Grid2DSquareCellChunk_AccountDetail, swapToFile_Grid2DSquareCellChunk, swapToFile_Grid2DSquareCellChunk, swapToFile_Grid2DSquareCellChunk, swapToFile_Grid2DSquareCellChunk, swapToFile_Grid2DSquareCellChunkExcept_Account, swapToFile_Grid2DSquareCellChunkExcept_AccountChunk, swapToFile_Grid2DSquareCellChunkExcept_AccountChunk, swapToFile_Grid2DSquareCellChunkExcept_AccountChunk, swapToFile_Grid2DSquareCellChunkExcept_AccountChunk, swapToFile_Grid2DSquareCellChunkExcept_AccountDetail, swapToFile_Grid2DSquareCellChunkExcept_AccountDetail, swapToFile_Grid2DSquareCellChunkExcept_AccountDetail, swapToFile_Grid2DSquareCellChunks_Account, swapToFile_Grid2DSquareCellChunks_Account, swapToFile_Grid2DSquareCellChunks_Account, swapToFile_Grid2DSquareCellChunks_Account, swapToFile_Grid2DSquareCellChunks_AccountDetail, swapToFile_Grid2DSquareCellChunks_AccountDetail, swapToFile_Grid2DSquareCellChunks, swapToFile_Grid2DSquareCellChunks, swapToFile_Grid2DSquareCellChunksExcept_Account, swapToFile_Grid2DSquareCellChunksExcept_Account, swapToFile_Grid2DSquareCellChunksExcept_Account, swapToFile_Grid2DSquareCellChunksExcept_AccountDetail, swapToFile_Grid2DSquareCellChunksExcept_AccountDetail, swapToFile_Grid2DSquareCellChunksExcept_AccountDetail, toString, toString, writeToFile, writeToFile, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunk, writeToFileGrid2DSquareCellChunks, writeToFileGrid2DSquareCellChunks, writeToFileSwapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid2DSquareCellInt

public Grid2DSquareCellInt(Grids_Environment a_Grids_Environment)
Creates a new Grid2DSquareCellInt


Grid2DSquareCellInt

protected Grid2DSquareCellInt(java.io.File _Directory,
                              java.io.File gridFile,
                              java.io.ObjectInputStream ois,
                              Grids_Environment a_Grids_Environment,
                              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, AbstractGrid2DSquareCellIntChunkFactory, 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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(AbstractGridStatistics _GridStatistics,
                              java.io.File _Directory,
                              AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory,
                              int _ChunkNRows,
                              int _ChunkNCols,
                              long _NRows,
                              long _NCols,
                              java.math.BigDecimal[] _Dimensions,
                              Grids_Environment a_Grids_Environment,
                              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 AbstractGridStatistics to accompany this.
_Directory - The File _Directory to be used for swapping.
_Grid2DSquareCellIntChunkFactory - The AbstractGrid2DSquareCellIntChunkFactory 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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(AbstractGridStatistics _GridStatistics,
                              java.io.File _Directory,
                              AbstractGrid2DSquareCell _Grid2DSquareCell,
                              AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory,
                              int _ChunkNRows,
                              int _ChunkNCols,
                              long startRowIndex,
                              long startColIndex,
                              long endRowIndex,
                              long endColIndex,
                              Grids_Environment a_Grids_Environment,
                              boolean handleOutOfMemoryError)
Creates a new Grid2DSquareCellInt based on values in _Grid2DSquareCell.

Parameters:
_GridStatistics - The AbstractGridStatistics to accompany this.
_Directory - The File _Directory to be used for swapping.
_Grid2DSquareCell - The AbstractGrid2DSquareCell from which this will be constructed.
_Grid2DSquareCellIntChunkFactory - The AbstractGrid2DSquareCellIntChunkFactory 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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(AbstractGridStatistics _GridStatistics,
                              java.io.File _Directory,
                              java.io.File gridFile,
                              AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory,
                              int _ChunkNRows,
                              int _ChunkNCols,
                              long startRowIndex,
                              long startColIndex,
                              long endRowIndex,
                              long endColIndex,
                              Grids_Environment a_Grids_Environment,
                              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 AbstractGridStatistics 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 AbstractGrid2DSquareCellIntChunkFactory 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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)
Specified by:
toString in class AbstractGrid2DSquareCell
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.
Returns:
a string description of the instance. Basically the values of each field.

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(AbstractGridStatistics _GridStatistics,
                                       java.io.File _Directory,
                                       AbstractGrid2DSquareCell _Grid2DSquareCell,
                                       AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory,
                                       int _ChunkNRows,
                                       int _ChunkNCols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex,
                                       Grids_Environment a_Grids_Environment,
                                       boolean handleOutOfMemoryError)
Initialise this.

Parameters:
_GridStatistics - The AbstractGridStatistics to accompany this.
_Directory - The File _Directory to be used for swapping.
_Grid2DSquareCell - The AbstractGrid2DSquareCell from which this will be constructed.
_Grid2DSquareCellIntChunkFactory - The AbstractGrid2DSquareCellIntChunkFactory 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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#initGrid2DSquareCellInt( AbstractGridStatistics, File, AbstractGrid2DSquareCell, AbstractGrid2DSquareCellIntChunkFactory, int, int, long, long, long, long, HashSet, boolean )

initGrid2DSquareCellInt

protected void initGrid2DSquareCellInt(AbstractGridStatistics _GridStatistics,
                                       java.io.File _Directory,
                                       java.io.File gridFile,
                                       AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCellIntChunkFactory,
                                       int _ChunkNRows,
                                       int _ChunkNCols,
                                       long startRowIndex,
                                       long startColIndex,
                                       long endRowIndex,
                                       long endColIndex,
                                       Grids_Environment a_Grids_Environment,
                                       boolean handleOutOfMemoryError)
Initialises this.

Parameters:
_GridStatistics - The AbstractGridStatistics 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 AbstractGrid2DSquareCellIntChunkFactory 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.
_AbstractGrid2DSquareCell_HashSet - A HashSet of swappable AbstractGrid2DSquareCell 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#Grid2DSquareCellInt( AbstractGridStatistics, File, File, AbstractGrid2DSquareCellIntChunkFactory, int, int, long, long, long, long, HashSet, boolean )

getGrid2DSquareCellIntChunk

public AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(int _ChunkRowIndex,
                                                                    int _ChunkColIndex,
                                                                    boolean handleOutOfMemoryError)
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.
Returns:
_Grid2DSquareCellIntChunks.

getGrid2DSquareCellIntChunk

protected AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(int _ChunkRowIndex,
                                                                       int _ChunkColIndex)
Returns:
_Grid2DSquareCellIntChunks.

getGrid2DSquareCellIntChunk

public AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                                    boolean handleOutOfMemoryError)
Parameters:
a_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.
Returns:
_Grid2DSquareCellIntChunksAbstract for the given ChunkID

getGrid2DSquareCellIntChunk

protected AbstractGrid2DSquareCellIntChunk getGrid2DSquareCellIntChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
Parameters:
a_ChunkID -
Returns:
_Grid2DSquareCellIntChunksAbstract for the given ChunkID

getNoDataValue

public final int getNoDataValue(boolean handleOutOfMemoryError)
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.
Returns:
this._NoDataValue.

getNoDataValue

protected final int getNoDataValue()
Returns:
this _NoDataValue Integer.MIN_VALUE.

getNoDataValueBigDecimal

public java.math.BigDecimal getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
Specified by:
getNoDataValueBigDecimal in class AbstractGrid2DSquareCell
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.
Returns:
the this._NoDataValue converted to a BigDecimal.

getCell

public int getCell(long _CellRowIndex,
                   long _CellColIndex,
                   boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex -
a_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.
Returns:
Value at _CellRowIndex, _CellColIndex else returns _NoDataValue.

getCell

protected int getCell(long _CellRowIndex,
                      long _CellColIndex)
Parameters:
a_CellRowIndex - .
a_CellColIndex - .
Returns:
Value at _CellRowIndex, _CellColIndex else returns _NoDataValue.

getCell

public int getCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk,
                   int _ChunkRowIndex,
                   int _ChunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   boolean handleOutOfMemoryError)
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.
Returns:
Value at position given by chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.

getCell

protected int getCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk,
                      int _ChunkRowIndex,
                      int _ChunkColIndex,
                      int chunkCellRowIndex,
                      int 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.
Returns:
Value at position given by chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex, chunk cell row index chunkCellRowIndex, chunk cell column index chunkCellColIndex.

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

protected 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(AbstractGrid2DSquareCell.CellID _CellID,
                         boolean handleOutOfMemoryError)
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.
Returns:
int value of the cell with CellID _CellID.

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

protected 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(AbstractGrid2DSquareCell.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

protected double setCell(long _CellRowIndex,
                         long _CellColIndex,
                         double newValue)
For returning the value at _CellRowIndex, _CellColIndex as a double and setting it to ( int ) newValue.

Specified by:
setCell in class AbstractGrid2DSquareCell
Parameters:
a_CellRowIndex -
a_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:
a_CellRowIndex -
a_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

protected int setCell(long _CellRowIndex,
                      long _CellColIndex,
                      int newValue)
For returning the value at _CellRowIndex, _CellColIndex and setting it to newValue.

Parameters:
a_CellRowIndex -
a_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

protected 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(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk,
                   int _ChunkRowIndex,
                   int _ChunkColIndex,
                   int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int newValue,
                   boolean handleOutOfMemoryError)
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.
Returns:
Value at _CellRowIndex, _CellColIndex and sets it to newValue.

setCell

protected int setCell(AbstractGrid2DSquareCellIntChunk _Grid2DSquareCellChunk,
                      int _ChunkRowIndex,
                      int _ChunkColIndex,
                      int chunkCellRowIndex,
                      int chunkCellColIndex,
                      int newValue)
Parameters:
_Grid2DSquareCellChunk -
_ChunkRowIndex -
_ChunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
newValue -
Returns:
Value at _CellRowIndex, _CellColIndex and sets it to newValue.

initCell

protected void initCell(long _CellRowIndex,
                        long _CellColIndex,
                        int valueToInitialise,
                        boolean handleOutOfMemoryError)
Initilises the value at _CellRowIndex, _CellColIndex.

Parameters:
a_CellRowIndex -
a_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:
a_CellRowIndex -
a_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:
a_CellRowIndex -
a_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 a_CellRowIndex,
                            long a_CellColIndex,
                            int valueToInitialise)
Initilises the value at _CellRowIndex, _CellColIndex and does nothing about this._GridStatistics

Parameters:
a_CellRowIndex -
a_CellColIndex -
valueToInitialise -

getCells

public int[] getCells(double x,
                      double y,
                      double distance,
                      boolean handleOutOfMemoryError)
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.
Returns:
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.

getCells

protected int[] getCells(double x,
                         double y,
                         double 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.
Returns:
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.

getCells

public int[] getCells(long _CellRowIndex,
                      long _CellColIndex,
                      double distance,
                      boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex - the row index for the cell thats centroid is the circle centre from which cell values are returned.
a_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.
Returns:
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.

getCells

protected int[] getCells(long _CellRowIndex,
                         long _CellColIndex,
                         double distance)
Parameters:
a_CellRowIndex - the row index for the cell thats centroid is the circle centre from which cell values are returned.
a_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.
Returns:
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.

getCells

public int[] getCells(double x,
                      double y,
                      long _CellRowIndex,
                      long _CellColIndex,
                      double distance,
                      boolean handleOutOfMemoryError)
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.
a_CellRowIndex - The row index at y.
a_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.
Returns:
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.

getCells

protected int[] getCells(double x,
                         double y,
                         long _CellRowIndex,
                         long _CellColIndex,
                         double 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.
a_CellRowIndex - The row index at y.
a_CellColIndex - The col index at x.
distance - The radius of the circle for which intersected cell values are returned.
Returns:
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.

getNearestValueDouble

public double getNearestValueDouble(double x,
                                    double y,
                                    boolean handleOutOfMemoryError)
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.
Returns:
the average of the nearest data values to point given by x-coordinate x, y-coordinate y as a double.

getNearestValueDouble

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

getNearestValueDouble

public double getNearestValueDouble(long _CellRowIndex,
                                    long _CellColIndex,
                                    boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex - The row index from which average of the nearest data values is returned.
a_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.
Returns:
the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.

getNearestValueDouble

protected double getNearestValueDouble(long _CellRowIndex,
                                       long _CellColIndex)
Parameters:
a_CellRowIndex - The row index from which average of the nearest data values is returned.
a_CellColIndex - The column index from which average of the nearest data values is returned.
Returns:
the average of the nearest data values to position given by row index rowIndex, column index colIndex as a double.

getNearestValueDouble

public double getNearestValueDouble(double x,
                                    double y,
                                    long _CellRowIndex,
                                    long _CellColIndex,
                                    int _NoDataValue,
                                    boolean handleOutOfMemoryError)
Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
a_CellRowIndex - The row index from which average of the nearest data values is returned.
a_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.
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.

getNearestValueDouble

protected double getNearestValueDouble(double x,
                                       double y,
                                       long _CellRowIndex,
                                       long _CellColIndex,
                                       int _NoDataValue)
Parameters:
x - The x-coordinate of the point
y - The y-coordinate of the point
a_CellRowIndex - The row index from which average of the nearest data values is returned.
a_CellColIndex - The column index from which average of the nearest data values is returned.
_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.

getNearestValuesCellIDs

public AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x,
                                                                 double y,
                                                                 boolean handleOutOfMemoryError)
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.
Returns:
a CellID[] - The CellIDs of the nearest cells with data values to point given by x-coordinate x, y-coordinate y.

getNearestValuesCellIDs

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

getNearestValuesCellIDs

public AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(long _CellRowIndex,
                                                                 long _CellColIndex,
                                                                 boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
a_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.
Returns:
a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.

getNearestValuesCellIDs

protected AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(long _CellRowIndex,
                                                                    long _CellColIndex)
Parameters:
a_CellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
a_CellColIndex - The column index from which the cell IDs of the nearest cells with data values are returned.
Returns:
a CellID[] - The CellIDs of the nearest cells with data values to position given by row index rowIndex, column index colIndex.

getNearestValuesCellIDs

public AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x,
                                                                 double y,
                                                                 long _CellRowIndex,
                                                                 long _CellColIndex,
                                                                 int _NoDataValue,
                                                                 boolean handleOutOfMemoryError)
Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
a_CellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
a_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.
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.

getNearestValuesCellIDs

protected AbstractGrid2DSquareCell.CellID[] getNearestValuesCellIDs(double x,
                                                                    double y,
                                                                    long _CellRowIndex,
                                                                    long _CellColIndex,
                                                                    int _NoDataValue)
Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
a_CellRowIndex - The row index from which the cell IDs of the nearest cells with data values are returned.
a_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.
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.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(double x,
                                            double y,
                                            boolean handleOutOfMemoryError)
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.
Returns:
the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.

getNearestValueDoubleDistance

protected double getNearestValueDoubleDistance(double x,
                                               double y)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
Returns:
the distance to the nearest data value from point given by x-coordinate x, y-coordinate y.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(long _CellRowIndex,
                                            long _CellColIndex,
                                            boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
a_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.
Returns:
the distance to the nearest data value from position given by row index rowIndex, column index colIndex.

getNearestValueDoubleDistance

protected double getNearestValueDoubleDistance(long _CellRowIndex,
                                               long _CellColIndex)
Parameters:
a_CellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
a_CellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.
Returns:
the distance to the nearest data value from position given by row index rowIndex, column index colIndex.

getNearestValueDoubleDistance

public double getNearestValueDoubleDistance(double x,
                                            double y,
                                            long _CellRowIndex,
                                            long _CellColIndex,
                                            int _NoDataValue,
                                            boolean handleOutOfMemoryError)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
a_CellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
a_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.
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.

getNearestValueDoubleDistance

protected double getNearestValueDoubleDistance(double x,
                                               double y,
                                               long _CellRowIndex,
                                               long _CellColIndex,
                                               int _NoDataValue)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
a_CellRowIndex - The cell row index of the cell from which the distance nearest to the nearest cell value is returned.
a_CellColIndex - The cell column index of the cell from which the distance nearest to the nearest cell value is returned.
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.

addToCell

public final int addToCell(double x,
                           double y,
                           int valueToAdd,
                           boolean handleOutOfMemoryError)
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.
Returns:
current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.

addToCell

protected final int addToCell(double x,
                              double y,
                              int valueToAdd)
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
Returns:
current value of cell containing the point given by x-coordinate x, y-coordinate y, and adds valueToAdd to that cell.

addToCell

public final int addToCell(AbstractGrid2DSquareCell.CellID cellID,
                           int valueToAdd,
                           boolean handleOutOfMemoryError)
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.
Returns:
Value of the cell with cell ID cellID and adds valueToAdd to that cell.

addToCell

protected final int addToCell(AbstractGrid2DSquareCell.CellID cellID,
                              int valueToAdd)
Parameters:
cellID - the CellID of the cell.
valueToAdd - the value to be added to the cell containing the point
Returns:
Value of the cell with cell ID cellID and adds valueToAdd to that cell.

addToCell

public int addToCell(long _CellRowIndex,
                     long _CellColIndex,
                     int valueToAdd,
                     boolean handleOutOfMemoryError)
Parameters:
a_CellRowIndex - the row index of the cell.
a_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
Returns:
current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.

addToCell

protected int addToCell(long cellRowIndex,
                        long cellColIndex,
                        int valueToAdd)
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
Returns:
current value of cell with row index rowIndex and column index colIndex and adds valueToAdd to that cell.

iterator

public java.util.Iterator iterator(boolean handleOutOfMemoryError)
Specified by:
iterator in class AbstractGrid2DSquareCell
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.
Returns:
an iterator over the cell value in this.