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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntFactory

public class Grid2DSquareCellIntFactory
extends java.lang.Object

TODO: 1. Abstraction and extension as for Grid2DSquareCellDoubleFactory. 2. Add constructor and setter for prefered type of Grid2DSquareCellIntChunkFactory 3. docs


Field Summary
protected  java.io.File directory
          A directory for caching.
 
Constructor Summary
Grid2DSquareCellIntFactory()
          Defaults directory to a new one in System.getProperties( "java.io.tmpdir" );
Grid2DSquareCellIntFactory(java.io.File directory)
           
 
Method Summary
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File gridFile)
          Returns a new Grid2DSquareCellInt with values obtained from gridFile.
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from gridFile.
protected  Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from gridFile.
protected  Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, java.io.File gridFile, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from gridFile.
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, java.io.File gridFile, java.io.ObjectInputStream ois)
           
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkAbstractFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, Grid2DSquareCellIntChunkAbstractFactory chunkFactory, int chunkNrows, int chunkNcols, long nrows, long ncols, java.math.BigDecimal[] dimensions)
          Returns a new Grid2DSquareCellInt grid with all values as noDataValues.
 Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory, int chunkNrows, int chunkNcols, long nrows, long ncols, java.math.BigDecimal[] dimensions)
          Returns a new Grid2DSquareCellInt grid with all values as noDataValues.
 Grid2DSquareCellInt createGrid2DSquareCellInt(Grid2DSquareCellAbstract grid2DSquareCell)
          Returns a new Grid2DSquareCellInt with all values as int values from grid2DSquareCell.
 Grid2DSquareCellInt createGrid2DSquareCellInt(Grid2DSquareCellAbstract grid2DSquareCell, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.
 Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, java.io.File gridFile, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from gridFile.
 Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellAbstract grid2DSquareCell, Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkAbstractFactory, int chunkNrows, int chunkNcols, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex)
          Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.
 Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics, java.io.File directory, Grid2DSquareCellIntChunkAbstractFactory chunkFactory, int chunkNrows, int chunkNcols, long nrows, long ncols, java.math.BigDecimal[] dimensions)
          Returns a new Grid2DSquareCellInt grid with all values as noDataValues.
 Grid2DSquareCellAbstract createGrid2DSquareCellInt(int chunkNrows, int chunkNcols, long nrows, long ncols)
          Returns an Grid2DSquareCellInt with all values as noDataValues.
 Grid2DSquareCellInt createGrid2DSquareCellInt(int chunkNrows, int chunkNcols, long nrows, long ncols, java.math.BigDecimal[] dimensions)
          Returns an Grid2DSquareCellInt with all values as noDataValues.
 Grid2DSquareCellAbstract createGrid2DSquareCellInt(long nrows, long ncols)
          Returns an Grid2DSquareCellInt with all values as noDataValues.
 Grid2DSquareCellInt createGrid2DSquareCellInt(long nrows, long ncols, java.math.BigDecimal[] dimensions)
          Returns an Grid2DSquareCellInt with all values as noDataValues.
 java.io.File getDirectory()
          Returns directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

protected java.io.File directory
A directory for caching.

Constructor Detail

Grid2DSquareCellIntFactory

public Grid2DSquareCellIntFactory()
Defaults directory to a new one in System.getProperties( "java.io.tmpdir" );


Grid2DSquareCellIntFactory

public Grid2DSquareCellIntFactory(java.io.File directory)
Parameters:
directory - A "workspace directory" for storing temporary files and caching Grid2DSquareCellDoubleAbstract data.
Method Detail

createGrid2DSquareCellInt

public Grid2DSquareCellAbstract createGrid2DSquareCellInt(long nrows,
                                                          long ncols)
Returns an Grid2DSquareCellInt with all values as noDataValues.

Parameters:
nrows - the Grid2DSquareCellInt nrows.
ncols - the Grid2DSquareCellInt ncols. Defaults: chunkNrows and chunkNcols to 64

createGrid2DSquareCellInt

public Grid2DSquareCellAbstract createGrid2DSquareCellInt(int chunkNrows,
                                                          int chunkNcols,
                                                          long nrows,
                                                          long ncols)
Returns an Grid2DSquareCellInt with all values as noDataValues.

Parameters:
chunkNrows - The Grid2DSquareCellInt chunkNrows.
chunkNcols - The Grid2DSquareCellInt chunkNcols.
nrows - the Grid2DSquareCellInt nrows.
ncols - the Grid2DSquareCellInt ncols. Defaults: dimensions = [ cellsize = 1.0d, xmin = 0.0d, ymin = 0.0d, xmax = ncols * cellsize, ymax = nrows * cellsize ]; noDataValue = Integer.MIN_VALUE

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(long nrows,
                                                     long ncols,
                                                     java.math.BigDecimal[] dimensions)
Returns an Grid2DSquareCellInt with all values as noDataValues.

Parameters:
nrows - the Grid2DSquareCellInt nrows.
ncols - the Grid2DSquareCellInt ncols.
dimensions - Defaults: chunkNrows and chunkNcols to 64

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(int chunkNrows,
                                                     int chunkNcols,
                                                     long nrows,
                                                     long ncols,
                                                     java.math.BigDecimal[] dimensions)
Returns an Grid2DSquareCellInt with all values as noDataValues.

Parameters:
chunkNrows - The Grid2DSquareCellInt chunkNrows.
chunkNcols - The Grid2DSquareCellInt chunkNcols.
nrows - the Grid2DSquareCellInt nrows.
ncols - the Grid2DSquareCellInt ncols. Defaults: directory to FileCreator.createNewFile( this.directory )

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long nrows,
                                                     long ncols,
                                                     java.math.BigDecimal[] dimensions)
Returns a new Grid2DSquareCellInt grid with all values as noDataValues.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
chunkNrows - The Grid2DSquareCellInt chunkNrows.
chunkNcols - The Grid2DSquareCellInt chunkNcols.
nrows - the Grid2DSquareCellInt nrows.
ncols - the Grid2DSquareCellInt ncols.
dimensions -

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     Grid2DSquareCellIntChunkAbstractFactory chunkFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long nrows,
                                                     long ncols,
                                                     java.math.BigDecimal[] dimensions)
Returns a new Grid2DSquareCellInt grid with all values as noDataValues.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
chunkFactory - The type of chunks this will be made up of.
nrows - The Grid2DSquareCellInt nrows.
ncols - The Grid2DSquareCellInt ncols.
dimensions - defaults GridStatisticsAbstract to GridStatistics1

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                                     java.io.File directory,
                                                     Grid2DSquareCellIntChunkAbstractFactory chunkFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long nrows,
                                                     long ncols,
                                                     java.math.BigDecimal[] dimensions)
Returns a new Grid2DSquareCellInt grid with all values as noDataValues.

Parameters:
gridStatistics - The GridStatisticsAbstract to accompany the returned grid.
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
chunkFactory - The type of chunks this will be made up of.
nrows - The Grid2DSquareCellInt nrows.
ncols - The Grid2DSquareCellInt ncols.
dimensions - TODO: test

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(Grid2DSquareCellAbstract grid2DSquareCell)
Returns a new Grid2DSquareCellInt with all values as int values from grid2DSquareCell.

Parameters:
grid2DSquareCell - The Grid2DSquareCellAbstract from which values are obtained.

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(Grid2DSquareCellAbstract grid2DSquareCell,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.

Parameters:
grid2DSquareCell - The Grid2DSquareCellAbstract from which values are obtained.
startRowIndex - The topmost row index of grid2DSquareCell thats values are used.
startColIndex - The leftmost column index of grid2DSquareCell thats values are used.
endRowIndex - The bottom row index of the grid2DSquareCell thats values are used.
endColIndex - The rightmost column index of grid2DSquareCell thats values are used.

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     Grid2DSquareCellAbstract grid2DSquareCell,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
grid2DSquareCell - The Grid2DSquareCellAbstract from which values are obtained.
startRowIndex - The topmost row index of grid2DSquareCell thats values are used.
startColIndex - The leftmost column index of grid2DSquareCell thats values are used.
endRowIndex - The bottom row index of the grid2DSquareCell thats values are used.
endColIndex - The rightmost column index of grid2DSquareCell thats values are used. Default: Grid2DSquareCellIntChunkAbstractFactory to Grid2DSquareCellIntChunkMapFactory, chunkNrows to 64, chunkNcols to 64.

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     Grid2DSquareCellAbstract grid2DSquareCell,
                                                     Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkAbstractFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
grid2DSquareCell - The Grid2DSquareCellAbstract from which values are obtained.
grid2DSquareCellIntChunkAbstractFactory - The Grid2DSquareCellIntChunkAbstractFactory used to construct the chunks.
chunkNrows - The (maximum) number of rows in each chunk.
chunkNcols - The (maximum) number of columns in each chunk.
startRowIndex - The topmost row index of grid2DSquareCell thats values are used.
startColIndex - The leftmost column index of grid2DSquareCell thats values are used.
endRowIndex - The bottom row index of the grid2DSquareCell thats values are used.
endColIndex - The rightmost column index of grid2DSquareCell thats values are used. Defaults: GridStatisticsAbstract to GridStatistics1

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                                     java.io.File directory,
                                                     Grid2DSquareCellAbstract grid2DSquareCell,
                                                     Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkAbstractFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from grid2DSquareCell.

Parameters:
gridStatistics - The GridStatisticsAbstract for the returned Grid2DSquareCellInt.
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
grid2DSquareCell - The Grid2DSquareCellAbstract from which values are obtained.
grid2DSquareCellIntChunkAbstractFactory - The Grid2DSquareCellIntChunkAbstractFactory used to construct the chunks.
chunkNrows - The (maximum) number of rows in each chunk.
chunkNcols - The (maximum) number of columns in each chunk.
startRowIndex - The topmost row index of grid2DSquareCell thats values are used.
startColIndex - The leftmost column index of grid2DSquareCell thats values are used.
endRowIndex - The bottom row index of the grid2DSquareCell thats values are used.
endColIndex - The rightmost column index of grid2DSquareCell thats values are used.

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File gridFile)
Returns a new Grid2DSquareCellInt with values obtained from gridFile. If gridFile is a directory then it is assumed to contain a file called cache which can be opened into an object input stream and initailised as an instance of a class extending Grid2DSquareCellAbstract.

Parameters:
gridFile - either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellInt to be returned.

createGrid2DSquareCellInt

protected Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                        java.io.File gridFile,
                                                        long startRowIndex,
                                                        long startColIndex,
                                                        long endRowIndex,
                                                        long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from gridFile.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
gridFile - either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellInt to be returned.
startRowIndex - The topmost row index of the grid represented in gridFile thats values are used.
startColIndex - The leftmost column index of the grid represented in gridFile thats values are used.
endRowIndex - The bottom row index of the grid represented in gridFile thats values are used.
endColIndex - The rightmost column index of the grid represented in gridFile thats values are used. Default: Grid2DSquareCellIntChunkAbstractFactory to Grid2DSquareCellIntChunkArrayFactory

createGrid2DSquareCellInt

protected Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                        java.io.File gridFile,
                                                        Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                                        long startRowIndex,
                                                        long startColIndex,
                                                        long endRowIndex,
                                                        long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from gridFile.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
gridFile - either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellInt to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory used to construct the chunks.
startRowIndex - The topmost row index of the grid represented in gridFile thats values are used.
startColIndex - The leftmost column index of the grid represented in gridFile thats values are used.
endRowIndex - The bottom row index of the grid represented in gridFile thats values are used.
endColIndex - The rightmost column index of the grid represented in gridFile thats values are used. Defaults: chunkNrows and chunkNcols to 64

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     java.io.File gridFile,
                                                     Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from gridFile.

Parameters:
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
gridFile - either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellInt to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory used to construct the chunks.
chunkNrows - The (maximum) number of rows in each chunk.
chunkNcols - The (maximum) number of columns in each chunk.
startRowIndex - The topmost row index of the grid represented in gridFile thats values are used.
startColIndex - The leftmost column index of the grid represented in gridFile thats values are used.
endRowIndex - The bottom row index of the grid represented in gridFile thats values are used.
endColIndex - The rightmost column index of the grid represented in gridFile thats values are used. Defaults: GridStatisticsAbstract to GridStatistics1

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(GridStatisticsAbstract gridStatistics,
                                                     java.io.File directory,
                                                     java.io.File gridFile,
                                                     Grid2DSquareCellIntChunkAbstractFactory grid2DSquareCellIntChunkFactory,
                                                     int chunkNrows,
                                                     int chunkNcols,
                                                     long startRowIndex,
                                                     long startColIndex,
                                                     long endRowIndex,
                                                     long endColIndex)
Returns a new Grid2DSquareCellInt with values obtained from gridFile.

Parameters:
gridStatistics - The GridStatisticsAbstract for the returned Grid2DSquareCellInt.
directory - The directory to be used for storing cached Grid2DSquareCellInt information.
gridFile - either a directory, or a formatted File with a specific extension containing the data and information about the Grid2DSquareCellInt to be returned.
grid2DSquareCellIntChunkFactory - The Grid2DSquareCellIntChunkAbstractFactory used to construct the chunks.
chunkNrows - The (maximum) number of rows in each chunk.
chunkNcols - The (maximum) number of columns in each chunk.
startRowIndex - The topmost row index of the grid represented in gridFile thats values are used.
startColIndex - The leftmost column index of the grid represented in gridFile thats values are used.
endRowIndex - The bottom row index of the grid represented in gridFile thats values are used.
endColIndex - The rightmost column index of the grid represented in gridFile thats values are used.

createGrid2DSquareCellInt

public Grid2DSquareCellInt createGrid2DSquareCellInt(java.io.File directory,
                                                     java.io.File gridFile,
                                                     java.io.ObjectInputStream ois)
Parameters:
directory -
gridFile -
ois - Defaults GridStatistics to GridStatistics1

getDirectory

public java.io.File getDirectory()
Returns directory.