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

java.lang.Object
  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 java.lang.Object
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  java.util.HashMap<AbstractGrid2DSquareCell.ChunkID,AbstractGrid2DSquareCellChunk> _ChunkID_AbstractGrid2DSquareCellChunk_HashMap
          The AbstractGrid2DSquareCellChunk data cache.
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.
 Grids_Environment _Grids_Environment
          The Grids_Environment for calling out to other code and general memory handling.
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.
 
Constructor Summary
AbstractGrid2DSquareCell()
           
 
Method Summary
protected  void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
          For releasing a grid2DSquareCellChunk stored in memory.
protected  void clearFromCacheGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
          For releasing a grid2DSquareCellChunk stored in memory.
protected  void clearFromCacheGrid2DSquareCellChunks()
          For releasing all AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.
protected  void clearFromCacheGrid2DSquareCellChunks(boolean handleOutOfMemoryError)
          For releasing all AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.
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 a_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  java.math.BigDecimal[] getCellBounds_BigDecimalArray(java.math.BigDecimal x, java.math.BigDecimal y)
           
 java.math.BigDecimal[] getCellBounds_BigDecimalArray(java.math.BigDecimal x, java.math.BigDecimal y, boolean handleOutOfMemoryError)
           
protected  java.math.BigDecimal[] getCellBounds_BigDecimalArray(long _CellRowIndex, long _CellColIndex)
           
 java.math.BigDecimal[] getCellBounds_BigDecimalArray(long _CellRowIndex, long _CellColIndex, 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 x_BigDecimal)
           
 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, AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
 long getCellColIndex(int chunkColIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
           
protected  long getCellColIndex(java.util.Random a_Random)
           
 long getCellColIndex(java.util.Random a_Random, boolean handleOutOfMemoryError)
           
protected  double getCellDouble(AbstractGrid2DSquareCellChunk grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex)
          TODO
 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)
          TODO
 double getCellDouble(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
           
protected  double getCellDouble(long a_CellRowIndex, long a_CellColIndex)
           
 double getCellDouble(long a_CellRowIndex, long a_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 a_CellRowIndex, long a_CellColIndex)
           
 AbstractGrid2DSquareCell.CellID getCellID(long a_CellRowIndex, long a_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 a_CellRowIndex, long a_CellColIndex, boolean handleOutOfMemoryError)
           
protected  long getCellRowIndex(java.math.BigDecimal y_BigDecimal)
           
 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, AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
 long getCellRowIndex(int chunkRowIndex, int chunkCellRowIndex, boolean handleOutOfMemoryError)
           
 long getCellRowIndex(int chunkRowIndex, int chunkCellRowIndex, java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> a_Grid2DSquareCell_ChunkID_HashSet_HashMap, boolean handleOutOfMemoryError)
          If OutOfMemoryError is caught then an attempt is made to swap an AbstractGrid2DSquareCellChunk not in _Grid2DSquareCell_ChunkIDHashSet.
protected  long getCellRowIndex(java.util.Random a_Random)
           
 long getCellRowIndex(java.util.Random a_Random, boolean handleOutOfMemoryError)
           
 double getCellsizeDouble(boolean handleOutOfMemoryError)
           
protected  java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID a_CellID)
           
 java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID a_CellID, boolean handleOutOfMemoryError)
           
 java.math.BigDecimal getCellXBigDecimal(AbstractGrid2DSquareCell.CellID a_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 a_CellID, boolean handleOutOfMemoryError)
           
 double getCellXDouble(AbstractGrid2DSquareCell.CellID a_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 a_ChunkID)
           
protected  java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID _CellID)
           
 java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID a_CellID, boolean handleOutOfMemoryError)
           
 java.math.BigDecimal getCellYBigDecimal(AbstractGrid2DSquareCell.CellID a_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 a_CellID, boolean handleOutOfMemoryError)
           
 double getCellYDouble(AbstractGrid2DSquareCell.CellID a_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 a_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 a_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<AbstractGrid2DSquareCell.ChunkID> getChunkIDs(double distance, double x, double y, long cellRowIndex, long cellColIndex)
           
protected  int getChunkNCols(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 int getChunkNCols(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
protected  int getChunkNcolsFinalColChunks()
           
protected  int getChunkNcolsFinalColChunks(boolean handleOutOfMemoryError)
           
protected  int getChunkNRows(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 int getChunkNRows(AbstractGrid2DSquareCell.ChunkID a_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 a_ChunkID)
           
 AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int a_ChunkRowIndex, int a_ChunkColIndex)
           
protected  AbstractGrid2DSquareCellChunk getGrid2DSquareCellChunk(int a_ChunkRowIndex, int a_ChunkColIndex, boolean handleOutOfMemoryError)
           
protected  java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> getGrid2DSquareCellChunkIDHashSet()
           
 java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> getGrid2DSquareCellChunkIDHashSet(boolean handleOutOfMemoryError)
           
 java.util.HashSet<AbstractGrid2DSquareCell> 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)
           
 java.math.BigDecimal getHalfCellsize()
           
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 a_ChunkID, int nChunkRows, int nChunkCols)
           
 AbstractGrid2DSquareCell.ChunkID getNextChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, int nChunkRows, int nChunkCols, boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID a_ChunkID, int nChunkRows, int nChunkCols)
           
 AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID a_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 a_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[] a_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 a_Grid2DSquareCell)
          Initialises non transient AbstractGrid2DSquareCell fields from _Grid2DSquareCell.
protected  void initGrid2DSquareCell(Grids_Environment a_Grids_Environment)
           
protected  void initGrid2DSquareCell(Grids_Environment a_Grids_Environment, boolean handleOutOfMemoryError)
          Initialises this from a_Grids_Environment.
protected  void initGrid2DSquareCellChunks(java.io.File grid_File)
          Initialises this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap by first attempting to load from new File( grid_File, "cache" );
protected  void initGrid2DSquareCellChunks(java.io.File grid_File, boolean handleOutOfMemoryError)
          Initialises this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap by first attempting to load from new File( grid_File, "cache" );
protected  boolean isInCache(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
protected  boolean isInGrid(AbstractGrid2DSquareCell.CellID a_CellID)
           
 boolean isInGrid(AbstractGrid2DSquareCell.CellID a_CellID, boolean handleOutOfMemoryError)
           
protected  boolean isInGrid(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 boolean isInGrid(AbstractGrid2DSquareCell.ChunkID a_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 a_ChunkID)
          Attempts to load into the memory cache AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.
 void loadIntoCacheChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
          Attempts to load into the memory cache a AbstractGrid2DSquareCellChunk with ChunkID
 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)
           
 void setChunk(AbstractGrid2DSquareCellChunk a_Grid2DSquareCellChunk, AbstractGrid2DSquareCell.ChunkID a_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  long swapToFile_Grid2DSquareCellChunk_Account()
           
 long swapToFile_Grid2DSquareCellChunk_Account(boolean handleOutOfMemoryError)
           
protected  AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunk_AccountChunk()
           
 AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunk_AccountChunk(boolean handleOutOfMemoryError)
           
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunk_AccountDetail()
           
 java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunk_AccountDetail(boolean handleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this.
protected  void swapToFile_Grid2DSquareCellChunk()
           
protected  void swapToFile_Grid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 void swapToFile_Grid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
 void swapToFile_Grid2DSquareCellChunk(boolean handleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this.
protected  long swapToFile_Grid2DSquareCellChunkExcept_Account(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
protected  AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
 AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
           
 AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
           
 AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet, boolean handleOutOfMemoryError)
           
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.
 java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
          Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.
protected  long swapToFile_Grid2DSquareCellChunks_Account()
           
protected  long swapToFile_Grid2DSquareCellChunks_Account(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 swapToFile_Grid2DSquareCellChunks_Account(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  long swapToFile_Grid2DSquareCellChunks_Account(java.util.Set<AbstractGrid2DSquareCell.ChunkID> b_ChunkID_Set)
           
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunks_AccountDetail()
          Attempts to swap seriailsed version of all _ChunkID_AbstractGrid2DSquareCellChunk_HashMap.
 java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunks_AccountDetail(boolean handleOutOfMemoryError)
          Attempts to swap seriailsed version of all Grid2DSquareCellChunks in this only.
protected  void swapToFile_Grid2DSquareCellChunks()
           
 void swapToFile_Grid2DSquareCellChunks(boolean handleOutOfMemoryError)
           
protected  long swapToFile_Grid2DSquareCellChunksExcept_Account(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
           
protected  long swapToFile_Grid2DSquareCellChunksExcept_Account(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
           
 long swapToFile_Grid2DSquareCellChunksExcept_Account(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet, boolean handleOutOfMemoryError)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkIDs.
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunksExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.
 java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunksExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID, boolean handleOutOfMemoryError)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID a_ChunkID.
protected  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunksExcept_AccountDetail(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
          Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.
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._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.
protected  boolean writeToFileGrid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap given by _ChunkID.
protected  boolean writeToFileGrid2DSquareCellChunk(int a_ChunkRowIndex, int a_ChunkColIndex)
          Attempts to write to File a seriailized version of the AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap given by; chunk row index _ChunkRowIndex, chunk column index _ChunkColIndex.
protected  void writeToFileGrid2DSquareCellChunks()
          Attempts to write to File seriailized versions of all AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.
protected  void writeToFileGrid2DSquareCellChunks(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
          Attempts to write to File seriailized versions of those AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap that have ChunkID equal to those in _ChunkIDs.
protected  void writeToFileSwapping(boolean swapToFileCache)
          Attempts to write this instance to Files located in the _Directory returned by get_Directory().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Grids_Environment

public transient Grids_Environment _Grids_Environment
The Grids_Environment for calling out to other code and general memory handling.


_Directory

protected transient java.io.File _Directory
Local _Directory used for caching. TODO If this were not transient upon reloading, it would be possible to ascertain what it was which has its uses.


_ChunkID_AbstractGrid2DSquareCellChunk_HashMap

protected transient java.util.HashMap<AbstractGrid2DSquareCell.ChunkID,AbstractGrid2DSquareCellChunk> _ChunkID_AbstractGrid2DSquareCellChunk_HashMap
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. TODO Set this based on input data (Default value wanted?)


_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 grid_File,
                                          boolean handleOutOfMemoryError)
Initialises this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap by first attempting to load from new File( grid_File, "cache" );

Parameters:
grid_File - The File directory that from which a file called cache is attempted to be loaded

initGrid2DSquareCellChunks

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

Parameters:
grid_File - The File directory that from which a file called cache is attempted to be loaded

initGrid2DSquareCell

protected void initGrid2DSquareCell(Grids_Environment a_Grids_Environment,
                                    boolean handleOutOfMemoryError)
Initialises this from a_Grids_Environment.


initGrid2DSquareCell

protected void initGrid2DSquareCell(Grids_Environment a_Grids_Environment)

initGrid2DSquareCell

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

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

getGrid2DSquareCells

public java.util.HashSet<AbstractGrid2DSquareCell> getGrid2DSquareCells(boolean handleOutOfMemoryError)
Returns:
a reference to this._AbstractGrid2DSquareCell_HashSet

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 a_ChunkRowIndex,
                                                                 int a_ChunkColIndex,
                                                                 boolean handleOutOfMemoryError)
Parameters:
a_ChunkRowIndex - The ChunkID._ChunkRowIndex of the returned AbstractGrid2DSquareCellChunk.
a_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 a_ChunkRowIndex,
                                                                 int a_ChunkColIndex)
Parameters:
a_ChunkRowIndex - The ChunkID._ChunkRowIndex of the returned AbstractGrid2DSquareCellChunk.
a_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 a_ChunkID,
                                                              boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID)
Parameters:
a_ChunkID - The ChunkID of the returned AbstractGrid2DSquareCellChunk.
Returns:
the AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.

getGrid2DSquareCellChunkIDHashSet

public java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> 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 _ChunkID_AbstractGrid2DSquareCellChunk_HashMap.ChunkID's.

getGrid2DSquareCellChunkIDHashSet

protected java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> getGrid2DSquareCellChunkIDHashSet()
Returns:
HashSet containing all _ChunkID_AbstractGrid2DSquareCellChunk_HashMap.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 a_Grid2DSquareCellChunk,
                     AbstractGrid2DSquareCell.ChunkID a_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.
a_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:
a_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:
a_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:
a_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 a_ChunkID)
Parameters:
a_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.
a_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:
a_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 a_ChunkID,
                               boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID)
Parameters:
a_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 a_ChunkID,
                               boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID)
Parameters:
a_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[] a_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 a_CellRowIndex,
                            long a_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 a_CellRowIndex,
                               long a_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:
a_ChunkRowIndex - The cell chunk row index.
a_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)
TODO

Parameters:
a_ChunkRowIndex - The cell chunk row index.
a_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.
a_ChunkRowIndex - The cell chunk row index.
a_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)
TODO

Parameters:
grid2DSquareCellChunk - The AbstractGrid2DSquareCellChunk containing the cell.
a_ChunkRowIndex - The cell chunk row index.
a_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 a_CellRowIndex,
                      long a_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:
a_ChunkRowIndex - The cell chunk row index.
a_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:
a_ChunkRowIndex - The cell chunk row index.
a_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.
a_ChunkRowIndex - The cell chunk row index.
a_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.
a_ChunkRowIndex - The cell chunk row index.
a_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

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<AbstractGrid2DSquareCell.ChunkID> 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 x_BigDecimal)
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:
a_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,
                                  AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                  boolean handleOutOfMemoryError)
Parameters:
a_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.
a_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:
a_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.

getCellColIndex

public final long getCellColIndex(java.util.Random a_Random,
                                  boolean handleOutOfMemoryError)
Returns:
A Random CellColIndex.

getCellColIndex

protected final long getCellColIndex(java.util.Random a_Random)
Returns:
A Random 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 y_BigDecimal)
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:
a_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,
                                  AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                  boolean handleOutOfMemoryError)
Parameters:
a_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.
a_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,
                                  java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> a_Grid2DSquareCell_ChunkID_HashSet_HashMap,
                                  boolean handleOutOfMemoryError)
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:
a_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:
a_ChunkRowIndex -
chunkCellRowIndex -
Returns:
CellRowIndex for the cells in chunk _ChunkRowIndex, chunk cell column index chunkCellRowIndex.

getCellRowIndex

public final long getCellRowIndex(java.util.Random a_Random,
                                  boolean handleOutOfMemoryError)
Returns:
A Random CellRowIndex.

getCellRowIndex

protected final long getCellRowIndex(java.util.Random a_Random)
Returns:
A Random CellRowIndex.

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 a_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 a_CellRowIndex,
                                                       long a_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 a_CellRowIndex,
                                                          long a_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(). First attempts to do this without swapping out data, but if this fails because an OutOfMemoryError is encountered then it retires swapping out chunks as it goes.

Parameters:
swapToFileCache - Iff true then this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap 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(). Chunks are all written but no data is swapped

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

writeToFileSwapping

protected void writeToFileSwapping(boolean swapToFileCache)
                            throws java.io.IOException
Attempts to write this instance to Files located in the _Directory returned by get_Directory(). Chunks are all swapped to file.

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

writeToFileGrid2DSquareCellChunk

protected final AbstractGrid2DSquareCell.ChunkID writeToFileGrid2DSquareCellChunk()
Attempts to write to File a seriailized version of a AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap. 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

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

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

writeToFileGrid2DSquareCellChunk

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

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

writeToFileGrid2DSquareCellChunks

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


writeToFileGrid2DSquareCellChunks

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

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

swapToFile_Grid2DSquareCellChunk_AccountDetail

public java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunk_AccountDetail(boolean handleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this. This is one of 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:
HashMap for accounting what was swapped.

swapToFile_Grid2DSquareCellChunk_AccountDetail

protected java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunk_AccountDetail()

swapToFile_Grid2DSquareCellChunk_AccountChunk

public AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunk_AccountChunk(boolean handleOutOfMemoryError)
Parameters:
handleOutOfMemoryError -
Returns:

swapToFile_Grid2DSquareCellChunk_AccountChunk

protected AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunk_AccountChunk()

swapToFile_Grid2DSquareCellChunks_Account

protected long swapToFile_Grid2DSquareCellChunks_Account()

swapToFile_Grid2DSquareCellChunks_Account

protected long swapToFile_Grid2DSquareCellChunks_Account(java.util.Set<AbstractGrid2DSquareCell.ChunkID> b_ChunkID_Set)

swapToFile_Grid2DSquareCellChunkExcept_AccountChunk

public AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet,
                                                                                            boolean handleOutOfMemoryError)

swapToFile_Grid2DSquareCellChunkExcept_AccountChunk

public AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)

swapToFile_Grid2DSquareCellChunk

public void swapToFile_Grid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                             boolean handleOutOfMemoryError)

swapToFile_Grid2DSquareCellChunk

protected void swapToFile_Grid2DSquareCellChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)

swapToFile_Grid2DSquareCellChunk

public void swapToFile_Grid2DSquareCellChunk(boolean handleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this. This is one of 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.

swapToFile_Grid2DSquareCellChunk

protected void swapToFile_Grid2DSquareCellChunk()

swapToFile_Grid2DSquareCellChunk_Account

public long swapToFile_Grid2DSquareCellChunk_Account(boolean handleOutOfMemoryError)

swapToFile_Grid2DSquareCellChunk_Account

protected long swapToFile_Grid2DSquareCellChunk_Account()

swapToFile_Grid2DSquareCellChunkExcept_AccountDetail

public java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                                                                                                                            boolean handleOutOfMemoryError)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.

Parameters:
a_ChunkID - A ChunkID not 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 ChunkID of AbstractGrid2DSquareCellChunk swapped or null.

swapToFile_Grid2DSquareCellChunkExcept_AccountDetail

protected java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.

Returns:
The ChunkID of AbstractGrid2DSquareCellChunk swapped or null.

swapToFile_Grid2DSquareCellChunkExcept_AccountChunk

public AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                                                            boolean handleOutOfMemoryError)

swapToFile_Grid2DSquareCellChunkExcept_AccountChunk

protected AbstractGrid2DSquareCell.ChunkID swapToFile_Grid2DSquareCellChunkExcept_AccountChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID)

swapToFile_Grid2DSquareCellChunksExcept_AccountDetail

public final java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunksExcept_AccountDetail(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                                                                                                                                   boolean handleOutOfMemoryError)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID a_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.

swapToFile_Grid2DSquareCellChunksExcept_AccountDetail

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

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

swapToFile_Grid2DSquareCellChunks

public void swapToFile_Grid2DSquareCellChunks(boolean handleOutOfMemoryError)

swapToFile_Grid2DSquareCellChunks

protected void swapToFile_Grid2DSquareCellChunks()

swapToFile_Grid2DSquareCellChunksExcept_Account

public long swapToFile_Grid2DSquareCellChunksExcept_Account(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet,
                                                            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.

swapToFile_Grid2DSquareCellChunksExcept_AccountDetail

protected final java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunksExcept_AccountDetail(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
Attempts to write to file and clear from the cache all Grid2DSquareCellChunkAbstracts in this except that with ChunkID _ChunkID.

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

swapToFile_Grid2DSquareCellChunkExcept_Account

protected long swapToFile_Grid2DSquareCellChunkExcept_Account(AbstractGrid2DSquareCell.ChunkID a_ChunkID)

swapToFile_Grid2DSquareCellChunksExcept_Account

protected long swapToFile_Grid2DSquareCellChunksExcept_Account(AbstractGrid2DSquareCell.ChunkID a_ChunkID)

swapToFile_Grid2DSquareCellChunksExcept_Account

protected long swapToFile_Grid2DSquareCellChunksExcept_Account(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)

swapToFile_Grid2DSquareCellChunkExcept_AccountDetail

protected final java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunkExcept_AccountDetail(java.util.HashSet<AbstractGrid2DSquareCell.ChunkID> a_ChunkID_HashSet)
Attempts to write to file and clear from the cache a AbstractGrid2DSquareCellChunk in this._AbstractGrid2DSquareCell_HashSet.

Returns:
The ChunkID of the AbstractGrid2DSquareCellChunk swapped or null.

swapToFile_Grid2DSquareCellChunks_AccountDetail

public final java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunks_AccountDetail(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.

swapToFile_Grid2DSquareCellChunks_AccountDetail

protected java.util.HashMap<AbstractGrid2DSquareCell,java.util.HashSet<AbstractGrid2DSquareCell.ChunkID>> swapToFile_Grid2DSquareCellChunks_AccountDetail()
Attempts to swap seriailsed version of all _ChunkID_AbstractGrid2DSquareCellChunk_HashMap. This involves writing them to files and then clearing them from the cache.

Returns:
The number of AbstractGrid2DSquareCellChunk swapped.

swapToFile_Grid2DSquareCellChunks_Account

public final long swapToFile_Grid2DSquareCellChunks_Account(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.

swapToFile_Grid2DSquareCellChunks_Account

protected final long swapToFile_Grid2DSquareCellChunks_Account(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

protected final boolean isInCache(AbstractGrid2DSquareCell.ChunkID a_ChunkID)
Parameters:
a_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 a_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:
a_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 a_ChunkID)
For releasing a grid2DSquareCellChunk stored in memory. This is usually only done after the equivallent of swapToFileChunk(ChunkID) has been called.

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

clearFromCacheGrid2DSquareCellChunks

protected final void clearFromCacheGrid2DSquareCellChunks(boolean handleOutOfMemoryError)
For releasing all AbstractGrid2DSquareCellChunk in this._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.

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._ChunkID_AbstractGrid2DSquareCellChunk_HashMap.


loadIntoCacheChunk

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

Parameters:
a_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 a_ChunkID)
Attempts to load into the memory cache AbstractGrid2DSquareCellChunk with ChunkID equal to _ChunkID.

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

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:
a_ChunkRowIndex - The chunk row index to test.
a_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:
a_ChunkRowIndex - The chunk row index to test.
a_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 a_CellID,
                              boolean handleOutOfMemoryError)
Parameters:
a_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 a_CellID)
Parameters:
a_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 a_ChunkID,
                              boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID)
Parameters:
a_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:
a_ChunkRowIndex -
a_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:
a_ChunkRowIndex -
a_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.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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.

getHalfCellsize

public java.math.BigDecimal getHalfCellsize()

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 a_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.
a_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.
a_ChunkRowIndex - The chunk column index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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.
a_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 a_CellID,
                                                     boolean handleOutOfMemoryError)
Parameters:
a_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 a_CellID,
                                                     int chunkRowIndex,
                                                     int chunkColIndex,
                                                     boolean handleOutOfMemoryError)
Parameters:
a_CellID - The CellID of the cell thats centroid is returned.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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 a_CellID)
Parameters:
a_CellID -
Returns:
x-coordinate of the centroid for cell with cell ID _CellID as a BigDecimal.

getCellXDouble

public final double getCellXDouble(AbstractGrid2DSquareCell.CellID a_CellID,
                                   boolean handleOutOfMemoryError)
Parameters:
a_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 a_CellID,
                                   int chunkRowIndex,
                                   int chunkColIndex,
                                   boolean handleOutOfMemoryError)
Parameters:
a_CellID - The CellID of the cell thats centroid is returned.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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:
a_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.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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 a_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.
a_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.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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.
a_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 a_CellID,
                                                     boolean handleOutOfMemoryError)
Parameters:
a_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 a_CellID,
                                                     int chunkRowIndex,
                                                     int chunkColIndex,
                                                     boolean handleOutOfMemoryError)
Parameters:
a_CellID - The CellID of the cell thats centroid is returned.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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:
a_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 a_CellID,
                                   boolean handleOutOfMemoryError)
Parameters:
a_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 a_CellID,
                                   int chunkRowIndex,
                                   int chunkColIndex,
                                   boolean handleOutOfMemoryError)
Parameters:
a_CellID - The CellID of the cell thats centroid is returned.
a_ChunkRowIndex - The chunk row index of the AbstractGrid2DSquareCellChunk not to be swapped if an OutOfMemoryError is thrown.
a_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:
a_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)

getCellBounds_BigDecimalArray

public final java.math.BigDecimal[] getCellBounds_BigDecimalArray(java.math.BigDecimal x,
                                                                  java.math.BigDecimal y,
                                                                  boolean handleOutOfMemoryError)
Parameters:
x - the centroid x-coordinate of the cell for which the bounds are returned.
y - the centroid y-coordinate of the cell for which the bounds are returned.
Returns:
BigDecimal[] cellBounds_BigDecimalArray; cellBounds_BigDecimalArray[0] xmin, left most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[2] xmax, right most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[3] ymax, highest y-coordinate of cell that intersects point at (x,y)

getCellBounds_BigDecimalArray

protected final java.math.BigDecimal[] getCellBounds_BigDecimalArray(java.math.BigDecimal x,
                                                                     java.math.BigDecimal y)
Parameters:
x - the centroid x-coordinate of the cell for which the bounds are returned.
y - the centroid y-coordinate of the cell for which the bounds are returned.
Returns:
BigDecimal[] cellBounds_BigDecimalArray; cellBounds_BigDecimalArray[0] xmin, left most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[2] xmax, right most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[3] ymax, highest y-coordinate of cell that intersects point at (x,y)

getCellBounds_BigDecimalArray

public final java.math.BigDecimal[] getCellBounds_BigDecimalArray(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
Returns:
BigDecimal[] cellBounds_BigDecimalArray; cellBounds_BigDecimalArray[0] xmin, left most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[2] xmax, right most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[3] ymax, highest y-coordinate of cell that intersects point at (x,y)

getCellBounds_BigDecimalArray

protected final java.math.BigDecimal[] getCellBounds_BigDecimalArray(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:
BigDecimal[] cellBounds_BigDecimalArray; cellBounds_BigDecimalArray[0] xmin, left most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[1] ymin, lowest y-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[2] xmax, right most x-coordinate of cell that intersects point at (x,y) cellBounds_BigDecimalArray[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 a_ChunkID,
                                                     int nChunkRows,
                                                     int nChunkCols,
                                                     boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID,
                                                        int nChunkRows,
                                                        int nChunkCols)
Parameters:
a_ChunkID -
nChunkRows -
nChunkCols -
Returns:
the next ChunkID in row major order from _ChunkID, or null.

getNextChunkRowMinor

public AbstractGrid2DSquareCell.ChunkID getNextChunkRowMinor(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                             int nChunkRows,
                                                             int nChunkCols,
                                                             boolean handleOutOfMemoryError)
Parameters:
a_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 a_ChunkID,
                                                                int nChunkRows,
                                                                int nChunkCols)
Parameters:
a_ChunkID -
nChunkRows -
nChunkCols -
Returns:
the next ChunkID in row minor order from this, or null.

getPreviousChunk

public AbstractGrid2DSquareCell.ChunkID getPreviousChunk(AbstractGrid2DSquareCell.ChunkID a_ChunkID,
                                                         int nChunkRows,
                                                         int nChunkCols,
                                                         boolean handleOutOfMemoryError)
Parameters:
a_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:
a_ChunkID -
nChunkRows -
nChunkCols -
Returns:
the next ChunkID in row major order from this, or null.