|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellAbstract
public abstract class Grid2DSquareCellAbstract
Grid2DSquareCellAbstract provides inner classes for CellID and ChunkID referencing and general geometry methods for extended classes. It also controls what methods extended classes must implement and so acts somewhat 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: Add a constant int TYPE which can be used to switch between different types of this. Handling for NumberFormatExceptions and ArithmeticExceptions in calculations
Nested Class Summary | |
---|---|
static class |
Grid2DSquareCellAbstract.CellID
A simple CellID class for distinguishing cells. |
static class |
Grid2DSquareCellAbstract.ChunkID
A simple ChunkID class for distinguishing s in this chunk. |
Field Summary | |
---|---|
protected int |
chunkNcols
For storing the (usual) number of cells in a chunk column. |
protected int |
chunkNrows
For storing the (usual) number of cells in a chunk row. |
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 by default during grid construction. |
protected int |
dimensionsScale
For storing the minimum number of decimal places needed to store the dimensions. |
protected java.io.File |
directory
Local directory used for caching. |
protected java.util.HashMap |
grid2DSquareCellChunks
The chunks that make up this instance. |
protected GridStatisticsAbstract |
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 values mapped to a binary encoded long. |
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
---|
handleOutOfMemoryErrorFalse, handleOutOfMemoryErrorTrue, memoryReserve |
Constructor Summary | |
---|---|
Grid2DSquareCellAbstract()
|
Method Summary | |
---|---|
void |
cache(boolean cacheChunks,
boolean reinitialiseMemoryReserve)
A method to cache this instance by writing it out to an ObjectOutputStream File called Cache to be located in the File (directory) returned by getDirectory(). |
void |
cacheAndClearChunks(boolean reinitialiseMemoryReserve)
Caches a seriailsed version of all grid2DSquareCellChunks and clears them. |
Grid2DSquareCellAbstract.ChunkID |
cacheChunk(boolean reinitialiseMemoryReserve)
Attempts to cache a seriailized version of a Chunk. |
boolean |
cacheChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
Caches a seriailsed version of Chunk with given chunkID. |
boolean |
cacheChunk(int chunkRowIndex,
int chunkColIndex,
boolean reinitialiseMemoryReserve)
Attempts to cache a seriailized version of Chunk given by; chunk row index chunkRowIndex, chunk column index chunkColIndex. |
Grid2DSquareCellAbstract.ChunkID |
cacheChunkExcept(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
Caches a Grid2DSquareCellChunk of grid2DSquareCellChunks (other that with ChunkID chunkID) then returns its ChunkID. |
Grid2DSquareCellAbstract.ChunkID |
cacheChunkExcept(int chunkRowIndex,
int chunkColIndex,
boolean reinitialiseMemoryReserve)
Caches a Grid2DSquareCellChunk of grid2DSquareCellChunks (other that with; chunk row index chunkRowIndex, chunk column index chunkColIndex) then returns its ChunkID. |
Grid2DSquareCellAbstract.ChunkID |
cacheChunkExceptReverseOrder(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
Caches a Grid2DSquareCellChunk of grid2DSquareCellChunks (other that with ChunkID chunkID) then returns its ChunkID. |
Grid2DSquareCellAbstract.ChunkID |
cacheChunkExceptReverseOrder(int chunkRowIndex,
int chunkColIndex,
boolean reinitialiseMemoryReserve)
Caches a Grid2DSquareCellChunk of grid2DSquareCellChunks (other that with ChunkID chunkID) then returns its ChunkID. |
void |
cacheChunks(boolean reinitialiseMemoryReserve)
Caches a seriailsed version of all grid2DSquareCellChunks. |
void |
cacheChunks(java.util.HashSet chunkIDs,
boolean reinitialiseMemoryReserve)
Caches a seriailsed version of all grid2DSquareCellChunks in grid2DSquareCellChunkIDs. |
void |
cacheChunksExcept(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
Caches all grid2DSquareCellChunks other that with ChunkID chunkID. |
void |
cacheChunksExcept(java.util.HashSet chunkIDs,
boolean reinitialiseMemoryReserve)
Caches all grid2DSquareCellChunks other than those with ChunkIDs in chunkIDs. |
void |
clearChunk(Grid2DSquareCellAbstract.ChunkID chunkID)
For releasing a grid2DSquareCellChunk stored in memory. |
void |
clearChunk(int chunkRowIndex,
int chunkColIndex,
boolean reinitialiseMemoryReserve)
For releasing a grid2DSquareCellChunk stored in memory. |
void |
clearChunkExcept(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
For releasing a grid2DSquareCellChunk stored in memory except that with ChunkID given by chunkID. |
void |
clearChunks(boolean reinitialiseMemoryReserve)
For releasing all grid2DSquareCellChunk stored in memory. |
void |
clearChunks(java.util.HashSet chunkIDs,
boolean reinitialiseMemoryReserve)
Clears Grid2DSquareCellChunkAbstracts with ChunkIDs in chunkIDs. |
void |
clearChunksExcept(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
For releasing all grid2DSquareCellChunk stored in memory except that with ChunkID given by chunkID. |
void |
clearChunksExcept(java.util.HashSet chunkIDs,
boolean reinitialiseMemoryReserve)
For releasing all grid2DSquareCellChunk stored in memory except those with ChunkIDs in chunkIDs. |
double[] |
getCellBoundsDoubleArray(double x,
double y,
boolean handleOutOfMemoryError)
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) |
double[] |
getCellBoundsDoubleArray(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
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) |
long |
getCellColIndex(java.math.BigDecimal xBigDecimal,
boolean handleOutOfMemoryError)
Returns the cell column Index for the cells that intersect the x-coordinate x. |
long |
getCellColIndex(double x,
boolean handleOutOfMemoryError)
Returns the cell column Index for the cells that intersect the x-coordinate x. |
double |
getCellDouble(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk,
int chunkRowIndex,
int chunkColIndex,
int chunkCellRowIndex,
int chunkCellColIndex,
boolean handleOutOfMemoryError)
Returns the value at chunkRowIndex, chunkColIndex, chunkCellRowIndex, chunkCellColIndex as a double. |
double |
getCellDouble(int chunkRowIndex,
int chunkColIndex,
int chunkCellRowIndex,
int chunkCellColIndex,
boolean handleOutOfMemoryError)
Returns the value at chunkRowIndex, chunkColIndex, chunkCellRowIndex, chunkCellColIndex as a double. |
double |
getCellDouble(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns the value at cellRowIndex, cellColIndex as a double |
double |
getCellDouble(java.awt.geom.Point2D.Double point,
boolean handleOutOfMemoryError)
Returns the value of the cell at point as a double. |
Grid2DSquareCellAbstract.CellID |
getCellID(double x,
double y,
boolean handleOutOfMemoryError)
Returns a CellID of the cell given by x-coordinate x, y-coordinate y even if that cell would not be in the grid. |
Grid2DSquareCellAbstract.CellID |
getCellID(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns a CellID of the cell given by cellRowIndex, cellColIndex even if that cell would not be in the grid. |
Grid2DSquareCellAbstract.CellID[] |
getCellIDs(double x,
double y,
double distance,
boolean handleOutOfMemoryError)
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. |
protected Grid2DSquareCellAbstract.CellID[] |
getCellIDs(double x,
double y,
long cellRowIndex,
long cellColIndex,
double distance,
boolean handleOutOfMemoryError)
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. |
Grid2DSquareCellAbstract.CellID[] |
getCellIDs(long cellRowIndex,
long cellColIndex,
double distance,
boolean handleOutOfMemoryError)
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. |
int |
getCellInt(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk,
int chunkRowIndex,
int chunkColIndex,
int chunkCellRowIndex,
int chunkCellColIndex,
boolean handleOutOfMemoryError)
Returns the value at chunkRowIndex, chunkColIndex, chunkCellRowIndex, chunkCellColIndex as a int. |
int |
getCellInt(int chunkRowIndex,
int chunkColIndex,
int chunkCellRowIndex,
int chunkCellColIndex,
boolean handleOutOfMemoryError)
Returns the value at chunkRowIndex, chunkColIndex, chunkCellRowIndex, chunkCellColIndex as a int. |
int |
getCellInt(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns the value at cellRowIndex, cellColIndex as a int. |
long |
getCellRowIndex(java.math.BigDecimal yBigDecimal,
boolean handleOutOfMemoryError)
Returns the cell row Index for the cells that intersect the y-coordinate yBigDecimal. |
long |
getCellRowIndex(double y,
boolean handleOutOfMemoryError)
Returns the cell row Index for the cells that intersect the y-coordinate y. |
double |
getCellsizeDouble(boolean handleOutOfMemoryError)
Returns dimensions[0] converted to a double. |
double |
getCellX(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Deprecated. use getCellXDouble(CellID,boolean) Returns the x-coordinate of the centroid for cell with cell ID cellID as a double. |
double |
getCellX(long cellColIndex,
boolean handleOutOfMemoryError)
Deprecated. use getCellXDouble(long,boolean) Returns the x-coordinate of the centroid for cells with column index cellColIndex as a double. |
java.math.BigDecimal |
getCellXBigDecimal(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Returns the x-coordinate of the centroid for cell with cell ID cellID as a BigDecimal. |
java.math.BigDecimal |
getCellXBigDecimal(long cellColIndex,
boolean handleOutOfMemoryError)
Returns the x-coordinate of the centroid for cells with column index cellColIndex as a BigDecimal. |
double |
getCellXDouble(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Returns the x-coordinate of the centroid for cell with cell ID cellID as a double |
double |
getCellXDouble(long cellColIndex,
boolean handleOutOfMemoryError)
Returns the x-coordinate of the centroid for cells with column index cellColIndex as a double. |
double |
getCellY(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Deprecated. use getCellYDouble(CellID,boolean) Returns the y-coordinate of the centroid of cell with CellID cellID as a double. |
double |
getCellY(long cellRowIndex,
boolean handleOutOfMemoryError)
Deprecated. use getCellYDouble(long,boolean) Returns the y-coordinate of the centroid for cells with row index cellRowIndex as a double. |
java.math.BigDecimal |
getCellYBigDecimal(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Returns the y-coordinate of the centroid of cell with CellID cellID as a BigDecimal. |
java.math.BigDecimal |
getCellYBigDecimal(long cellRowIndex,
boolean handleOutOfMemoryError)
Returns the y-coordinate of the centroid for cells with row index cellRowIndex as a BigDecimal. |
double |
getCellYDouble(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Returns the y-coordinate of the centroid of cell with CellID cellID as a double. |
double |
getCellYDouble(long cellRowIndex,
boolean handleOutOfMemoryError)
Returns the y-coordinate of the centroid for cells with row index cellRowIndex as a double. |
int |
getChunkCellColIndex(double x,
boolean handleOutOfMemoryError)
Returns the chunk cell column Index of the cells that intersect the x-coordinate x. |
int |
getChunkCellColIndex(long cellColIndex,
boolean handleOutOfMemoryError)
Returns the chunks cell column index of the cell in the chunk thats centoid is closest to the x-coordinate x. |
int |
getChunkCellRowIndex(double y,
boolean handleOutOfMemoryError)
Returns the chunk cell row Index of the cells that intersects the y-coordinate y. |
int |
getChunkCellRowIndex(long cellRowIndex,
boolean handleOutOfMemoryError)
Returns the chunks cell row Index of the cells in the chunk thats centoid is closest to the y-coordinate y. |
int |
getChunkColIndex(double x,
boolean handleOutOfMemoryError)
Returns the chunk column index for the chunks intersecting the x-coordinate x. |
int |
getChunkColIndex(long cellColIndex,
boolean handleOutOfMemoryError)
Returns the chunk column index for the chunk intersecting the cell at cell column index cellColIndex. |
int |
getChunkNcols(boolean handleOutOfMemoryError)
Returns chunkNcols. |
int |
getChunkNcols(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Returns the number of columns in chunkID as an int |
int |
getChunkNcolsFinalColChunks(boolean handleOutOfMemoryError)
Returns the number of cols in the final col Chunk |
int |
getChunkNrows(boolean handleOutOfMemoryError)
Returns chunkNrows. |
int |
getChunkNrows(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Returns the number of rows in chunkID as an int |
int |
getChunkNrowsFinalRowChunks(boolean handleOutOfMemoryError)
Returns the number of rows in the final row Chunk |
int |
getChunkRowIndex(double y,
boolean handleOutOfMemoryError)
Returns the chunk row index for the chunks intersecting the y-coordinate y. |
int |
getChunkRowIndex(long cellRowIndex,
boolean handleOutOfMemoryError)
Returns the chunk row index for the chunk intersecting the cell at cell row index cellRowIndex. |
java.math.BigDecimal[] |
getDimensions()
Returns dimensions. |
int |
getDimensionsScale(boolean handleOutOfMemoryError)
Returns dimensionsScale. |
java.io.File |
getDirectory()
Returns directory. |
protected Grid2DSquareCellChunkAbstract |
getGrid2DSquareCellChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Returns grid2DSquareCellChunks. |
protected Grid2DSquareCellChunkAbstract |
getGrid2DSquareCellChunk(int chunkRowIndex,
int chunkColIndex,
boolean handleOutOfMemoryError)
Returns the Grid2DSquareCellChunkAbstract with the given chunkRowIndex and chunkColIndex |
protected java.util.HashMap |
getGrid2DSquareCellChunks()
Returns this.grid2DSquareCellChunks TODO: Should we clone, i.e. |
double[] |
getGridBounds(boolean handleOutOfMemoryError)
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 |
GridStatisticsAbstract |
getGridStatistics()
Returns this.gridStatistics TODO: For safety, this method should probably be removed and instead, this class be made to implement GridStatisticsInterface. |
java.math.BigDecimal |
getHeightBigDecimal(boolean handleOutOfMemoryError)
Returns the height of the grid. |
double |
getHeightDouble(boolean handleOutOfMemoryError)
Returns the height of the grid. |
java.lang.String |
getName()
Returns name. |
int |
getNChunkCols(boolean handleOutOfMemoryError)
Returns nChunkCols. |
int |
getNChunkRows(boolean handleOutOfMemoryError)
Returns nChunkRows. |
long |
getNcols()
Returns ncols. |
Grid2DSquareCellAbstract.CellID |
getNearestCellID(double x,
double y,
boolean handleOutOfMemoryError)
Returns the the nearest cells cellRowIndex and cellColIndex as a long[] from ID to point given by x-coordinate x, y-coordinate y. |
protected Grid2DSquareCellAbstract.CellID |
getNearestCellID(double x,
double y,
long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns the the nearest CellID to point given by x-coordinate x, y-coordinate y in position given by cellRowIndex, cellColIndex. |
Grid2DSquareCellAbstract.CellID |
getNearestCellID(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns the the nearest cells cellRowIndex and cellColIndex as a long[] from ID to point given by cell row index cellRowIndex, cell column index cellColIndex. |
Grid2DSquareCellAbstract.ChunkID |
getNextChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
int nChunkRows,
int nChunkCols,
boolean handleOutOfMemoryError)
Returns the next ChunkID in row major order from chunkID, or null. |
Grid2DSquareCellAbstract.ChunkID |
getNextChunkRowMinor(Grid2DSquareCellAbstract.ChunkID chunkID,
int nChunkRows,
int nChunkCols,
boolean handleOutOfMemoryError)
Returns the next ChunkID in row minor order from this, or null. |
abstract java.math.BigDecimal |
getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
Returns the noDataValue of this as a BigDecimal. |
double |
getNoDataValueDouble(boolean handleOutOfMemoryError)
Deprecated. This should not be used Returns the noDataValue of this as a double. |
long |
getNrows()
Returns nrows. |
Grid2DSquareCellAbstract.ChunkID |
getPreviousChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
int nChunkRows,
int nChunkCols,
boolean handleOutOfMemoryError)
Returns the next ChunkID in row major order from this, or null. |
java.math.BigDecimal |
getWidthBigDecimal(boolean handleOutOfMemoryError)
Returns the width of the grid as a BigDecimal. |
double |
getWidthDouble(boolean handleOutOfMemoryError)
Returns the width of the grid as a double. |
protected boolean |
inGrid(java.math.BigDecimal xBigDecimal,
java.math.BigDecimal yBigDecimal,
boolean handleOutOfMemoryError)
Returns true iff point given by x-coordinate x, y-coordinate y is in the Grid. |
boolean |
inGrid(double x,
double y,
boolean handleOutOfMemoryError)
Returns true iff point given by x-coordinate x, y-coordinate y is in the Grid. |
boolean |
inGrid(Grid2DSquareCellAbstract.CellID cellID,
boolean handleOutOfMemoryError)
Returns true iff cell given by cellID is in the Grid. |
boolean |
inGrid(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Returns true iff ChunkID chunkID is in the Grid. |
boolean |
inGrid(int chunkRowIndex,
int chunkColIndex,
boolean handleOutOfMemoryError)
Returns true iff position given by chunk row index chunkRowIndex, chunk column index chunkColIndex is in the Grid. |
boolean |
inGrid(int chunkRowIndex,
int chunkColIndex,
int chunkCellRowIndex,
int chunkCellColIndex,
boolean handleOutOfMemoryError)
Returns true iff cell given by chunkRowIndex, chunkColIndex, chunkCellRowIndex, chunkCellColIndex is in the Grid. |
boolean |
inGrid(long cellRowIndex,
long cellColIndex,
boolean handleOutOfMemoryError)
Returns true iff position given by cell row index cellRowIndex, cell column index cellColIndex is in the Grid. |
protected abstract void |
initAll(Grid2DSquareCellAbstract grid2DSquareCellAbstract)
Initialises all fields from an existing instance. |
protected void |
initAll(Grid2DSquareCellAbstract grid2DSquareCell,
boolean flag)
Initialises all fields from an existing instance including grid2DSquareCellDoubleChunks. |
protected void |
initChunkNcols(int chunkNcols)
Initialises chunkNcols. |
protected void |
initChunkNrows(int chunkNrows)
Initialises chunkNrows. |
protected void |
initDimensions(java.math.BigDecimal[] dimensions)
Initialises dimensions. |
void |
initNChunkCols(long ncols,
int chunkNcols)
Initialises nChunkCols |
void |
initNChunkRows(long nrows,
int chunkNrows)
Initialises nChunkRows |
protected void |
initNcols(long ncols)
Initialises ncols. |
protected void |
initNrows(long nrows)
Initialises nrows. |
boolean |
isCached(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean reinitialiseMemoryReserve)
Returns true iff grid2DSquareCellChunk given by chunkID is cached. |
abstract java.util.Iterator |
iterator(boolean handleOutOfMemoryError)
Returns an iterator over the cell values in this. |
void |
restoreChunk(Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Restores a grid2DSquareCellChunk from a cache. |
void |
restoreChunk(int chunkRowIndex,
int chunkColIndex,
boolean handleOutOfMemoryError)
Restores a grid2DSquareCellChunk from a cache. |
void |
setChunk(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk,
Grid2DSquareCellAbstract.ChunkID chunkID,
boolean handleOutOfMemoryError)
Sets chunk with chunkID to grid2DSquareCellDoubleChunk. |
void |
setName(java.lang.String newName,
boolean handleOutOfMemoryError)
Sets name. |
abstract java.lang.String |
toString(boolean handleOutOfMemoryError)
Returns a string description of the instance. |
java.lang.String |
toString(boolean handleOutOfMemoryError,
boolean flag)
Returns a string description of the Abstract fields of this instance. |
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.utilities.ErrorHandler |
---|
clearMemoryReserve, initMemoryReserve, initMemoryReserve |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File directory
protected java.util.HashMap grid2DSquareCellChunks
protected GridStatisticsAbstract gridStatistics
protected int nChunkRows
protected int nChunkCols
protected int chunkNrows
protected int chunkNcols
protected long nrows
protected long ncols
protected java.lang.String name
protected java.math.BigDecimal[] dimensions
protected int dimensionsScale
protected static UnsignedLongPowersOf2 unsignedLongPowersOf2
Constructor Detail |
---|
public Grid2DSquareCellAbstract()
Method Detail |
---|
protected abstract void initAll(Grid2DSquareCellAbstract grid2DSquareCellAbstract)
grid2DSquareCellAbstract
- the Grid2DSquareCellAbstract from which
the field values of this are set.protected void initAll(Grid2DSquareCellAbstract grid2DSquareCell, boolean flag)
grid2DSquareCell
- the Grid2DSquareCellAbstract from which the field
values of this are set.flag
- This is to distinguish this method from initMain( Grid2DSquareCellAbstract )protected java.util.HashMap getGrid2DSquareCellChunks()
public GridStatisticsAbstract getGridStatistics()
protected Grid2DSquareCellChunkAbstract getGrid2DSquareCellChunk(int chunkRowIndex, int chunkColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- chunkColIndex
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected Grid2DSquareCellChunkAbstract getGrid2DSquareCellChunk(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public abstract java.util.Iterator iterator(boolean handleOutOfMemoryError)
public abstract java.lang.String toString(boolean handleOutOfMemoryError)
public java.lang.String toString(boolean handleOutOfMemoryError, boolean flag)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.flag
- This is ignored. It is simply to distinguish this method from
the abstract method toString(boolean).public java.io.File getDirectory()
public void setName(java.lang.String newName, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public java.lang.String getName()
public void setChunk(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk, Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final long getNcols()
protected final void initNcols(long ncols)
public final long getNrows()
protected final void initNrows(long nrows)
public final int getNChunkRows(boolean handleOutOfMemoryError)
public final void initNChunkRows(long nrows, int chunkNrows)
nrows
- chunkNrows
- public final int getNChunkCols(boolean handleOutOfMemoryError)
public final void initNChunkCols(long ncols, int chunkNcols)
ncols
- chunkNcols
- public final int getChunkNrows(boolean handleOutOfMemoryError)
protected final void initChunkNrows(int chunkNrows)
public final int getChunkNcols(boolean handleOutOfMemoryError)
protected final void initChunkNcols(int chunkNcols)
public final int getChunkNrowsFinalRowChunks(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkNcolsFinalColChunks(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkNrows(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkNcols(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal[] getDimensions()
public final double getCellsizeDouble(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getDimensionsScale(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected final void initDimensions(java.math.BigDecimal[] dimensions)
public double getCellDouble(java.awt.geom.Point2D.Double point, boolean handleOutOfMemoryError)
point
- The Point2D.Double for which the cell value is returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public double getCellDouble(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
cellRowIndex
- The cell row index.cellColIndex
- The cell column index.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public double getCellDouble(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- The cell chunk row index.chunkColIndex
- The cell chunk column index.chunkCellRowIndex
- The cell row index of the chunk.chunkCellColIndex
- The cell column index of the chunk.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public double getCellDouble(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
grid2DSquareCellChunk
- The Grid2DSquareCellChunkAbstract containing
the cell.chunkRowIndex
- The cell chunk row index.chunkColIndex
- The cell chunk column index.chunkCellRowIndex
- The cell row index of the chunk.chunkCellColIndex
- The cell column index of the chunk.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public int getCellInt(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
cellRowIndex
- The cell row index.cellColIndex
- The cell column index.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public int getCellInt(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- The cell chunk row index.chunkColIndex
- The cell chunk column index.chunkCellRowIndex
- The cell row index of the chunk.chunkCellColIndex
- The cell column index of the chunk.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public int getCellInt(Grid2DSquareCellChunkAbstract grid2DSquareCellChunk, int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
grid2DSquareCellChunk
- The Grid2DSquareCellChunkAbstract containing
the cell.chunkRowIndex
- The cell chunk row index.chunkColIndex
- The cell chunk column index.chunkCellRowIndex
- The cell row index of the chunk.chunkCellColIndex
- The cell column index of the chunk.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkColIndex(double x, boolean handleOutOfMemoryError)
x
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkColIndex(long cellColIndex, boolean handleOutOfMemoryError)
cellColIndex
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final long getCellColIndex(double x, boolean handleOutOfMemoryError)
x
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final long getCellColIndex(java.math.BigDecimal xBigDecimal, boolean handleOutOfMemoryError)
xBigDecimal
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkCellColIndex(double x, boolean handleOutOfMemoryError)
x
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkCellColIndex(long cellColIndex, boolean handleOutOfMemoryError)
cellColIndex
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkRowIndex(double y, boolean handleOutOfMemoryError)
y
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkRowIndex(long cellRowIndex, boolean handleOutOfMemoryError)
cellRowIndex
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final long getCellRowIndex(double y, boolean handleOutOfMemoryError)
y
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final long getCellRowIndex(java.math.BigDecimal yBigDecimal, boolean handleOutOfMemoryError)
yBigDecimal
- The y-coordinate for which the cell row index is returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkCellRowIndex(double y, boolean handleOutOfMemoryError)
y
- .handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final int getChunkCellRowIndex(long cellRowIndex, boolean handleOutOfMemoryError)
cellRowIndex
- .handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final Grid2DSquareCellAbstract.CellID getCellID(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
cellRowIndex
- The cell row index.cellColIndex
- The cell column index.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final Grid2DSquareCellAbstract.CellID getCellID(double x, double y, boolean handleOutOfMemoryError)
x
- The x-coordinate.y
- The y-coordinate.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final void cache(boolean cacheChunks, boolean reinitialiseMemoryReserve)
cacheChunks
- If true then chunks are cached individually prior to caching this.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final Grid2DSquareCellAbstract.ChunkID cacheChunk(boolean reinitialiseMemoryReserve)
reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final boolean cacheChunk(int chunkRowIndex, int chunkColIndex, boolean reinitialiseMemoryReserve)
chunkRowIndex
- The chunk row index.chunkColIndex
- The chunk column index.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final boolean cacheChunk(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The chunkID of the chunk to be cached to file.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void cacheChunks(boolean reinitialiseMemoryReserve)
reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void cacheChunks(java.util.HashSet chunkIDs, boolean reinitialiseMemoryReserve)
chunkIDs
- A HashSet containing the ChunkIDs of the
grid2DSquareCellChunks to be cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void cacheChunksExcept(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the chunk not to be cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final Grid2DSquareCellAbstract.ChunkID cacheChunkExcept(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the chunk not to be cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final Grid2DSquareCellAbstract.ChunkID cacheChunkExcept(int chunkRowIndex, int chunkColIndex, boolean reinitialiseMemoryReserve)
chunkRowIndex
- The chunk row index.chunkColIndex
- The chunk column index.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final Grid2DSquareCellAbstract.ChunkID cacheChunkExceptReverseOrder(int chunkRowIndex, int chunkColIndex, boolean reinitialiseMemoryReserve)
chunkRowIndex
- The chunk row index.chunkColIndex
- The chunk column index.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final Grid2DSquareCellAbstract.ChunkID cacheChunkExceptReverseOrder(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the chunk not to be cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void cacheChunksExcept(java.util.HashSet chunkIDs, boolean reinitialiseMemoryReserve)
chunkIDs
- A hashSet containing ChunkIDs not to be cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void cacheAndClearChunks(boolean reinitialiseMemoryReserve)
reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final boolean isCached(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the grid2DSquareCellChunk tested to see if
it is cached.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunk(int chunkRowIndex, int chunkColIndex, boolean reinitialiseMemoryReserve)
chunkRowIndex
- The chunk row index of the grid2DSquareCellChunk
to be cleared.chunkColIndex
- The chunk column index of the grid2DSquareCellChunk
to be cleared.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunk(Grid2DSquareCellAbstract.ChunkID chunkID)
chunkID
- The ChunkID of the grid2DSquareCellChunk to be cleared.public final void clearChunks(boolean reinitialiseMemoryReserve)
reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunks(java.util.HashSet chunkIDs, boolean reinitialiseMemoryReserve)
chunkIDs
- A HashSet containing the ChunkIDs of the
Grid2DSquareCellChunkAbstracts to be cleared.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunkExcept(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the grid2DSquareCellChunk not to be cleared.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunksExcept(Grid2DSquareCellAbstract.ChunkID chunkID, boolean reinitialiseMemoryReserve)
chunkID
- The ChunkID of the grid2DSquareCellChunk not to be cleared.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void clearChunksExcept(java.util.HashSet chunkIDs, boolean reinitialiseMemoryReserve)
chunkIDs
- The HashSet of ChunkIDs of the grid2DSquareCellChunks not
to be cleared.reinitialiseMemoryReserve
- If true then this.memoryReserve is initialised
prior to returning from this method.public final void restoreChunk(int chunkRowIndex, int chunkColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- The chunk row index of the grid2DSquareCellChunk
to be restored.chunkColIndex
- The chunk column index of the grid2DSquareCellChunk
to be restored.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final void restoreChunk(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
chunkID
- The ChunkID of the grid2DSquareCellChunk to be restored.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final Grid2DSquareCellAbstract.CellID[] getCellIDs(double x, double y, double distance, boolean handleOutOfMemoryError)
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
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final Grid2DSquareCellAbstract.CellID[] getCellIDs(long cellRowIndex, long cellColIndex, double distance, boolean handleOutOfMemoryError)
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
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected Grid2DSquareCellAbstract.CellID[] getCellIDs(double x, double y, long cellRowIndex, long cellColIndex, double distance, boolean handleOutOfMemoryError)
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
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
remove need for copy to new array.public Grid2DSquareCellAbstract.CellID getNearestCellID(double x, double y, boolean handleOutOfMemoryError)
x
- the x-coordinate of the point.y
- the y-coordinate of the point.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellAbstract.CellID getNearestCellID(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
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
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
return CellID[] as could be more than one nearest CellIDprotected Grid2DSquareCellAbstract.CellID getNearestCellID(double x, double y, long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
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
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getHeightDouble(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getHeightBigDecimal(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getWidthDouble(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getWidthBigDecimal(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected final boolean inGrid(java.math.BigDecimal xBigDecimal, java.math.BigDecimal yBigDecimal, boolean handleOutOfMemoryError)
xBigDecimal
- The x-coordinate of the point.yBigDecimal
- The y-coordinate of the point.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(double x, double y, boolean handleOutOfMemoryError)
x
- The x-coordinate of the point.y
- The y-coordinate of the point.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
cellRowIndex
- The cell row index to test.cellColIndex
- The cell column index to test.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(int chunkRowIndex, int chunkColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- The chunk row index to test.chunkColIndex
- The chunk column index to test.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- The CellID of a cell to test.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(Grid2DSquareCellAbstract.ChunkID chunkID, boolean handleOutOfMemoryError)
chunkID
- The ChunkID of a cell to test.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final boolean inGrid(int chunkRowIndex, int chunkColIndex, int chunkCellRowIndex, int chunkCellColIndex, boolean handleOutOfMemoryError)
chunkRowIndex
- chunkColIndex
- chunkCellRowIndex
- chunkCellColIndex
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getCellXBigDecimal(long cellColIndex, boolean handleOutOfMemoryError)
cellColIndex
- The cell column index thats centroid x-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getCellXDouble(long cellColIndex, boolean handleOutOfMemoryError)
cellColIndex
- The cell column index thats centroid x-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.@Deprecated public final double getCellX(long cellColIndex, boolean handleOutOfMemoryError)
cellColIndex
- The cell column index thats centroid x-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getCellXBigDecimal(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getCellXDouble(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.@Deprecated public final double getCellX(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getCellYBigDecimal(long cellRowIndex, boolean handleOutOfMemoryError)
cellRowIndex
- the cell column index thats centroid y-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getCellYDouble(long cellRowIndex, boolean handleOutOfMemoryError)
cellRowIndex
- the cell column index thats centroid y-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.@Deprecated public final double getCellY(long cellRowIndex, boolean handleOutOfMemoryError)
cellRowIndex
- the cell column index thats centroid y-coordinate is
returned.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final java.math.BigDecimal getCellYBigDecimal(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double getCellYDouble(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.@Deprecated public final double getCellY(Grid2DSquareCellAbstract.CellID cellID, boolean handleOutOfMemoryError)
cellID
- handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double[] getGridBounds(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
Are bounds in double range?
Is there more than cellsize difference with precision?
Throw appropriate exceptions.public final double[] getCellBoundsDoubleArray(long cellRowIndex, long cellColIndex, boolean handleOutOfMemoryError)
cellRowIndex
- the row index of the cell for which the bounds are
returnedcellColIndex
- the column index of the cell for which the bounds are
returnedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double[] getCellBoundsDoubleArray(double x, double y, boolean handleOutOfMemoryError)
x
- the x-coordinate in the cell for which the bounds are returnedy
- the y-coordinate in the cell for which the bounds are returnedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then caching operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO:
Precision may compromise result. More precision is available via
BigDecimal arithmetic.public abstract java.math.BigDecimal getNoDataValueBigDecimal(boolean handleOutOfMemoryError)
@Deprecated public double getNoDataValueDouble(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- Controls whether OutOfMemoryError is
handled via caching by this method. If true then caching initiated in
this method, if false then OutOfMemoryError is thrown to be handled
higher up by caller method.
TODO:
Test
Handling for ArithmeticExceptions caused by rounding.public Grid2DSquareCellAbstract.ChunkID getNextChunk(Grid2DSquareCellAbstract.ChunkID chunkID, int nChunkRows, int nChunkCols, boolean handleOutOfMemoryError)
chunkID
- nChunkRows
- nChunkCols
- handleOutOfMemoryError
- TODO:
Is it inefficient to pass in nChunkRows and nChunkCols since this has them already?public Grid2DSquareCellAbstract.ChunkID getNextChunkRowMinor(Grid2DSquareCellAbstract.ChunkID chunkID, int nChunkRows, int nChunkCols, boolean handleOutOfMemoryError)
chunkID
- nChunkRows
- nChunkCols
- handleOutOfMemoryError
- TODO:
Is it inefficient to pass in nChunkRows and nChunkCols since this has them already?public Grid2DSquareCellAbstract.ChunkID getPreviousChunk(Grid2DSquareCellAbstract.ChunkID chunkID, int nChunkRows, int nChunkCols, boolean handleOutOfMemoryError)
chunkID
- nChunkRows
- nChunkCols
- handleOutOfMemoryError
- TODO:
Is it inefficient to pass in nChunkRows and nChunkCols since this has them already?
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |