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

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

public abstract class OutOfMemoryErrorHandler
extends java.lang.Object
implements java.io.Serializable

A class to be extended so as to handle OutOfMemoryErrors.

See Also:
Serialized Form

Field Summary
protected  java.util.HashSet _Grid2DSquareCells
          A HashSet of AbstractGrid2DSquareCell objects that have data that can be swapped to release memory for processing.
static boolean _HandleOutOfMemoryErrorFalse
          For ease of search and replace coding.
static boolean _HandleOutOfMemoryErrorTrue
          For ease of search and replace coding.
protected  int[] _MemoryReserve
          Reserve memory that can be set to null and garbage collected so as to handle OutOfMemoryErrors.
protected  java.lang.Runtime _Runtime
           
 
Constructor Summary
OutOfMemoryErrorHandler()
           
 
Method Summary
static void _EnsureThereIsEnoughMemoryToContinue()
          This allocates and deallocates a small amount of memory.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunk()
          Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
 java.util.HashMap _SwapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
          Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
           
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
           
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDHashSet, boolean _HandleOutOfMemoryError)
           
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet, boolean _HandleOutOfMemoryError)
           
protected  void _SwapToFileGrid2DSquareCellChunks()
          Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
 void _SwapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
          Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
 java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
 java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
 java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs)
          Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkIDs in _ChunkIDs.
protected  java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap)
           
 java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap, boolean _HandleOutOfMemoryError)
           
 void clear_MemoryReserve()
          Clears _MemoryReserve by setting it to null and calling the garbage collector.
 java.util.HashSet get_Grid2DSquareCells()
           
 int[] get_MemoryReserve()
           
 double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell, double _Distance, boolean _HandleOutOfMemoryError)
           
protected  long getTotalFreeMemory()
          For returning the total free memory ( _Runtime.freeMemory() + ( _Runtime.maxMemory() - _Runtime.totalMemory() ) ) Even if this is zero then the JVM may be able to allocate memory in reserves?
 long getTotalFreeMemory(boolean _HandleOutOfMemoryError)
          For returning the total free memory ( _Runtime.freeMemory() + ( _Runtime.maxMemory() - _Runtime.totalMemory() ) ) Even if this is zero then the JVM may be able to allocate memory in reserves?
protected  void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells)
           
 void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells, boolean _HandleOutOfMemoryError)
           
protected  void init_Grid2DSquareCells()
          Initialises _Grid2DSquareCells
protected  void init_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
          Initialises _Grid2DSquareCells
 void init_MemoryReserve(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
 void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
 void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
 void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
 void init_MemoryReserve(boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
 void init_MemoryReserve(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap, boolean _HandleOutOfMemoryError)
          Initialises _MemoryReserve.
protected  void init_Runtime()
          Initialises _Runtime
 java.io.File initFile(java.io.File _File, java.lang.String _String, boolean _HandleOutOfMemoryError)
          For initialising a File from File _File and String _String.
 java.io.File initFile(java.lang.String _String, boolean _HandleOutOfMemoryError)
          For initialising a File from String _String.
 java.io.File initFileDirectory(java.io.File _ParentFile, java.lang.String _String, boolean _HandleOutOfMemoryError)
          For initialising a File Directory from File _ParentFile and String _String.
 java.lang.String initString(int length, boolean _HandleOutOfMemoryError)
          For initialising a String of length length.
 java.lang.String initString(java.lang.String _String_0, java.lang.String _String_1, boolean _HandleOutOfMemoryError)
           
 java.lang.String println(java.lang.String _String, java.lang.String _StringToDuplicateAndReturn, boolean _HandleOutOfMemoryError)
           
 void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
          Sets this._Grid2DSquareCells to _Grid2DSquareCells.
protected  void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells, boolean _HandleOutOfMemoryError)
          Sets this._Grid2DSquareCells to _Grid2DSquareCells
 double sin(double value, boolean _HandleOutOfMemoryError)
           
 java.lang.String toString(double _double, boolean _HandleOutOfMemoryError)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Grid2DSquareCells

protected transient java.util.HashSet _Grid2DSquareCells
A HashSet of AbstractGrid2DSquareCell objects that have data that can be swapped to release memory for processing.


_Runtime

protected transient java.lang.Runtime _Runtime

_HandleOutOfMemoryErrorFalse

public static final boolean _HandleOutOfMemoryErrorFalse
For ease of search and replace coding.

See Also:
Constant Field Values

_HandleOutOfMemoryErrorTrue

public static final boolean _HandleOutOfMemoryErrorTrue
For ease of search and replace coding.

See Also:
Constant Field Values

_MemoryReserve

protected transient int[] _MemoryReserve
Reserve memory that can be set to null and garbage collected so as to handle OutOfMemoryErrors.

Constructor Detail

OutOfMemoryErrorHandler

public OutOfMemoryErrorHandler()
Method Detail

init_Runtime

protected final void init_Runtime()
Initialises _Runtime


init_Grid2DSquareCells

protected void init_Grid2DSquareCells()
Initialises _Grid2DSquareCells


init_Grid2DSquareCells

protected void init_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
Initialises _Grid2DSquareCells


get_Grid2DSquareCells

public java.util.HashSet get_Grid2DSquareCells()
Returns:
this._Grid2DSquareCells.

set_Grid2DSquareCells

public void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
Sets this._Grid2DSquareCells to _Grid2DSquareCells.


set_Grid2DSquareCells

protected void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells,
                                     boolean _HandleOutOfMemoryError)
Sets this._Grid2DSquareCells to _Grid2DSquareCells

Parameters:
_Grid2DSquareCells - The HashSet this._Grid2DSquareCells is set to.

init_Grid2DSquareCells_MemoryReserve

public void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells,
                                                 boolean _HandleOutOfMemoryError)
Parameters:
_Grid2DSquareCells - A HashSet used for initialisation.

init_Grid2DSquareCells_MemoryReserve

protected void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells)
Parameters:
_Grid2DSquareCells - A HashSet used for initialisation.

get_MemoryReserve

public int[] get_MemoryReserve()
Returns:
this._MemoryReserve.

init_MemoryReserve

public final void init_MemoryReserve(boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve.

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.

init_MemoryReserve

public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                     boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. If an OutOfMemoryError is encountered this calls _SwapToFileGrid2DSquareCellChunksExcept(_Grid2DSquareCell) (if that returns null then it calls _SwapToFileGrid2DSquareCellChunk()) then recurses.

Parameters:
_Grid2DSquareCell -
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated, then the method is re-called. If false then OutOfMemoryErrors are caught and thrown.

init_MemoryReserve

public final void init_MemoryReserve(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                     boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. If an OutOfMemoryError is encountered this calls _SwapToFileGrid2DSquareCellChunksExcept(_ChunkID,_HandleOutOfMemoryError) then recurses.

Parameters:
_ChunkID -
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated, then the method is re-called. If false then OutOfMemoryErrors are caught and thrown.

init_MemoryReserve

public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                     AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                     boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. If an OutOfMemoryError is encountered this calls _SwapToFileGrid2DSquareCellChunksExcept(_Grid2DSquareCell,_ChunkID,_HandleOutOfMemoryError) then recurses.

Parameters:
_Grid2DSquareCell -
_ChunkID -
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated, then the method is re-called. If false then OutOfMemoryErrors are caught and thrown.

init_MemoryReserve

public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                     java.util.HashSet _ChunkIDs,
                                     boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. If an OutOfMemoryError is encountered this calls _SwapToFileGrid2DSquareCellChunksExcept(_Grid2DSquareCell,_ChunkIDs,_HandleOutOfMemoryError) then recurses.

Parameters:
_Grid2DSquareCell -
_ChunkIDs - HashSet of AbstractGrid2DSquareCell.ChunkIDs
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated, then the method is re-called. If false then OutOfMemoryErrors are caught and thrown.

init_MemoryReserve

public void init_MemoryReserve(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap,
                               boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. If an OutOfMemoryError is encountered this calls _SwapToFileGrid2DSquareCellChunksExcept(_Grid2DSquareCell_ChunkIDHashSet,_HandleOutOfMemoryError) then recurses.

Parameters:
_Grid2DSquareCell_ChunkIDHashSet_HashMap - HashMap with AbstractGrid2DSquareCell as keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell.
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught, swap operations are initiated, then the method is re-called. If false then OutOfMemoryErrors are caught and thrown.

clear_MemoryReserve

public final void clear_MemoryReserve()
Clears _MemoryReserve by setting it to null and calling the garbage collector. After this method is executed then no further method calls will handle OutOfMemoryError until _MemoryReserve is initialsed. It is usually assumed that when this method is called, _MemoryReserve has been initialised apriori.


_EnsureThereIsEnoughMemoryToContinue

public static void _EnsureThereIsEnoughMemoryToContinue()
This allocates and deallocates a small amount of memory. It is used to ensure there is enough memory upon stepping out to a method external to Grids. What is needed at least is sufficient memory to step back the Grids methods that handle OutOfMemoryErrors. All the public methods of the API call this method before returning to the rest of the program execution. It exists for robustness reasons and was retrofitted as a work around to the following problem: What to do if upon returning there is insufficient memory to call another method from the API that handles OutOfMemoryErrors.


getTotalFreeMemory

protected long getTotalFreeMemory()
For returning the total free memory Even if this is zero then the JVM may be able to allocate memory in reserves?

Returns:
The TotalFreeMemory available as calculated from _Runtime. If the returned value is lower than a minimum required to call a method then probably best to swap some data.

getTotalFreeMemory

public long getTotalFreeMemory(boolean _HandleOutOfMemoryError)
For returning the total free memory Even if this is zero then the JVM may be able to allocate memory in reserves?

Returns:
The TotalFreeMemory available as calculated from _Runtime. If the returned value is lower than a minimum required to call a method then probably best to swap some data.

_SwapToFileGrid2DSquareCellChunks

public void _SwapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

Parameters:
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught in this method then swap operations are initiated prior to retrying. If false then OutOfMemoryErrors are caught and thrown.

_SwapToFileGrid2DSquareCellChunks

protected void _SwapToFileGrid2DSquareCellChunks()
Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.


_SwapToFileGrid2DSquareCellChunk

public java.util.HashMap _SwapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells. This is the lowest level of OutOfMemoryError handling in this class.

Parameters:
_HandleOutOfMemoryError - If true then OutOfMemoryErrors are caught in this method then swap operations are initiated prior to retrying. If false then OutOfMemoryErrors are caught and thrown.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunk

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunk()
Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells.

Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunkExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                boolean _HandleOutOfMemoryError)
Parameters:
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in with AbstractGrid2DSquareCell.ChunkID = _ChunkID.

_SwapToFileGrid2DSquareCellChunkExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in with AbstractGrid2DSquareCell.ChunkID = _ChunkID.

_SwapToFileGrid2DSquareCellChunkExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet,
                                                                boolean _HandleOutOfMemoryError)
Parameters:
_Grid2DSquareCell_ChunkIDHashSet - HashMap with AbstractGrid2DSquareCell as keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell_ChunkIDHashSet.

_SwapToFileGrid2DSquareCellChunkExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
Parameters:
_Grid2DSquareCell_ChunkIDHashSet - HashMap with AbstractGrid2DSquareCell as keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell_ChunkIDHashSet.

_SwapToFileGrid2DSquareCellChunkExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                java.util.HashSet _ChunkIDHashSet,
                                                                boolean _HandleOutOfMemoryError)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell with AbstractGrid2DSquareCell._ChunkID in _ChunkIDs.

_SwapToFileGrid2DSquareCellChunkExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                   java.util.HashSet _ChunkIDs)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell with AbstractGrid2DSquareCell._ChunkID in _ChunkIDs.

_SwapToFileGrid2DSquareCellChunkExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                boolean _HandleOutOfMemoryError)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for that in _Grid2DSquareCell with AbstractGrid2DSquareCell._ChunkID _ChunkID.

_SwapToFileGrid2DSquareCellChunkExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                   AbstractGrid2DSquareCell.ChunkID _ChunkID)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for that in _Grid2DSquareCell with AbstractGrid2DSquareCell._ChunkID _ChunkID.

_SwapToFileGrid2DSquareCellChunkExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                boolean _HandleOutOfMemoryError)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell.

_SwapToFileGrid2DSquareCellChunkExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped. Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells except for those in _Grid2DSquareCell.

_SwapToFileGrid2DSquareCellChunksExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                 boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                 boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped. swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                 AbstractGrid2DSquareCell.ChunkID _ChunkID,
                                                                 boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                    AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID.

Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
_ChunkID - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                                    java.util.HashSet _ChunkIDs)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkIDs in _ChunkIDs.

Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell that's chunks are not to be swapped.
_ChunkIDs - The AbstractGrid2DSquareCell.ChunkID not to be swapped.
Returns:
HashMap with: key as the AbstractGrid2DSquareCell from which the AbstractGrid2DSquareCellChunk was swapped; and, value as the AbstractGrid2DSquareCellChunk._ChunkID swapped.

_SwapToFileGrid2DSquareCellChunksExcept

public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap,
                                                                 boolean _HandleOutOfMemoryError)

_SwapToFileGrid2DSquareCellChunksExcept

protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap)

initString

public java.lang.String initString(int length,
                                   boolean _HandleOutOfMemoryError)
For initialising a String of length length.


initString

public java.lang.String initString(java.lang.String _String_0,
                                   java.lang.String _String_1,
                                   boolean _HandleOutOfMemoryError)
Returns:
String which is _String_1 appended to the end of _String_0

initFile

public java.io.File initFile(java.lang.String _String,
                             boolean _HandleOutOfMemoryError)
                      throws java.io.IOException
For initialising a File from String _String.

Throws:
java.io.IOException

initFile

public java.io.File initFile(java.io.File _File,
                             java.lang.String _String,
                             boolean _HandleOutOfMemoryError)
                      throws java.io.IOException
For initialising a File from File _File and String _String.

Throws:
java.io.IOException

initFileDirectory

public java.io.File initFileDirectory(java.io.File _ParentFile,
                                      java.lang.String _String,
                                      boolean _HandleOutOfMemoryError)
                               throws java.io.IOException
For initialising a File Directory from File _ParentFile and String _String.

Throws:
java.io.IOException

println

public java.lang.String println(java.lang.String _String,
                                java.lang.String _StringToDuplicateAndReturn,
                                boolean _HandleOutOfMemoryError)

sin

public double sin(double value,
                  boolean _HandleOutOfMemoryError)

toString

public java.lang.String toString(double _double,
                                 boolean _HandleOutOfMemoryError)

getNormalDistributionKernelWeights

public double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                     double _Distance,
                                                     boolean _HandleOutOfMemoryError)