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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
      extended by uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCell
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Grid2DSquareCellDouble, Grid2DSquareCellInt

public abstract class AbstractGrid2DSquareCell
extends OutOfMemoryErrorHandler
implements java.io.Serializable

Contains CellID and ChunkID classes, referencing and general geometry methods. It also controls what methods extended classes must implement acting like an interface. The basic geometries are ordered in set numbers of rows and columns and are arranged sequentially as their base two-dimensional orthogonal coordinate axes. The sequential arrangement goes along the x-axis row by row from the y-axis, then up the y-axis taking each row in turn. TODO: Handling for NumberFormatExceptions and ArithmeticExceptions in calculations

See Also:
Serialized Form

Nested Class Summary
static class AbstractGrid2DSquareCell.CellID
          A simple CellID class for distinguishing cells.
static class AbstractGrid2DSquareCell.ChunkID
          A simple ChunkID class for distinguishing chunks.
 
Field Summary
protected  int _ChunkNCols
          For storing the (usual) number of columns of cells in a chunk.
protected  int _ChunkNRows
          For storing the (usual) number of rows of cells in a chunk.
protected  java.math.BigDecimal[] _Dimensions
          For storing cellsize, minx, miny, maxx, maxy.
protected  int _DimensionsScale
          For storing the minimum number of decimal places used to store _Dimensions.
protected  java.io.File _Directory
          Local _Directory used for caching.
protected  java.util.HashMap _Grid2DSquareCellChunks
          The AbstractGrid2DSquareCellChunk data cache.
protected  AbstractGridStatistics _GridStatistics
          A reference to the grid Statistics Object.
protected  java.lang.String _Name
          For storing the _Name of the grid.
protected  int _NChunkCols
          For storing the number of chunk columns.
protected  int _NChunkRows
          For storing the number of chunk rows.
protected  long _NCols
          For storing the number of columns in the grid.
protected  long _NRows
          For storing the number of rows in the grid.
protected static UnsignedLongPowersOf2 _UnsignedLongPowersOf2
          For storing individual locations mapped to a binary encoded long.
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
_Grid2DSquareCells, _HandleOutOfMemoryErrorFalse, _HandleOutOfMemoryErrorTrue, _MemoryReserve, _Runtime
 
Constructor Summary
AbstractGrid2DSquareCell()
           
 
Method Summary
protected  void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          For releasing a grid2DSquareCellChunk stored in memory.
protected  void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          For releasing a grid2DSquareCellChunk stored in memory.
protected  void clearFromCacheGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          For releasing a grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.
protected  void clearFromCacheGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          For releasing a grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.
protected  void clearFromCacheGrid2DSquareCellChunks()
          For releasing all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
protected  void clearFromCacheGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
          For releasing all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
protected  void clearFromCacheGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs)
          Clears Grid2DSquareCellChunkAbstracts with ChunkIDs in _ChunkIDs.
protected  void clearFromCacheGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Clears Grid2DSquareCellChunkAbstracts with ChunkIDs in _ChunkIDs.
protected  void clearFromCacheGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          For releasing all grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.
protected  void clearFromCacheGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          For releasing all grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.
protected  void clearFromCacheGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
          For releasing all grid2DSquareCellChunk stored in memory except those with ChunkIDs in _ChunkIDs.
protected  void clearFromCacheGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          For releasing all grid2DSquareCellChunk stored in memory except those with ChunkIDs in _ChunkIDs.
protected  int get_ChunkNCols()
           
 int get_ChunkNCols(boolean _HandleOutOfMemoryError)
           
protected  int get_ChunkNCols(int _ChunkColIndex)
           
 int get_ChunkNCols(int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
 int get_ChunkNCols(int _ChunkColIndex, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
protected  int get_ChunkNRows()
           
 int get_ChunkNRows(boolean _HandleOutOfMemoryError)
           
protected  int get_ChunkNRows(int _ChunkRowIndex)
           
 int get_ChunkNRows(int _ChunkRowIndex, boolean _HandleOutOfMemoryError)
           
 java.math.BigDecimal[] get_Dimensions(boolean _HandleOutOfMemoryError)
           
protected  int get_DimensionsScale(boolean _HandleOutOfMemoryError)
           
protected  java.io.File get_Directory()
           
 java.io.File get_Directory(boolean _HandleOutOfMemoryError)
           
protected  java.lang.String get_Name()
           
 java.lang.String get_Name(boolean _HandleOutOfMemoryError)
           
 int get_NChunkCols()
           
 int get_NChunkCols(boolean _HandleOutOfMemoryError)
           
 int get_NChunkRows()
           
 int get_NChunkRows(boolean _HandleOutOfMemoryError)
           
 long get_NCols(boolean _HandleOutOfMemoryError)
           
 long get_NRows(boolean _HandleOutOfMemoryError)
           
protected  java.lang.String getBasicDescription()
           
 java.lang.String getBasicDescription(boolean _HandleOutOfMemoryError)
           
protected  double[] getCellBoundsDoubleArray(double x, double y)
          Precision may compromise result.
 double[] getCellBoundsDoubleArray(double x, double y, boolean _HandleOutOfMemoryError)
          Precision may compromise result.
protected  double[] getCellBoundsDoubleArray(long _CellRowIndex, long _CellColIndex)
           
 double[] getCellBoundsDoubleArray(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  long getCellColIndex(java.math.BigDecimal xBigDecimal)
           
 long getCellColIndex(java.math.BigDecimal xBigDecimal, boolean _HandleOutOfMemoryError)
           
protected  long getCellColIndex(double x)
           
 long getCellColIndex(double x, boolean _HandleOutOfMemoryError)
           
protected  long getCellColIndex(int _ChunkColIndex, int chunkCellColIndex)
           
 long getCellColIndex(int _ChunkColIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
 long getCellColIndex(int _ChunkColIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
protected  double getCellDouble(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 double getCellDouble(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellDouble(double x, double y)
           
 double getCellDouble(double x, double y, boolean _HandleOutOfMemoryError)
           
protected  double getCellDouble(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 double getCellDouble(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellDouble(long _CellRowIndex, long _CellColIndex)
           
 double getCellDouble(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellDouble(java.awt.geom.Point2D.Double point)
           
 double getCellDouble(java.awt.geom.Point2D.Double point, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID getCellID(double x, double y)
           
 AbstractGrid2DSquareCell.CellID getCellID(double x, double y, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID getCellID(long _CellRowIndex, long _CellColIndex)
           
 AbstractGrid2DSquareCell.CellID getCellID(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getCellIDs(double x, double y, double distance)
           
 AbstractGrid2DSquareCell.CellID[] getCellIDs(double x, double y, double distance, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getCellIDs(double x, double y, long _CellRowIndex, long _CellColIndex, double distance)
          TODO: remove need for copy to new array.
 AbstractGrid2DSquareCell.CellID[] getCellIDs(double x, double y, long _CellRowIndex, long _CellColIndex, double distance, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID[] getCellIDs(long _CellRowIndex, long _CellColIndex, double distance)
           
 AbstractGrid2DSquareCell.CellID[] getCellIDs(long _CellRowIndex, long _CellColIndex, double distance, boolean _HandleOutOfMemoryError)
           
protected  int getCellInt(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 int getCellInt(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk, int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
protected  int getCellInt(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 int getCellInt(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
protected  int getCellInt(long _CellRowIndex, long _CellColIndex)
           
 int getCellInt(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  long getCellRowIndex(java.math.BigDecimal yBigDecimal)
           
 long getCellRowIndex(java.math.BigDecimal yBigDecimal, boolean _HandleOutOfMemoryError)
           
protected  long getCellRowIndex(double y)
           
 long getCellRowIndex(double y, boolean _HandleOutOfMemoryError)
           
protected  long getCellRowIndex(int _ChunkRowIndex, int chunkCellRowIndex)
           
 long getCellRowIndex(int _ChunkRowIndex, int chunkCellRowIndex, boolean _HandleOutOfMemoryError)
           
 long getCellRowIndex(int _ChunkRowIndex, int chunkCellRowIndex, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 long getCellRowIndex(int _ChunkRowIndex, int chunkCellRowIndex, boolean _HandleOutOfMemoryError, java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
          If OutOfMemoryError is caught then an attempt is made to swap an AbstractGrid2DSquareCellChunk not in _Grid2DSquareCell_ChunkIDHashSet.
 double getCellsizeDouble(boolean _HandleOutOfMemoryError)
           
protected  java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID)
           
 java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID, boolean _HandleOutOfMemoryError)
           
 java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  java.math.BigDecimal getCellXBigDecimal(long _CellColIndex)
           
 java.math.BigDecimal getCellXBigDecimal(long _CellColIndex, boolean _HandleOutOfMemoryError)
           
 java.math.BigDecimal getCellXBigDecimal(long _CellColIndex, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID)
           
 double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID, boolean _HandleOutOfMemoryError)
           
 double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellXDouble(int chunkCellColIndex, int _ChunkColIndex)
           
 double getCellXDouble(int chunkCellColIndex, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellXDouble(long _CellColIndex)
           
 double getCellXDouble(long _CellColIndex, boolean _HandleOutOfMemoryError)
           
 double getCellXDouble(long _CellColIndex, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
protected  java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID)
           
 java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID, boolean _HandleOutOfMemoryError)
           
 java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex)
           
 java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex, boolean _HandleOutOfMemoryError)
           
 java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID)
           
 double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID, boolean _HandleOutOfMemoryError)
           
 double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellYDouble(int chunkCellRowIndex, int _ChunkRowIndex)
           
 double getCellYDouble(int chunkCellRowIndex, int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  double getCellYDouble(long _CellRowIndex)
           
 double getCellYDouble(long _CellRowIndex, boolean _HandleOutOfMemoryError)
           
 double getCellYDouble(long _CellRowIndex, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
protected  int getChunkCellColIndex(double x)
           
 int getChunkCellColIndex(double x, boolean _HandleOutOfMemoryError)
           
protected  int getChunkCellColIndex(long _CellColIndex)
           
 int getChunkCellColIndex(long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  int getChunkCellRowIndex(double y)
           
 int getChunkCellRowIndex(double y, boolean _HandleOutOfMemoryError)
           
protected  int getChunkCellRowIndex(long _CellRowIndex)
           
 int getChunkCellRowIndex(long _CellRowIndex, boolean _HandleOutOfMemoryError)
           
protected  int getChunkColIndex(double x)
           
 int getChunkColIndex(double x, boolean _HandleOutOfMemoryError)
           
protected  int getChunkColIndex(long _CellColIndex)
           
 int getChunkColIndex(long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  java.util.HashSet getChunkIDs(double distance, double x, double y, long _CellRowIndex, long _CellColIndex)
           
protected  int getChunkNCols(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 int getChunkNCols(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  int getChunkNcolsFinalColChunks()
           
protected  int getChunkNcolsFinalColChunks(boolean _HandleOutOfMemoryError)
           
protected  int getChunkNRows(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 int getChunkNRows(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  int getChunkNrowsFinalRowChunks()
           
protected  int getChunkNrowsFinalRowChunks(boolean _HandleOutOfMemoryError)
           
protected  int getChunkRowIndex(double y)
           
 int getChunkRowIndex(double y, boolean _HandleOutOfMemoryError)
           
protected  int getChunkRowIndex(long _CellRowIndex)
           
 int getChunkRowIndex(long _CellRowIndex, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int _ChunkRowIndex, int _ChunkColIndex)
           
protected  AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  java.util.HashSet getGrid2DSquareCellChunkIDHashSet()
           
 java.util.HashSet getGrid2DSquareCellChunkIDHashSet(boolean _HandleOutOfMemoryError)
           
 java.util.HashSet getGrid2DSquareCells(boolean _HandleOutOfMemoryError)
           
protected  double[] getGridBounds()
           
 double[] getGridBounds(boolean _HandleOutOfMemoryError)
          TODO: Are bounds in double range? Is there more than cellsize difference with precision? Throw appropriate exceptions.
protected  AbstractGridStatistics getGridStatistics()
           
 AbstractGridStatistics getGridStatistics(boolean _HandleOutOfMemoryError)
           
protected  java.math.BigDecimal getHeightBigDecimal()
           
 java.math.BigDecimal getHeightBigDecimal(boolean _HandleOutOfMemoryError)
           
protected  double getHeightDouble()
           
 double getHeightDouble(boolean _HandleOutOfMemoryError)
           
protected  long getNChunks()
           
 long getNChunks(boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID getNearestCellID(double x, double y)
           
 AbstractGrid2DSquareCell.CellID getNearestCellID(double x, double y, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID getNearestCellID(double x, double y, long _CellRowIndex, long _CellColIndex)
           
 AbstractGrid2DSquareCell.CellID getNearestCellID(double x, double y, long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.CellID getNearestCellID(long _CellRowIndex, long _CellColIndex)
           
 AbstractGrid2DSquareCell.CellID getNearestCellID(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.ChunkID getNextChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols)
           
 AbstractGrid2DSquareCell.ChunkID getNextChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols, boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols)
           
 AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols, boolean _HandleOutOfMemoryError)
           
abstract  java.math.BigDecimal getNoDataValueBigDecimal(boolean _HandleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.ChunkID getPreviousChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols)
           
 AbstractGrid2DSquareCell.ChunkID getPreviousChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, int _NChunkRows, int _NChunkCols, boolean _HandleOutOfMemoryError)
           
protected  java.math.BigDecimal getWidthBigDecimal()
           
 java.math.BigDecimal getWidthBigDecimal(boolean _HandleOutOfMemoryError)
           
protected  double getWidthDouble()
           
 double getWidthDouble(boolean _HandleOutOfMemoryError)
           
protected  void init_Dimensions(java.math.BigDecimal[] _Dimensions)
          Initialises this._Dimensions and this.dimensionScale.
protected  void init_NChunkCols()
          Initialises this._NChunkCols.
protected  void init_NChunkRows()
          Initialises this._NChunkRows.
protected  void initGrid2DSquareCell(AbstractGrid2DSquareCell _Grid2DSquareCell)
          Initialises non transient AbstractGrid2DSquareCell fields from _Grid2DSquareCell.
protected  void initGrid2DSquareCell(java.util.HashSet _Grid2DSquareCells)
          Initialises AbstractGrid2DSquareCell fields of this.
protected  void initGrid2DSquareCellChunks(java.io.File gridFile)
          Initialises this._Grid2DSquareCellChunks by first attempting to load from new File( gridFile, "cache" );
protected  boolean isInCache(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 boolean isInCache(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(AbstractGrid2DSquareCell.CellID _CellID)
           
 boolean isInGrid(AbstractGrid2DSquareCell.CellID _CellID, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 boolean isInGrid(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(java.math.BigDecimal xBigDecimal, java.math.BigDecimal yBigDecimal)
           
 boolean isInGrid(java.math.BigDecimal xBigDecimal, java.math.BigDecimal yBigDecimal, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(double x, double y)
           
 boolean isInGrid(double x, double y, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(int _ChunkRowIndex, int _ChunkColIndex)
           
 boolean isInGrid(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
           
 boolean isInGrid(int _ChunkRowIndex, int _ChunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean _HandleOutOfMemoryError)
           
protected  boolean isInGrid(long _CellRowIndex, long _CellColIndex)
           
 boolean isInGrid(long _CellRowIndex, long _CellColIndex, boolean _HandleOutOfMemoryError)
           
abstract  java.util.Iterator iterator(boolean _HandleOutOfMemoryError)
           
protected  void loadIntoCacheChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to load into the memory cache AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.
 void loadIntoCacheChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to load into the memory cache a AbstractGrid2DSquareCellChunk with ChunkID
protected  void loadIntoCacheChunk(int _ChunkRowIndex, int _ChunkColIndex)
          Restores a grid2DSquareCellChunk from a swapped cache file.
 void loadIntoCacheChunk(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
          Restores a grid2DSquareCellChunk from a swapped cache file.
protected  java.lang.Object loadObject(java.io.File _File)
          Loads an object from _File.
protected  java.lang.Object loadObject(java.io.File _File, boolean _HandleOutOfMemoryError)
          Loads an object from _File.
protected  java.lang.Object loadObject(java.io.ObjectInputStream _ObjectInputStream)
          Loads an object from _ObjectInputStream.
 void set_Name(java.lang.String _Name, boolean _HandleOutOfMemoryError)
          Sets this._Name to _Name.
protected abstract  double setCell(long _CellRowIndex, long _CellColIndex, double valueToSet)
          Sets the value at _CellRowIndex, _CellColIndex to valueToSet.
 double setCell(long _CellRowIndex, long _CellColIndex, double valueToSet, boolean _HandleOutOfMemoryError)
           
 double setCell(long _CellRowIndex, long _CellColIndex, double valueToSet, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 double setCell(long _CellRowIndex, long _CellColIndex, double valueToSet, boolean _HandleOutOfMemoryError, AbstractGrid2DSquareCell _Grid2DSquareCell)
           
 void setChunk(AbstractGrid2DSquareCellChunk _Grid2DSquareCellChunk, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Sets the AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID to _Grid2DSquareCellChunk.
protected  void setName(java.lang.String _Name)
          Sets this._Name to _Name.
protected  AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunk()
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this.
 AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this.
protected  AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
 AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
protected  AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(java.util.HashSet _ChunkIDs)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
 AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
protected  java.util.HashSet swapToFileGrid2DSquareCellChunks()
          Attempts to swap seriailsed version of all _Grid2DSquareCellChunks.
 java.util.HashSet swapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
          Attempts to swap seriailsed version of all Grid2DSquareCellChunks in this only.
protected  long swapToFileGrid2DSquareCellChunks(int cri0, int cci0, int cri1, int cci1)
          Attempts to swap seriailsed version of all AbstractGrid2DSquareCellChunk from (cri0, cci0) to (cri1, cci1) in row major order.
 long swapToFileGrid2DSquareCellChunks(int cri0, int cci0, int cri1, int cci1, boolean _HandleOutOfMemoryError)
          Attempts to swap seriailsed version of all AbstractGrid2DSquareCellChunk from (cri0, cci0) to (cri1, cci1) in row major order.
protected  java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.
 java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.
protected  java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.
 java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkIDs.
abstract  java.lang.String toString(boolean _HandleOutOfMemoryError)
           
protected  java.lang.String toString(int flag)
           
 java.lang.String toString(int flag, boolean _HandleOutOfMemoryError)
           
protected  void writeToFile(boolean swapToFileCache)
          Attempts to write this instance to Files located in the _Directory returned by get_Directory().
 void writeToFile(boolean swapToFileCache, boolean _HandleOutOfMemoryError)
          Attempts to write this instance to Files located in the _Directory returned by get_Directory().
protected  AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunk()
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
protected  boolean writeToFileGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by _ChunkID.
 boolean writeToFileGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by _ChunkID.
 AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
protected  boolean writeToFileGrid2DSquareCellChunk(int _ChunkRowIndex, int _ChunkColIndex)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
 boolean writeToFileGrid2DSquareCellChunk(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
protected  AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.
 AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.
protected  AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(int _ChunkRowIndex, int _ChunkColIndex)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
 AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
protected  AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
 AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
protected  AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(int _ChunkRowIndex, int _ChunkColIndex)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
 AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(int _ChunkRowIndex, int _ChunkColIndex, boolean _HandleOutOfMemoryError)
          Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
protected  void writeToFileGrid2DSquareCellChunks()
          Attempts to write to File seriailized versions of all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
 void writeToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
          Attempts to write to File seriailized versions of all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.
protected  void writeToFileGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks that have ChunkID equal to those in _ChunkIDs.
 void writeToFileGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks that have ChunkID equal to those in _ChunkIDs.
protected  void writeToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.
 void writeToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.
protected  void writeToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except those that have ChunkID in _ChunkIDs.
 void writeToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except those that have ChunkID in _ChunkIDs.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
_EnsureThereIsEnoughMemoryToContinue, _SwapToFileGrid2DSquareCellChunk, _SwapToFileGrid2DSquareCellChunk, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunkExcept, _SwapToFileGrid2DSquareCellChunks, _SwapToFileGrid2DSquareCellChunks, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, _SwapToFileGrid2DSquareCellChunksExcept, clear_MemoryReserve, get_Grid2DSquareCells, get_MemoryReserve, getNormalDistributionKernelWeights, getTotalFreeMemory, getTotalFreeMemory, init_Grid2DSquareCells_MemoryReserve, init_Grid2DSquareCells_MemoryReserve, init_Grid2DSquareCells, init_Grid2DSquareCells, init_MemoryReserve, init_MemoryReserve, init_MemoryReserve, init_MemoryReserve, init_MemoryReserve, init_MemoryReserve, init_Runtime, initFile, initFile, initFileDirectory, initString, initString, println, set_Grid2DSquareCells, set_Grid2DSquareCells, sin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Directory

protected transient java.io.File _Directory
Local _Directory used for caching. TODO This should not be transient so as it is possible to ascertain where the data has come from.


_Grid2DSquareCellChunks

protected transient java.util.HashMap _Grid2DSquareCellChunks
The AbstractGrid2DSquareCellChunk data cache. A collection is used rather than an array because an element of a collection set to null is available for garbage collection whereas an element of an array set to null seems not to be.


_GridStatistics

protected AbstractGridStatistics _GridStatistics
A reference to the grid Statistics Object.


_NChunkRows

protected int _NChunkRows
For storing the number of chunk rows.


_NChunkCols

protected int _NChunkCols
For storing the number of chunk columns.


_ChunkNRows

protected int _ChunkNRows
For storing the (usual) number of rows of cells in a chunk. The number of rows in the final chunk row may be less.


_ChunkNCols

protected int _ChunkNCols
For storing the (usual) number of columns of cells in a chunk. The number of columns in the final chunk column may be less.


_NRows

protected long _NRows
For storing the number of rows in the grid.


_NCols

protected long _NCols
For storing the number of columns in the grid.


_Name

protected java.lang.String _Name
For storing the _Name of the grid.


_Dimensions

protected java.math.BigDecimal[] _Dimensions
For storing cellsize, minx, miny, maxx, maxy. Although maxx and maxy could be easily calculated if required, for convenience they are calculated and stored by default during construction.


_DimensionsScale

protected int _DimensionsScale
For storing the minimum number of decimal places used to store _Dimensions.


_UnsignedLongPowersOf2

protected static UnsignedLongPowersOf2 _UnsignedLongPowersOf2
For storing individual locations mapped to a binary encoded long. This is only used in Grid2DSquareCellDoubleChunk64CellMap and Grid2DSquareCellIntChunk64CellMap. It is stored in this to save it being stored in every chunk or calculated on the fly.

Constructor Detail

AbstractGrid2DSquareCell

public AbstractGrid2DSquareCell()
Method Detail

initGrid2DSquareCellChunks

protected void initGrid2DSquareCellChunks(java.io.File gridFile)
Initialises this._Grid2DSquareCellChunks by first attempting to load from new File( gridFile, "cache" );

Parameters:
gridFile - The _Directory that should may contain a File named cache.

initGrid2DSquareCell

protected void initGrid2DSquareCell(java.util.HashSet _Grid2DSquareCells)
Initialises AbstractGrid2DSquareCell fields of this.

Parameters:
_Grid2DSquareCells - HashSet

initGrid2DSquareCell

protected void initGrid2DSquareCell(AbstractGrid2DSquareCell _Grid2DSquareCell)
Initialises non transient AbstractGrid2DSquareCell fields from _Grid2DSquareCell.

Parameters:
_Grid2DSquareCell - The AbstractGrid2DSquareCell from which the non transient AbstractGrid2DSquareCell fields of this are set.

getGrid2DSquareCells

public java.util.HashSet getGrid2DSquareCells(boolean _HandleOutOfMemoryError)
Returns:
a reference to this._Grid2DSquareCells

getGridStatistics

public AbstractGridStatistics getGridStatistics(boolean _HandleOutOfMemoryError)
Returns:
this._GridStatistics TODO: For safety, this method should either be removed and this class be made implement GridStatisticsInterface. This done the methods introduced would be made to call the relevant ones in this._GridStatistics. Or the _GridStatistics need to be made safe in that only copies of fields are passed.

getGridStatistics

protected AbstractGridStatistics getGridStatistics()
Returns:
this._GridStatistics TODO: For safety, this method should either be removed and this class be made implement GridStatisticsInterface. This done the methods introduced would be made to call the relevant ones in this._GridStatistics. Or the _GridStatistics need to be made safe in that only copies of fields are passed.

getGrid2DSquareCellChunk

protected AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int _ChunkRowIndex,
                                                                 int _ChunkColIndex,
                                                                 boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex - The ChunkID._ChunkRowIndex of the returned AbstractGrid2DSquareCellChunk.
_ChunkColIndex - The ChunkID._ChunkColIndex of the returned AbstractGrid2DSquareCellChunk.
_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 AbstractGrid2DSquareCellChunk with ChunkID._ChunkRowIndex equal to _ChunkRowIndex and ChunkID._ChunkColIndex equal to _ChunkColIndex.

getGrid2DSquareCellChunk

protected AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int _ChunkRowIndex,
                                                                 int _ChunkColIndex)
Parameters:
_ChunkRowIndex - The ChunkID._ChunkRowIndex of the returned AbstractGrid2DSquareCellChunk.
_ChunkColIndex - The ChunkID._ChunkColIndex of the returned AbstractGrid2DSquareCellChunk.
Returns:
the AbstractGrid2DSquareCellChunk with ChunkID._ChunkRowIndex equal to _ChunkRowIndex and ChunkID._ChunkColIndex equal to _ChunkColIndex.

getGrid2DSquareCellChunk

public AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                              boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The ChunkID of the returned AbstractGrid2DSquareCellChunk.
_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 AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.

getGrid2DSquareCellChunk

protected AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The ChunkID of the returned AbstractGrid2DSquareCellChunk.
Returns:
the AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.

getGrid2DSquareCellChunkIDHashSet

public java.util.HashSet getGrid2DSquareCellChunkIDHashSet(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:
HashSet containing all _Grid2DSquareCellChunks.ChunkID's.

getGrid2DSquareCellChunkIDHashSet

protected java.util.HashSet getGrid2DSquareCellChunkIDHashSet()
Returns:
HashSet containing all _Grid2DSquareCellChunks.ChunkID's.

iterator

public abstract java.util.Iterator iterator(boolean _HandleOutOfMemoryError)
Returns:
Iterator over the cell values in this.

toString

public abstract java.lang.String toString(boolean _HandleOutOfMemoryError)
Returns:
String description of this.

toString

public java.lang.String toString(int flag,
                                 boolean _HandleOutOfMemoryError)
Parameters:
flag - This is ignored. It is simply to distinguish this method from the abstract method toString(boolean).
_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:
String description of this.

toString

protected java.lang.String toString(int flag)
Parameters:
flag - This is ignored. It is simply to distinguish this method from the abstract method toString(boolean).
Returns:
a string description of the Abstract fields of this instance.

get_Directory

public java.io.File get_Directory(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:
a copy of _Directory.

get_Directory

protected java.io.File get_Directory()
Returns:
a copy of _Directory.

get_Name

public java.lang.String get_Name(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:
a copy of this._Name.

get_Name

protected java.lang.String get_Name()
Returns:
a copy of this._Name.

set_Name

public void set_Name(java.lang.String _Name,
                     boolean _HandleOutOfMemoryError)
Sets this._Name to _Name.

Parameters:
_Name - The String this._Name is set to.
_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.

setName

protected void setName(java.lang.String _Name)
Sets this._Name to _Name.

Parameters:
_Name - The String this._Name is set to.

getBasicDescription

public java.lang.String getBasicDescription(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:
a basic description of this instance.

getBasicDescription

protected java.lang.String getBasicDescription()
Returns:
a basic description of this instance.

setChunk

public void setChunk(AbstractGrid2DSquareCellChunk _Grid2DSquareCellChunk,
                     AbstractGrid2DSquareCell.ChunkID _ChunkID,
                     boolean _HandleOutOfMemoryError)
Sets the AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID to _Grid2DSquareCellChunk.

Parameters:
_Grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk that the AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID is set as.
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk that is set.
_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.

get_NCols

public final long get_NCols(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:
a copy of this._NCols.

get_NRows

public final long get_NRows(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:
a copy of this._NRows.

get_NChunkRows

public final int get_NChunkRows(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:
a copy of this._NChunkRows.

get_NChunkRows

public final int get_NChunkRows()
Returns:
a copy of this._NChunkRows.

init_NChunkRows

protected final void init_NChunkRows()
Initialises this._NChunkRows.


get_NChunkCols

public final int get_NChunkCols(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:
a copy of this._NChunkCols.

get_NChunkCols

public final int get_NChunkCols()
Returns:
a copy of this._NChunkCols.

getNChunks

public final long getNChunks(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:
The number of Grid2DSquareCellDoubleChunkAbstracts in this as a long.

getNChunks

protected final long getNChunks()
Returns:
the number of Grid2DSquareCellDoubleChunkAbstracts in this as a long.

init_NChunkCols

protected final void init_NChunkCols()
Initialises this._NChunkCols.


get_ChunkNRows

public final int get_ChunkNRows(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._ChunkNRows.

get_ChunkNRows

protected final int get_ChunkNRows()
Returns:
this.getChunkNRows.

get_ChunkNRows

public final int get_ChunkNRows(int _ChunkRowIndex,
                                boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex - The ChunkID._ChunkRowIndex of the AbstractGrid2DSquareCellChunk thats _ChunkNRows 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:
_ChunkNRows, the number of rows in AbstractGrid2DSquareCellChunk with ChunkID._ChunkRowIndex equal to _ChunkRowIndex.

get_ChunkNRows

protected final int get_ChunkNRows(int _ChunkRowIndex)
Parameters:
_ChunkRowIndex - The ChunkID._ChunkRowIndex of the AbstractGrid2DSquareCellChunk thats _ChunkNRows is returned.
Returns:
_ChunkNRows, the number of rows in AbstractGrid2DSquareCellChunk with ChunkID._ChunkRowIndex equal to _ChunkRowIndex.

get_ChunkNCols

public final int get_ChunkNCols(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._ChunkNCols.

get_ChunkNCols

protected final int get_ChunkNCols()
Returns:
this._ChunkNCols.

get_ChunkNCols

public final int get_ChunkNCols(int _ChunkColIndex,
                                boolean _HandleOutOfMemoryError)
Parameters:
_ChunkColIndex - The ChunkID._ChunkColIndex of the AbstractGrid2DSquareCellChunk thats _ChunkNRows 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:
_ChunkNCols, the number of columns in AbstractGrid2DSquareCellChunk with ChunkID._ChunkColIndex equal to _ChunkColIndex.

get_ChunkNCols

public final int get_ChunkNCols(int _ChunkColIndex,
                                boolean _HandleOutOfMemoryError,
                                AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkColIndex - The ChunkID._ChunkColIndex of the AbstractGrid2DSquareCellChunk thats _ChunkNRows 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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
_ChunkNCols, the number of columns in AbstractGrid2DSquareCellChunk with ChunkID._ChunkColIndex equal to _ChunkColIndex.

get_ChunkNCols

protected final int get_ChunkNCols(int _ChunkColIndex)
Parameters:
_ChunkColIndex - The ChunkID._ChunkColIndex of the AbstractGrid2DSquareCellChunk thats _ChunkNRows is returned.
Returns:
_ChunkNCols, the number of columns in AbstractGrid2DSquareCellChunk with ChunkID._ChunkColIndex equal to _ChunkColIndex.

getChunkNrowsFinalRowChunks

protected final int getChunkNrowsFinalRowChunks(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:
the number of rows in the final row Chunk.

getChunkNrowsFinalRowChunks

protected final int getChunkNrowsFinalRowChunks()
Returns:
the number of rows in the final row Chunk.

getChunkNcolsFinalColChunks

protected final int getChunkNcolsFinalColChunks(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:
the number of cols in the final col Chunk

getChunkNcolsFinalColChunks

protected final int getChunkNcolsFinalColChunks()
Returns:
the number of cols in the final col Chunk

getChunkNRows

public final int getChunkNRows(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                               boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk thats number of rows 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:
_ChunkNRows, the number of rows in AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID

getChunkNRows

protected final int getChunkNRows(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk thats number of rows is returned.
Returns:
_ChunkNRows, the number of rows in AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID

getChunkNCols

public final int getChunkNCols(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                               boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk thats number of columns 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:
_ChunkNCols, the number of columns in AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID

getChunkNCols

protected final int getChunkNCols(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk thats number of columns is returned.
Returns:
_ChunkNCols, the number of columns in AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID

get_Dimensions

public final java.math.BigDecimal[] get_Dimensions(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:
A copy of this._Dimensions.

getCellsizeDouble

public final double getCellsizeDouble(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:
double equal to this._Dimensions[0].doubleValue.

get_DimensionsScale

protected final int get_DimensionsScale(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._DimensionsScale.

init_Dimensions

protected final void init_Dimensions(java.math.BigDecimal[] _Dimensions)
Initialises this._Dimensions and this.dimensionScale.


getCellDouble

public double getCellDouble(java.awt.geom.Point2D.Double point,
                            boolean _HandleOutOfMemoryError)
Parameters:
point - The Point2D.Double for which the 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:
AbstractGrid2DSquareCellChunk cell value at at Point2D.Double point as a double.

getCellDouble

protected double getCellDouble(java.awt.geom.Point2D.Double point)
Parameters:
point - The Point2D.Double for which the cell value is returned.
Returns:
AbstractGrid2DSquareCellChunk cell value at at Point2D.Double point as a double.

getCellDouble

public double getCellDouble(double x,
                            double y,
                            boolean _HandleOutOfMemoryError)
Parameters:
x - The x coordinate of the point at which the cell value is returned.
y - The y coordinate of the point at which the 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:
AbstractGrid2DSquareCellChunk cell value at at point given by x-coordinate x and y-coordinate y as a double.

getCellDouble

protected double getCellDouble(double x,
                               double y)
Parameters:
x - The x coordinate of the point at which the cell value is returned.
y - The y coordinate of the point at which the cell value is returned.
Returns:
AbstractGrid2DSquareCellChunk cell value at at point given by x-coordinate x and y-coordinate y as a double.

getCellDouble

public double getCellDouble(long _CellRowIndex,
                            long _CellColIndex,
                            boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index of the .
_CellColIndex - The cell column index.
_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:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a double.

getCellDouble

protected double getCellDouble(long _CellRowIndex,
                               long _CellColIndex)
Parameters:
_CellRowIndex - The cell row index of the .
_CellColIndex - The cell column index.
Returns:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a double.

getCellDouble

public double getCellDouble(int _ChunkRowIndex,
                            int _ChunkColIndex,
                            int chunkCellRowIndex,
                            int chunkCellColIndex,
                            boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
_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:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a double.

getCellDouble

protected double getCellDouble(int _ChunkRowIndex,
                               int _ChunkColIndex,
                               int chunkCellRowIndex,
                               int chunkCellColIndex)
Parameters:
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
Returns:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a double.

getCellDouble

public double getCellDouble(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk,
                            int _ChunkRowIndex,
                            int _ChunkColIndex,
                            int chunkCellRowIndex,
                            int chunkCellColIndex,
                            boolean _HandleOutOfMemoryError)
Parameters:
grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk containing the cell.
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
_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:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a double.

getCellDouble

protected double getCellDouble(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk,
                               int _ChunkRowIndex,
                               int _ChunkColIndex,
                               int chunkCellRowIndex,
                               int chunkCellColIndex)
Parameters:
grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk containing the cell.
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
Returns:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a double.

getCellInt

public int getCellInt(long _CellRowIndex,
                      long _CellColIndex,
                      boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
_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:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a int.

getCellInt

protected int getCellInt(long _CellRowIndex,
                         long _CellColIndex)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
Returns:
AbstractGrid2DSquareCellChunk cell value at cell row index equal to _CellRowIndex, cell col index equal to _CellColIndex as a int.

getCellInt

public int getCellInt(int _ChunkRowIndex,
                      int _ChunkColIndex,
                      int chunkCellRowIndex,
                      int chunkCellColIndex,
                      boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
_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:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a int.

getCellInt

protected int getCellInt(int _ChunkRowIndex,
                         int _ChunkColIndex,
                         int chunkCellRowIndex,
                         int chunkCellColIndex)
Parameters:
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
Returns:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a int.

getCellInt

public int getCellInt(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk,
                      int _ChunkRowIndex,
                      int _ChunkColIndex,
                      int chunkCellRowIndex,
                      int chunkCellColIndex,
                      boolean _HandleOutOfMemoryError)
Parameters:
grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk containing the cell.
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
_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:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a int.

getCellInt

protected int getCellInt(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk,
                         int _ChunkRowIndex,
                         int _ChunkColIndex,
                         int chunkCellRowIndex,
                         int chunkCellColIndex)
Parameters:
grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk containing the cell.
_ChunkRowIndex - The cell chunk row index.
_ChunkColIndex - The cell chunk column index.
chunkCellRowIndex - The cell row index of the chunk.
chunkCellColIndex - The cell column index of the chunk.
Returns:
Cell value at chunk cell row index chunkCellRowIndex, chunk cell col index chunkCellColIndex of AbstractGrid2DSquareCellChunk given by chunk row index _ChunkRowIndex, chunk col index _ChunkColIndex as a int.

setCell

public double setCell(long _CellRowIndex,
                      long _CellColIndex,
                      double valueToSet,
                      boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
_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 value at _CellRowIndex, _CellColIndex as a double and sets it to valueToSet.

setCell

public double setCell(long _CellRowIndex,
                      long _CellColIndex,
                      double valueToSet,
                      boolean _HandleOutOfMemoryError,
                      AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
_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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
the value at _CellRowIndex, _CellColIndex as a double and sets it to valueToSet.

setCell

public double setCell(long _CellRowIndex,
                      long _CellColIndex,
                      double valueToSet,
                      boolean _HandleOutOfMemoryError,
                      AbstractGrid2DSquareCell _Grid2DSquareCell)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
_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.
_Grid2DSquareCell - This is a AbstractGrid2DSquareCell not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
the value at _CellRowIndex, _CellColIndex as a double and sets it to valueToSet.

setCell

protected abstract double setCell(long _CellRowIndex,
                                  long _CellColIndex,
                                  double valueToSet)
Sets the value at _CellRowIndex, _CellColIndex to valueToSet.

Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
valueToSet - The value set.

getChunkIDs

protected java.util.HashSet getChunkIDs(double distance,
                                        double x,
                                        double y,
                                        long _CellRowIndex,
                                        long _CellColIndex)
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.
Returns:
HashSet of ChunkIDs for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

getChunkColIndex

public final int getChunkColIndex(double x,
                                  boolean _HandleOutOfMemoryError)
Parameters:
x - The x-coordinate of the line intersecting the chunk column index 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:
Chunk column index for the AbstractGrid2DSquareCellChunk intersecting the x-coordinate x.

getChunkColIndex

protected final int getChunkColIndex(double x)
Parameters:
x - The x-coordinate of the line intersecting the chunk column index returned.
Returns:
Chunk column index for the AbstractGrid2DSquareCellChunk intersecting the x-coordinate x.

getChunkColIndex

public final int getChunkColIndex(long _CellColIndex,
                                  boolean _HandleOutOfMemoryError)
Parameters:
_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:
Chunk column index for the AbstractGrid2DSquareCellChunk intersecting the cell column index _CellColIndex.

getChunkColIndex

protected final int getChunkColIndex(long _CellColIndex)
Parameters:
_CellColIndex -
Returns:
Chunk column index for the AbstractGrid2DSquareCellChunk intersecting the cell column index _CellColIndex.

getCellColIndex

public final long getCellColIndex(double x,
                                  boolean _HandleOutOfMemoryError)
Parameters:
x - The x-coordinate of the line intersecting the cell column index 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:
Cell column Index for the cell column that intersect the x-coordinate x.

getCellColIndex

protected final long getCellColIndex(double x)
Parameters:
x - The x-coordinate of the line intersecting the cell column index returned.
Returns:
Cell column Index for the cell column that intersect the x-coordinate x.

getCellColIndex

public final long getCellColIndex(java.math.BigDecimal xBigDecimal,
                                  boolean _HandleOutOfMemoryError)
Parameters:
xBigDecimal - The x-coordinate of the line intersecting the cell column index 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:
Cell column Index for the cell column that intersect the x-coordinate xBigDecimal.

getCellColIndex

protected final long getCellColIndex(java.math.BigDecimal xBigDecimal)
Parameters:
xBigDecimal - The x-coordinate of the line intersecting the cell column index returned.
Returns:
Cell column Index for the cell column that intersect the x-coordinate xBigDecimal.

getCellColIndex

public final long getCellColIndex(int _ChunkColIndex,
                                  int chunkCellColIndex,
                                  boolean _HandleOutOfMemoryError)
Parameters:
_ChunkColIndex -
chunkCellColIndex -
_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:
Cell column index for the cells in chunk column index _ChunkColIndex chunk cell column index chunkCellColIndex.

getCellColIndex

public final long getCellColIndex(int _ChunkColIndex,
                                  int chunkCellColIndex,
                                  boolean _HandleOutOfMemoryError,
                                  AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkColIndex -
chunkCellColIndex -
_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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
Cell column index for the cells in chunk column index _ChunkColIndex chunk cell column index chunkCellColIndex.

getCellColIndex

protected final long getCellColIndex(int _ChunkColIndex,
                                     int chunkCellColIndex)
Parameters:
_ChunkColIndex -
chunkCellColIndex -
Returns:
Cell column index for the cells in chunk column index _ChunkColIndex chunk cell column index chunkCellColIndex.

getChunkCellColIndex

public final int getChunkCellColIndex(double x,
                                      boolean _HandleOutOfMemoryError)
Parameters:
x - The x-coordinate of the line intersecting the chunk cell column index 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:
Chunk cell column Index of the cells that intersect the x-coordinate x.

getChunkCellColIndex

protected final int getChunkCellColIndex(double x)
Parameters:
x - The x-coordinate of the line intersecting the chunk cell column index returned.
Returns:
Chunk cell column Index of the cells that intersect the x-coordinate x.

getChunkCellColIndex

public final int getChunkCellColIndex(long _CellColIndex,
                                      boolean _HandleOutOfMemoryError)
Parameters:
_CellColIndex - The cell column index of the cell thats chunk cell column index 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:
Chunk cell column index of the cells in the cell column index _CellColIndex.

getChunkCellColIndex

protected final int getChunkCellColIndex(long _CellColIndex)
Parameters:
_CellColIndex - The cell column index of the cell thats chunk cell column index is returned.
Returns:
Chunk cell column index of the cells in the cell column index _CellColIndex.

getChunkRowIndex

public final int getChunkRowIndex(double y,
                                  boolean _HandleOutOfMemoryError)
Parameters:
y - The y-coordinate of the line for which the chunk row index 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:
Chunk row index for the chunks intersecting the line given by y-coordinate y.

getChunkRowIndex

protected final int getChunkRowIndex(double y)
Parameters:
y - The y-coordinate of the line for which the chunk row index is returned.
Returns:
Chunk row index for the chunks intersecting the line given by y-coordinate y.

getChunkRowIndex

public final int getChunkRowIndex(long _CellRowIndex,
                                  boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index of the cells thats chunk row index 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:
Chunk row index for the chunk intersecting the cells with cell row index _CellRowIndex.

getChunkRowIndex

protected final int getChunkRowIndex(long _CellRowIndex)
Parameters:
_CellRowIndex - The cell row index of the cells thats chunk row index is returned.
Returns:
Chunk row index for the chunk intersecting the cells with cell row index _CellRowIndex.

getCellRowIndex

public final long getCellRowIndex(double y,
                                  boolean _HandleOutOfMemoryError)
Parameters:
y - The y-coordinate of the line thats cell row index 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:
Cell row Index for the cells that intersect the line with y-coordinate y.

getCellRowIndex

protected final long getCellRowIndex(double y)
Parameters:
y - The y-coordinate of the line thats cell row index is returned.
Returns:
Cell row Index for the cells that intersect the line with y-coordinate y.

getCellRowIndex

public final long getCellRowIndex(java.math.BigDecimal yBigDecimal,
                                  boolean _HandleOutOfMemoryError)
Parameters:
yBigDecimal - The y-coordinate of the line for which the cell row index 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:
Cell row Index for the cells that intersect the line with y-coordinate yBigDecimal.

getCellRowIndex

protected final long getCellRowIndex(java.math.BigDecimal yBigDecimal)
Parameters:
yBigDecimal - The y-coordinate of the line for which the cell row index is returned.
Returns:
Cell row Index for the cells that intersect the line with y-coordinate yBigDecimal.

getCellRowIndex

public final long getCellRowIndex(int _ChunkRowIndex,
                                  int chunkCellRowIndex,
                                  boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex -
chunkCellRowIndex -
_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:
long CellRowIndex, the cell row index for the cells in chunk row index _ChunkRowIndex chunk cell row index chunkCellRowIndex.

getCellRowIndex

public final long getCellRowIndex(int _ChunkRowIndex,
                                  int chunkCellRowIndex,
                                  boolean _HandleOutOfMemoryError,
                                  AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkRowIndex -
chunkCellRowIndex -
_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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
long CellRowIndex, the cell row index for the cells in chunk row index _ChunkRowIndex chunk cell row index chunkCellRowIndex.

getCellRowIndex

public final long getCellRowIndex(int _ChunkRowIndex,
                                  int chunkCellRowIndex,
                                  boolean _HandleOutOfMemoryError,
                                  java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
If OutOfMemoryError is caught then an attempt is made to swap an AbstractGrid2DSquareCellChunk not in _Grid2DSquareCell_ChunkIDHashSet. If this is not done then any AbstractGrid2DSquareCellChunk is swapped and a warning is printed to sout

Parameters:
_ChunkRowIndex -
chunkCellRowIndex -
_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:
long CellRowIndex, the cell row index for the cells in chunk row index _ChunkRowIndex chunk cell row index chunkCellRowIndex.

getCellRowIndex

protected final long getCellRowIndex(int _ChunkRowIndex,
                                     int chunkCellRowIndex)
Parameters:
_ChunkRowIndex -
chunkCellRowIndex -
Returns:
Cell column index for the cells in chunk column index _ChunkColIndex chunk cell column index chunkCellColIndex.

getChunkCellRowIndex

public final int getChunkCellRowIndex(double y,
                                      boolean _HandleOutOfMemoryError)
Parameters:
y - The y-coordinate of the line for which the chunk cell row index 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:
Chunk cell row Index of the cells that intersects the line with y-coordinate y.

getChunkCellRowIndex

protected final int getChunkCellRowIndex(double y)
Parameters:
y - The y-coordinate of the line for which the chunk cell row index is returned.
Returns:
Chunk cell row Index of the cells that intersects the line with y-coordinate y.

getChunkCellRowIndex

public final int getChunkCellRowIndex(long _CellRowIndex,
                                      boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index of the cells that chunk cell row index 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:
Chunk cell row index of the cells with cell row index equal to _CellRowIndex.

getChunkCellRowIndex

protected final int getChunkCellRowIndex(long _CellRowIndex)
Parameters:
_CellRowIndex - The cell row index of the cells that chunk cell row index is returned.
Returns:
Chunk cell row index of the cells with cell row index equal to _CellRowIndex.

getCellID

public final AbstractGrid2DSquareCell.CellID getCellID(long _CellRowIndex,
                                                       long _CellColIndex,
                                                       boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
_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:
CellID of the cell given by cell row index _CellRowIndex, cell column index _CellColIndex. A CellID is returned even if that cell would not be in the grid.

getCellID

protected final AbstractGrid2DSquareCell.CellID getCellID(long _CellRowIndex,
                                                          long _CellColIndex)
Parameters:
_CellRowIndex - The cell row index.
_CellColIndex - The cell column index.
Returns:
CellID of the cell given by cell row index _CellRowIndex, cell column index _CellColIndex. A CellID is returned even if that cell would not be in the grid.

getCellID

public final AbstractGrid2DSquareCell.CellID getCellID(double x,
                                                       double y,
                                                       boolean _HandleOutOfMemoryError)
Parameters:
x - The x-coordinate.
y - The y-coordinate.
_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:
CellID of the cell given by x-coordinate x, y-coordinate y even if that cell would not be in the grid.

getCellID

protected final AbstractGrid2DSquareCell.CellID getCellID(double x,
                                                          double y)
Parameters:
x - The x-coordinate.
y - The y-coordinate.
Returns:
a CellID of the cell given by x-coordinate x, y-coordinate y even if that cell would not be in the grid.

writeToFile

public final void writeToFile(boolean swapToFileCache,
                              boolean _HandleOutOfMemoryError)
                       throws java.io.IOException
Attempts to write this instance to Files located in the _Directory returned by get_Directory().

Parameters:
swapToFileCache - Iff true then this._Grid2DSquareCellChunks is written to new File( get_Directory(), "cache" ).
_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.
Throws:
java.io.IOException

writeToFile

protected void writeToFile(boolean swapToFileCache)
                    throws java.io.IOException
Attempts to write this instance to Files located in the _Directory returned by get_Directory().

Parameters:
swapToFileCache - Iff true then this._Grid2DSquareCellChunks is written to new File(get_Directory(),"cache").
Throws:
java.io.IOException

writeToFileGrid2DSquareCellChunk

public final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks. The first AbstractGrid2DSquareCellChunk attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

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:
ChunkID of the AbstractGrid2DSquareCellChunk which was written to file.

writeToFileGrid2DSquareCellChunk

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunk()
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks. The first AbstractGrid2DSquareCellChunk attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

Returns:
ChunkID of the AbstractGrid2DSquareCellChunk which was swapped or null.

writeToFileGrid2DSquareCellChunk

public final boolean writeToFileGrid2DSquareCellChunk(int _ChunkRowIndex,
                                                      int _ChunkColIndex,
                                                      boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.

Parameters:
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk to be written.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk to be written.
_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:
True if AbstractGrid2DSquareCellChunk on file is up to date.

writeToFileGrid2DSquareCellChunk

protected final boolean writeToFileGrid2DSquareCellChunk(int _ChunkRowIndex,
                                                         int _ChunkColIndex)
Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.

Parameters:
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk to be written.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk to be written.
Returns:
True if AbstractGrid2DSquareCellChunk on file is up to date.

writeToFileGrid2DSquareCellChunk

public final boolean writeToFileGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                      boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by _ChunkID.

Parameters:
_ChunkID - The _ChunkID of the AbstractGrid2DSquareCellChunk to be written.
_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:
True if AbstractGrid2DSquareCellChunk on file is up to date.

writeToFileGrid2DSquareCellChunk

protected final boolean writeToFileGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks given by _ChunkID.

Parameters:
_ChunkID - The _ChunkID of the AbstractGrid2DSquareCellChunk to be written.
Returns:
True if AbstractGrid2DSquareCellChunk on file is up to date.

writeToFileGrid2DSquareCellChunks

public final void writeToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
Attempts to write to File seriailized versions of all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.

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.

writeToFileGrid2DSquareCellChunks

protected final void writeToFileGrid2DSquareCellChunks()
Attempts to write to File seriailized versions of all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.


writeToFileGrid2DSquareCellChunks

public final void writeToFileGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs,
                                                    boolean _HandleOutOfMemoryError)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks that have ChunkID equal to those in _ChunkIDs.

Parameters:
_ChunkIDs - A HashSet containing the ChunkID of the AbstractGrid2DSquareCellChunk to be written to file.
_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.

writeToFileGrid2DSquareCellChunks

protected final void writeToFileGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks that have ChunkID equal to those in _ChunkIDs.

Parameters:
_ChunkIDs - A HashSet containing the ChunkID of the AbstractGrid2DSquareCellChunk to be written to file.

writeToFileGrid2DSquareCellChunksExcept

public final void writeToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                          boolean _HandleOutOfMemoryError)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.

Parameters:
_ChunkID - The ChunkID of the chunk not to be written.
_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.

writeToFileGrid2DSquareCellChunksExcept

protected final void writeToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID.

Parameters:
_ChunkID - The ChunkID of the chunk not to be written.

writeToFileGrid2DSquareCellChunkExcept

public final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                                     boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID. The first chunk that is attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

Parameters:
_ChunkID - The ChunkID of the chunk not to be swapToFiled.
_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:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExcept

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with ChunkID equal to _ChunkID. The first chunk that is attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

Parameters:
_ChunkID - The ChunkID of the chunk not to be swapToFiled.
Returns:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExcept

public final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(int _ChunkRowIndex,
                                                                                     int _ChunkColIndex,
                                                                                     boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

Parameters:
_ChunkRowIndex - The chunk row index.
_ChunkColIndex - The chunk column index.
_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:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExcept

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExcept(int _ChunkRowIndex,
                                                                                        int _ChunkColIndex)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of 0, and a chunk column index of 0.

Parameters:
_ChunkRowIndex - The chunk row index.
_ChunkColIndex - The chunk column index.
Returns:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExceptReverseOrder

public final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(int _ChunkRowIndex,
                                                                                                 int _ChunkColIndex,
                                                                                                 boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of _ChunkNRows - 1, and a chunk column index of _ChunkNCols - 1. This is primarily used in constructors that read a data format that

Parameters:
_ChunkRowIndex - The chunk row index.
_ChunkColIndex - The chunk column index.
_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:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null. presents values in reverse row order.

writeToFileGrid2DSquareCellChunkExceptReverseOrder

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(int _ChunkRowIndex,
                                                                                                    int _ChunkColIndex)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of _ChunkNRows - 1, and a chunk column index of _ChunkNCols - 1. This is primarily used in constructors that read a data format that presents values in reverse row order.

Parameters:
_ChunkRowIndex - The chunk row index.
_ChunkColIndex - The chunk column index.
Returns:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExceptReverseOrder

public final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                                                 boolean _HandleOutOfMemoryError)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of _ChunkNRows - 1, and a chunk column index of _ChunkNCols - 1. This is primarily used in constructors that read a data format that presents values in reverse row order.

Parameters:
_ChunkID - The ChunkID of the chunk not to be swapToFiled.
_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:
ChunkID of the AbstractGrid2DSquareCellChunk that is written or null.

writeToFileGrid2DSquareCellChunkExceptReverseOrder

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunkExceptReverseOrder(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except that with; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex. The first chunk that is attempted to be written is that with a chunk row index of _ChunkNRows - 1, and a chunk column index of _ChunkNCols - 1. This is primarily used in constructors that read a data format that presents values in reverse row order.

Parameters:
_ChunkID - The ChunkID of the chunk not to be swapToFiled.

writeToFileGrid2DSquareCellChunksExcept

public final void writeToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs,
                                                          boolean _HandleOutOfMemoryError)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except those that have ChunkID in _ChunkIDs.

Parameters:
_ChunkIDs - A hashSet containing ChunkIDs not to be swapToFiled.
_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.

writeToFileGrid2DSquareCellChunksExcept

protected final void writeToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks except those that have ChunkID in _ChunkIDs.

Parameters:
_ChunkIDs - A hashSet containing ChunkIDs not to be swapToFiled.

swapToFileGrid2DSquareCellChunk

public AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this. This is the lowest level memory handling operation of this class.

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:
ChunkID swapped or null.

swapToFileGrid2DSquareCellChunk

protected final AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunk()
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this.

Returns:
ChunkID swapped or null.

swapToFileGrid2DSquareCellChunkExcept

public final AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                                    boolean _HandleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

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 ChunkID of AbstractGrid2DSquareCellChunk swapped or null.

swapToFileGrid2DSquareCellChunkExcept

protected final AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

Returns:
The ChunkID of AbstractGrid2DSquareCellChunk swapped or null.

swapToFileGrid2DSquareCellChunksExcept

public final java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                      boolean _HandleOutOfMemoryError)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.

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 number of AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunksExcept

protected final java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.

Parameters:
_ChunkID - ChunkID of the AbstractGrid2DSquareCellChunk not to be swapped.
Returns:
A HashSet with the ChunkIDs of those AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunksExcept

public final java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs,
                                                                      boolean _HandleOutOfMemoryError)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkIDs.

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 number of AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunksExcept

protected final java.util.HashSet swapToFileGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.

Parameters:
_ChunkIDs - HashSet of AbstractGrid2DSquareCellChunk.ChunkIDs not to be swapped.
Returns:
A HashSet with the ChunkIDs of those AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunkExcept

public final AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(java.util.HashSet _ChunkIDs,
                                                                                    boolean _HandleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

Parameters:
_ChunkIDs -
_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 ChunkID of the AbstractGrid2DSquareCellChunk swapped or null.

swapToFileGrid2DSquareCellChunkExcept

protected final AbstractGrid2DSquareCell.ChunkID swapToFileGrid2DSquareCellChunkExcept(java.util.HashSet _ChunkIDs)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

Returns:
The ChunkID of the AbstractGrid2DSquareCellChunk swapped or null.

swapToFileGrid2DSquareCellChunks

public final java.util.HashSet swapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
Attempts to swap seriailsed version of all Grid2DSquareCellChunks in this only. To swap seriailsed version of all Grid2DSquareCellChunks in grid2DsquareCells use swapToFileGrid2DSquareCellGrid2DSquareCellChunks(boolean) Swapping involves writing to files and then clearing them from the cache.

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 number of AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunks

protected java.util.HashSet swapToFileGrid2DSquareCellChunks()
Attempts to swap seriailsed version of all _Grid2DSquareCellChunks. This involves writing them to files and then clearing them from the cache.

Returns:
The number of AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunks

public final long swapToFileGrid2DSquareCellChunks(int cri0,
                                                   int cci0,
                                                   int cri1,
                                                   int cci1,
                                                   boolean _HandleOutOfMemoryError)
Attempts to swap seriailsed version of all AbstractGrid2DSquareCellChunk from (cri0, cci0) to (cri1, cci1) in row major order. This involves writing them to files and then clearing them from the cache.

Parameters:
cri0 - The chunk row index of the first AbstractGrid2DSquareCellChunk to be swapped.
cci0 - The chunk column index of the first AbstractGrid2DSquareCellChunk to be swapped.
cri1 - The chunk row index of the last AbstractGrid2DSquareCellChunk to be swapped.
cci1 - The chunk column index of the last AbstractGrid2DSquareCellChunk to be swapped.
_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 number of AbstractGrid2DSquareCellChunk swapped.

swapToFileGrid2DSquareCellChunks

protected final long swapToFileGrid2DSquareCellChunks(int cri0,
                                                      int cci0,
                                                      int cri1,
                                                      int cci1)
Attempts to swap seriailsed version of all AbstractGrid2DSquareCellChunk from (cri0, cci0) to (cri1, cci1) in row major order. This involves writing them to files and then clearing them from the cache.

Parameters:
cri0 - The chunk row index of the first Grid2DSquareCellChunks to be swapped.
cci0 - The chunk column index of the first Grid2DSquareCellChunks to be swapped.
cri1 - The chunk row index of the last Grid2DSquareCellChunks to be swapped.
cci1 - The chunk column index of the last Grid2DSquareCellChunks to be swapped.
Returns:
The number of AbstractGrid2DSquareCellChunk swapped.

isInCache

public final boolean isInCache(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                               boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk tested to see if it is swapToFiled.
_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:
true iff grid2DSquareCellChunk given by _ChunkID is in memory.

isInCache

protected final boolean isInCache(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk tested to see if it is swapToFiled.
Returns:
true iff grid2DSquareCellChunk given by _ChunkID is swapToFiled. This must be an upToDate swapToFile.

clearFromCacheGrid2DSquareCellChunk

protected final void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                         boolean _HandleOutOfMemoryError)
For releasing a grid2DSquareCellChunk stored in memory. This is usually only done after the equivallent of swapToFileChunk(ChunkID) has been called.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk to be cleared.
_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.

clearFromCacheGrid2DSquareCellChunk

protected final void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
For releasing a grid2DSquareCellChunk stored in memory. This is usually only done after the equivallent of swapToFileChunk(ChunkID) has been called.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk to be cleared.

clearFromCacheGrid2DSquareCellChunks

protected final void clearFromCacheGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
For releasing all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.

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.

clearFromCacheGrid2DSquareCellChunks

protected final void clearFromCacheGrid2DSquareCellChunks()
For releasing all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCellChunks.


clearFromCacheGrid2DSquareCellChunks

protected final void clearFromCacheGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs,
                                                          boolean _HandleOutOfMemoryError)
Clears Grid2DSquareCellChunkAbstracts with ChunkIDs in _ChunkIDs.

Parameters:
_ChunkIDs - A HashSet containing the ChunkIDs of the Grid2DSquareCellChunkAbstracts to be cleared.
_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.

clearFromCacheGrid2DSquareCellChunks

protected final void clearFromCacheGrid2DSquareCellChunks(java.util.HashSet _ChunkIDs)
Clears Grid2DSquareCellChunkAbstracts with ChunkIDs in _ChunkIDs.

Parameters:
_ChunkIDs - A HashSet containing the ChunkIDs of the Grid2DSquareCellChunkAbstracts to be cleared.

clearFromCacheGrid2DSquareCellChunkExcept

protected final void clearFromCacheGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                               boolean _HandleOutOfMemoryError)
For releasing a grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk not to be cleared.
_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.

clearFromCacheGrid2DSquareCellChunkExcept

protected final void clearFromCacheGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
For releasing a grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk not to be cleared.

clearFromCacheGrid2DSquareCellChunksExcept

protected final void clearFromCacheGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                boolean _HandleOutOfMemoryError)
For releasing all grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk not to be cleared.
_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.

clearFromCacheGrid2DSquareCellChunksExcept

protected final void clearFromCacheGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
For releasing all grid2DSquareCellChunk stored in memory except that with ChunkID given by _ChunkID.

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk not to be cleared.

clearFromCacheGrid2DSquareCellChunksExcept

protected final void clearFromCacheGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs,
                                                                boolean _HandleOutOfMemoryError)
For releasing all grid2DSquareCellChunk stored in memory except those with ChunkIDs in _ChunkIDs.

Parameters:
_ChunkIDs - The HashSet of ChunkIDs of the _Grid2DSquareCellChunks not to be cleared.
_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.

clearFromCacheGrid2DSquareCellChunksExcept

protected final void clearFromCacheGrid2DSquareCellChunksExcept(java.util.HashSet _ChunkIDs)
For releasing all grid2DSquareCellChunk stored in memory except those with ChunkIDs in _ChunkIDs.

Parameters:
_ChunkIDs - The HashSet of ChunkIDs of the _Grid2DSquareCellChunks not to be cleared.

loadIntoCacheChunk

public final void loadIntoCacheChunk(int _ChunkRowIndex,
                                     int _ChunkColIndex,
                                     boolean _HandleOutOfMemoryError)
Restores a grid2DSquareCellChunk from a swapped cache file.

Parameters:
_ChunkRowIndex - The chunk row index of the grid2DSquareCellChunk to be restored.
_ChunkColIndex - The chunk column index of the grid2DSquareCellChunk to be restored.
_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.

loadIntoCacheChunk

protected final void loadIntoCacheChunk(int _ChunkRowIndex,
                                        int _ChunkColIndex)
Restores a grid2DSquareCellChunk from a swapped cache file.

Parameters:
_ChunkRowIndex - The chunk row index of the grid2DSquareCellChunk to be restored.
_ChunkColIndex - The chunk column index of the grid2DSquareCellChunk to be restored.

loadIntoCacheChunk

public final void loadIntoCacheChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                     boolean _HandleOutOfMemoryError)
Attempts to load into the memory cache a AbstractGrid2DSquareCellChunk with ChunkID

Parameters:
_ChunkID - The ChunkID of the grid2DSquareCellChunk to be restored.
_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.

loadIntoCacheChunk

protected final void loadIntoCacheChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to load into the memory cache AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.

Parameters:
_ChunkID - The ChunkID of the AbstractGrid2DSquareCellChunk to be restored.

loadObject

protected final java.lang.Object loadObject(java.io.File _File,
                                            boolean _HandleOutOfMemoryError)
Loads an object from _File.

Parameters:
_File - The file from which the Object is loaded.
_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 loaded Object or null.

loadObject

protected final java.lang.Object loadObject(java.io.File _File)
Loads an object from _File.

Parameters:
_File - The file from which the Object is loaded.
Returns:
The loaded Object or null.

loadObject

protected final java.lang.Object loadObject(java.io.ObjectInputStream _ObjectInputStream)
Loads an object from _ObjectInputStream.

Parameters:
_ObjectInputStream - The ObjectInputStream from which the Object is loaded.
Returns:
The loaded Object or null.

getCellIDs

public final AbstractGrid2DSquareCell.CellID[] getCellIDs(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:
a CellID[] - the cell IDs for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

getCellIDs

protected final AbstractGrid2DSquareCell.CellID[] getCellIDs(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:
a CellID[] - the cell IDs for cells thats centroids are intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

getCellIDs

public final AbstractGrid2DSquareCell.CellID[] getCellIDs(long _CellRowIndex,
                                                          long _CellColIndex,
                                                          double distance,
                                                          boolean _HandleOutOfMemoryError)
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.
Returns:
a CellID[] - the cell IDs for cells thats centroids would be intersected by circle with centre at centroid of cell given by cell row index _CellRowIndex, cell column index _CellColIndex, and radius distance.

getCellIDs

protected final AbstractGrid2DSquareCell.CellID[] getCellIDs(long _CellRowIndex,
                                                             long _CellColIndex,
                                                             double 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.
Returns:
a CellID[] - the cell IDs for cells thats centroids would be intersected by circle with centre at centroid of cell given by cell row index _CellRowIndex, cell column index _CellColIndex, and radius distance.

getCellIDs

public AbstractGrid2DSquareCell.CellID[] getCellIDs(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.
_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.
Returns:
double[] cells - the values for cells thats centroids would be intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

getCellIDs

protected AbstractGrid2DSquareCell.CellID[] getCellIDs(double x,
                                                       double y,
                                                       long _CellRowIndex,
                                                       long _CellColIndex,
                                                       double distance)
TODO: remove need for copy to new array.

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.
Returns:
double[] cells - the values for cells thats centroids would be intersected by circle with centre at x-coordinate x, y-coordinate y, and radius distance.

getNearestCellID

public AbstractGrid2DSquareCell.CellID getNearestCellID(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:
Nearest cells _CellRowIndex and _CellColIndex as a long[] from ID to point given by x-coordinate x, y-coordinate y.

getNearestCellID

protected AbstractGrid2DSquareCell.CellID getNearestCellID(double x,
                                                           double y)
Parameters:
x - the x-coordinate of the point.
y - the y-coordinate of the point.
Returns:
Nearest cells _CellRowIndex and _CellColIndex as a long[] from ID to point given by x-coordinate x, y-coordinate y.

getNearestCellID

public AbstractGrid2DSquareCell.CellID getNearestCellID(long _CellRowIndex,
                                                        long _CellColIndex,
                                                        boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - the row index from which nearest cell ID is returned.
_CellColIndex - the column index from which nearest cell ID 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. TODO: return CellID[] as could be more than one nearest CellID
Returns:
Nearest cells _CellRowIndex and _CellColIndex as a long[] from ID to point given by cell row index _CellRowIndex, cell column index _CellColIndex.

getNearestCellID

protected AbstractGrid2DSquareCell.CellID getNearestCellID(long _CellRowIndex,
                                                           long _CellColIndex)
Parameters:
_CellRowIndex - the row index from which nearest cell ID is returned.
_CellColIndex - the column index from which nearest cell ID is returned. TODO: return CellID[] as could be more than one nearest CellID
Returns:
Nearest cells _CellRowIndex and _CellColIndex as a long[] from ID to point given by cell row index _CellRowIndex, cell column index _CellColIndex.

getNearestCellID

public AbstractGrid2DSquareCell.CellID getNearestCellID(double x,
                                                        double y,
                                                        long _CellRowIndex,
                                                        long _CellColIndex,
                                                        boolean _HandleOutOfMemoryError)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
_CellRowIndex - The cell row index of cell containing point.
_CellColIndex - The cell column index of cell containing 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:
Nearest CellID to point given by x-coordinate x, y-coordinate y in position given by _CellRowIndex, _CellColIndex.

getNearestCellID

protected AbstractGrid2DSquareCell.CellID getNearestCellID(double x,
                                                           double y,
                                                           long _CellRowIndex,
                                                           long _CellColIndex)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
_CellRowIndex - The cell row index of cell containing point.
_CellColIndex - The cell column index of cell containing point.
Returns:
Nearest CellID to point given by x-coordinate x, y-coordinate y in position given by _CellRowIndex, _CellColIndex.

getHeightDouble

public final double getHeightDouble(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:
Height of the grid.

getHeightDouble

protected final double getHeightDouble()
Returns:
Height of the grid.

getHeightBigDecimal

public final java.math.BigDecimal getHeightBigDecimal(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:
Height of the grid.

getHeightBigDecimal

protected final java.math.BigDecimal getHeightBigDecimal()
Returns:
Height of the grid.

getWidthDouble

public final double getWidthDouble(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:
Width of the grid as a double.

getWidthDouble

protected final double getWidthDouble()
Returns:
Width of the grid as a double.

getWidthBigDecimal

public final java.math.BigDecimal getWidthBigDecimal(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:
Width of the grid as a BigDecimal.

getWidthBigDecimal

protected final java.math.BigDecimal getWidthBigDecimal()
Returns:
Width of the grid as a BigDecimal.

isInGrid

public final boolean isInGrid(java.math.BigDecimal xBigDecimal,
                              java.math.BigDecimal yBigDecimal,
                              boolean _HandleOutOfMemoryError)
Parameters:
xBigDecimal - The x-coordinate of the point.
yBigDecimal - 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:
true iff point given by x-coordinate x, y-coordinate y is in the Grid. Anything on the boundary is considered to be in.

isInGrid

protected final boolean isInGrid(java.math.BigDecimal xBigDecimal,
                                 java.math.BigDecimal yBigDecimal)
Parameters:
xBigDecimal - The x-coordinate of the point.
yBigDecimal - The y-coordinate of the point.
Returns:
true iff point given by x-coordinate x, y-coordinate y is in the Grid. Anything on the boundary is considered to be in.

isInGrid

public final boolean isInGrid(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:
true iff point given by x-coordinate x, y-coordinate y is in the Grid. Anything on the boundary is considered to be in.

isInGrid

protected final boolean isInGrid(double x,
                                 double y)
Parameters:
x - The x-coordinate of the point.
y - The y-coordinate of the point.
Returns:
true iff point given by x-coordinate x, y-coordinate y is in the Grid. Anything on the boundary is considered to be in.

isInGrid

public final boolean isInGrid(long _CellRowIndex,
                              long _CellColIndex,
                              boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - The cell row index to test.
_CellColIndex - The cell column index to test.
_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:
true iff position given by cell row index _CellRowIndex, cell column index _CellColIndex is in the Grid.

isInGrid

protected final boolean isInGrid(long _CellRowIndex,
                                 long _CellColIndex)
Parameters:
_CellRowIndex - The cell row index to test.
_CellColIndex - The cell column index to test.
Returns:
true iff position given by cell row index _CellRowIndex, cell column index _CellColIndex is in the Grid.

isInGrid

public final boolean isInGrid(int _ChunkRowIndex,
                              int _ChunkColIndex,
                              boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex - The chunk row index to test.
_ChunkColIndex - The chunk column index to test.
_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:
true iff position given by chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex is in the Grid.

isInGrid

protected final boolean isInGrid(int _ChunkRowIndex,
                                 int _ChunkColIndex)
Parameters:
_ChunkRowIndex - The chunk row index to test.
_ChunkColIndex - The chunk column index to test.
Returns:
true iff position given by chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex is in the Grid.

isInGrid

public final boolean isInGrid(AbstractGrid2DSquareCell.CellID _CellID,
                              boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of a cell to test.
_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:
true iff cell given by _CellID is in the Grid.

isInGrid

protected final boolean isInGrid(AbstractGrid2DSquareCell.CellID _CellID)
Parameters:
_CellID - The CellID of a cell to test.
Returns:
true iff cell given by _CellID is in the Grid.

isInGrid

public final boolean isInGrid(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                              boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The ChunkID of a cell to test.
_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:
true iff ChunkID _ChunkID is in the Grid.

isInGrid

protected final boolean isInGrid(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The ChunkID of a cell to test.
Returns:
true iff ChunkID _ChunkID is in the Grid.

isInGrid

public final boolean isInGrid(int _ChunkRowIndex,
                              int _ChunkColIndex,
                              int chunkCellRowIndex,
                              int chunkCellColIndex,
                              boolean _HandleOutOfMemoryError)
Parameters:
_ChunkRowIndex -
_ChunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
_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:
true iff cell given by _ChunkRowIndex, _ChunkColIndex, chunkCellRowIndex, chunkCellColIndex is in the Grid.

isInGrid

protected final boolean isInGrid(int _ChunkRowIndex,
                                 int _ChunkColIndex,
                                 int chunkCellRowIndex,
                                 int chunkCellColIndex)
Parameters:
_ChunkRowIndex -
_ChunkColIndex -
chunkCellRowIndex -
chunkCellColIndex -
Returns:
true iff cell given by _ChunkRowIndex, _ChunkColIndex, chunkCellRowIndex, chunkCellColIndex is in the Grid.

getCellXBigDecimal

public final java.math.BigDecimal getCellXBigDecimal(long _CellColIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate 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 x-coordinate of the centroid for cells with column index _CellColIndex as a BigDecimal.

getCellXBigDecimal

public final java.math.BigDecimal getCellXBigDecimal(long _CellColIndex,
                                                     int _ChunkRowIndex,
                                                     int _ChunkColIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_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:
x-coordinate of the centroid for cells with column index _CellColIndex as a BigDecimal.

getCellXBigDecimal

protected final java.math.BigDecimal getCellXBigDecimal(long _CellColIndex)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate is returned.
Returns:
the x-coordinate of the centroid for cells with column index _CellColIndex as a BigDecimal.

getCellXDouble

public final double getCellXDouble(long _CellColIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate 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:
x-coordinate of the centroid for cells with column index _CellColIndex as a double.

getCellXDouble

public final double getCellXDouble(long _CellColIndex,
                                   boolean _HandleOutOfMemoryError,
                                   AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate 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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
x-coordinate of the centroid for cells with column index _CellColIndex as a double.

getCellXDouble

public final double getCellXDouble(int chunkCellColIndex,
                                   int _ChunkRowIndex,
                                   int _ChunkColIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
chunkCellColIndex - The cell column index thats centroid x-coordinate is returned.
_ChunkRowIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_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:
x-coordinate of the centroid for cells with column index _CellColIndex as a double.

getCellXDouble

protected final double getCellXDouble(int chunkCellColIndex,
                                      int _ChunkColIndex)
Parameters:
chunkCellColIndex - The cell column index thats centroid x-coordinate is returned.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
x-coordinate of the centroid for cells with column index _CellColIndex as a double.

getCellXDouble

protected final double getCellXDouble(long _CellColIndex)
Parameters:
_CellColIndex - The cell column index thats centroid x-coordinate is returned.
Returns:
x-coordinate of the centroid for cells with column index _CellColIndex as a double.

getCellXBigDecimal

public final java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellID -
_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:
x-coordinate of the centroid for cell with cell ID _CellID as a BigDecimal.

getCellXBigDecimal

public final java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID,
                                                     int _ChunkRowIndex,
                                                     int _ChunkColIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of the cell thats centroid is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
x-coordinate of the centroid of cell with CellID _CellID as a getCellXBigDecimal.

getCellXBigDecimal

protected final java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID _CellID)
Parameters:
_CellID -
Returns:
x-coordinate of the centroid for cell with cell ID _CellID as a BigDecimal.

getCellXDouble

public final double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellID -
_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:
x-coordinate of the centroid for cell with cell ID _CellID as a double

getCellXDouble

public final double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID,
                                   int _ChunkRowIndex,
                                   int _ChunkColIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of the cell thats centroid is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
x-coordinate of the centroid of cell with CellID _CellID as a double.

getCellXDouble

protected final double getCellXDouble(AbstractGrid2DSquareCell.CellID _CellID)
Parameters:
_CellID -
Returns:
x-coordinate of the centroid for cell with cell ID _CellID as a double

getCellYBigDecimal

public final java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate 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:
y-coordinate of the centroid for cells with row index _CellRowIndex as a BigDecimal.

getCellYBigDecimal

public final java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex,
                                                     int _ChunkRowIndex,
                                                     int _ChunkColIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
y-coordinate of the centroid for cells with row index _CellRowIndex as a BigDecimal.

getCellYBigDecimal

protected final java.math.BigDecimal getCellYBigDecimal(long _CellRowIndex)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate is returned.
Returns:
y-coordinate of the centroid for cells with row index _CellRowIndex as a BigDecimal.

getCellYDouble

public final double getCellYDouble(long _CellRowIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate 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:
y-coordinate of the centroid for cells with row index _CellRowIndex as a double.

getCellYDouble

public final double getCellYDouble(long _CellRowIndex,
                                   boolean _HandleOutOfMemoryError,
                                   AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate 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.
_ChunkID - This is a ChunkID for those AbstractGrid2DSquareCells not to be swapped if possible when an OutOfMemoryError is encountered.
Returns:
y-coordinate of the centroid for cells with row index _CellRowIndex as a double.

getCellYDouble

public final double getCellYDouble(int chunkCellRowIndex,
                                   int _ChunkRowIndex,
                                   int _ChunkColIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
chunkCellRowIndex - the chunk cell column index thats centroid y-coordinate is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_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:
y-coordinate of the centroid for cells with row index _CellRowIndex as a double.

getCellYDouble

protected final double getCellYDouble(int chunkCellRowIndex,
                                      int _ChunkRowIndex)
Parameters:
chunkCellRowIndex - the chunk cell column index thats centroid y-coordinate is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
y-coordinate of the centroid for cells with row index _CellRowIndex as a double.

getCellYDouble

protected final double getCellYDouble(long _CellRowIndex)
Parameters:
_CellRowIndex - the cell column index thats centroid y-coordinate is returned.
Returns:
y-coordinate of the centroid for cells with row index _CellRowIndex as a double.

getCellYBigDecimal

public final java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of the cell thats centroid 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:
y-coordinate of the centroid of cell with CellID _CellID as a BigDecimal.

getCellYBigDecimal

public final java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID,
                                                     int _ChunkRowIndex,
                                                     int _ChunkColIndex,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of the cell thats centroid is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
y-coordinate of the centroid of cell with CellID _CellID as a BigDecimal.

getCellYBigDecimal

protected final java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID)
Parameters:
_CellID - The CellID of the cell thats centroid is returned.
Returns:
y-coordinate of the centroid of cell with CellID _CellID as a BigDecimal.

getCellYDouble

public final double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellID -
_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:
y-coordinate of the centroid of cell with CellID _CellID as a double.

getCellYDouble

public final double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID,
                                   int _ChunkRowIndex,
                                   int _ChunkColIndex,
                                   boolean _HandleOutOfMemoryError)
Parameters:
_CellID - The CellID of the cell thats centroid is returned.
_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
_ChunkColIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
Returns:
y-coordinate of the centroid of cell with CellID _CellID as a double.

getCellYDouble

protected final double getCellYDouble(AbstractGrid2DSquareCell.CellID _CellID)
Parameters:
_CellID -
Returns:
the y-coordinate of the centroid of cell with CellID _CellID as a double.

getGridBounds

public final double[] getGridBounds(boolean _HandleOutOfMemoryError)
TODO: Are bounds in double range? Is there more than cellsize difference with precision? Throw appropriate exceptions.

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:
gridBounds (the bounding box of the grid) as a double[] where; gridBounds[0] xmin, left most x-coordinate of this gridBounds[1] ymin, lowest y-coordinate of this gridBounds[2] xmax, right most x-coordinate of this gridBounds[3] ymax, highest y-coordinate of this

getGridBounds

protected final double[] getGridBounds()
Returns:
gridBounds (the bounding box of the grid) as a double[] where; gridBounds[0] xmin, left most x-coordinate of this gridBounds[1] ymin, lowest y-coordinate of this gridBounds[2] xmax, right most x-coordinate of this gridBounds[3] ymax, highest y-coordinate of this TODO: Are bounds in double range? Is there more than cellsize difference with precision? Throw appropriate exceptions.

getCellBoundsDoubleArray

public final double[] getCellBoundsDoubleArray(long _CellRowIndex,
                                               long _CellColIndex,
                                               boolean _HandleOutOfMemoryError)
Parameters:
_CellRowIndex - the row index of the cell for which the bounds are returned
_CellColIndex - the column index of the cell for which the bounds 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:
double[] where; double[0] xmin, left most x-coordinate of cell at (rowIndex,colIndex) double[1] ymin, lowest y-coordinate of cell at (rowIndex,colIndex) double[2] xmax, right most x-coordinate of cell at (rowIndex,colIndex) double[3] ymax, highest y-coordinate of cell at (rowIndex,colIndex)

getCellBoundsDoubleArray

protected final double[] getCellBoundsDoubleArray(long _CellRowIndex,
                                                  long _CellColIndex)
Parameters:
_CellRowIndex - the row index of the cell for which the bounds are returned
_CellColIndex - the column index of the cell for which the bounds are returned
Returns:
double[] where; double[0] xmin, left most x-coordinate of cell at (rowIndex,colIndex) double[1] ymin, lowest y-coordinate of cell at (rowIndex,colIndex) double[2] xmax, right most x-coordinate of cell at (rowIndex,colIndex) double[3] ymax, highest y-coordinate of cell at (rowIndex,colIndex)

getCellBoundsDoubleArray

public final double[] getCellBoundsDoubleArray(double x,
                                               double y,
                                               boolean _HandleOutOfMemoryError)
Precision may compromise result. More precision is available via

Parameters:
x - the x-coordinate in the cell for which the bounds are returned
y - the y-coordinate in the cell for which the bounds 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:
double[] where; double[0] xmin, left most x-coordinate of cell that intersects point at (x,y) double[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) double[2] xmax, right most x-coordinate of cell that intersects point at (x,y) double[3] ymax, highest y-coordinate of cell that intersects point at (x,y)

getCellBoundsDoubleArray

protected final double[] getCellBoundsDoubleArray(double x,
                                                  double y)
Precision may compromise result. More precision is available via BigDecimal arithmetic.

Parameters:
x - the x-coordinate in the cell for which the bounds are returned
y - the y-coordinate in the cell for which the bounds are returned
Returns:
double[] where; double[0] xmin, left most x-coordinate of cell that intersects point at (x,y) double[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) double[2] xmax, right most x-coordinate of cell that intersects point at (x,y) double[3] ymax, highest y-coordinate of cell that intersects point at (x,y)

getNoDataValueBigDecimal

public abstract java.math.BigDecimal getNoDataValueBigDecimal(boolean _HandleOutOfMemoryError)
Returns:
the _NoDataValue of this as a BigDecimal.

getNextChunk

public AbstractGrid2DSquareCell.ChunkID getNextChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                     int _NChunkRows,
                                                     int _NChunkCols,
                                                     boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
_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 next ChunkID in row major order from _ChunkID, or null.

getNextChunk

protected AbstractGrid2DSquareCell.ChunkID getNextChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                        int _NChunkRows,
                                                        int _NChunkCols)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
Returns:
the next ChunkID in row major order from _ChunkID, or null.

getNextChunkRowMinor

public AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                             int _NChunkRows,
                                                             int _NChunkCols,
                                                             boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
_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 next ChunkID in row minor order from this, or null.

getNextChunkRowMinor

protected AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                int _NChunkRows,
                                                                int _NChunkCols)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
Returns:
the next ChunkID in row minor order from this, or null.

getPreviousChunk

public AbstractGrid2DSquareCell.ChunkID getPreviousChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                         int _NChunkRows,
                                                         int _NChunkCols,
                                                         boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
_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 next ChunkID in row major order from this, or null.

getPreviousChunk

protected AbstractGrid2DSquareCell.ChunkID getPreviousChunk(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                            int _NChunkRows,
                                                            int _NChunkCols)
Parameters:
_ChunkID -
_NChunkRows -
_NChunkCols -
Returns:
the next ChunkID in row major order from this, or null.