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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellChunk
      extended by uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellIntChunk
          extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellIntChunkRAF
All Implemented Interfaces:
java.io.Serializable

public class Grid2DSquareCellIntChunkRAF
extends AbstractGrid2DSquareCellIntChunk
implements java.io.Serializable

AbstractGrid2DSquareCellIntChunk extension that stores cell values in a RandomAccessFile.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellChunk
AbstractGrid2DSquareCellChunk.ChunkCellID
 
Field Summary
 java.io.RandomAccessFile randomAccessFile
          The RandomAccessFile for accessing file.
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellChunk
_ChunkID, _Grid2DSquareCell, isSwapUpToDate
 
Constructor Summary
  Grid2DSquareCellIntChunkRAF()
          Default constructor
protected Grid2DSquareCellIntChunkRAF(java.io.File file, AbstractGrid2DSquareCellIntChunk grid2DSquareCellIntChunk, AbstractGrid2DSquareCell.ChunkID _ChunkID)
          TODO: docs Optimise for this type (see commented code for clues)
protected Grid2DSquareCellIntChunkRAF(java.io.File file, Grid2DSquareCellInt grid2DSquareCellInt, AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Creates a new Grid2DSquareCellInt grid containing all no data values.
 
Method Summary
 void clearData()
          Clears the data associated with this.
 int getCell(int chunkCellRowIndex, int chunkCellColIndex, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.
 java.io.RandomAccessFile getData()
          TODO: docs
protected  java.lang.String getDescription()
          Returns a description of this.
protected  void initCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToInitialise)
          Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex.
 void initData()
          Initialises the data associated with this.
 AbstractIterator iterator()
          Returns a Grid2DSquareCellIntChunkRAFIterator for iterating over the cells in this.
 int setCell(int chunkCellRowIndex, int chunkCellColIndex, int valueToSet, int noDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex and sets it to valueToSet
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellIntChunk
getArithmeticMeanBigDecimal, getArithmeticMeanBigDecimal, getArithmeticMeanDouble, getArithmeticMeanDouble, getCell, getCellDouble, getGrid2DSquareCellInt, getGrid2DSquareCellInt, getMaxInt, getMaxInt, getMedianDouble, getMedianDouble, getMinInt, getMinInt, getModeTIntHashSet, getModeTIntHashSet, getNonNoDataValueCountBigInteger, getNonNoDataValueCountBigInteger, getNonNoDataValueCountInt, getNonNoDataValueCountInt, getStandardDeviationDouble, getStandardDeviationDouble, getSumBigDecimal, getSumBigDecimal, initCell, initCells, initCells, setCell, sort1, toArrayIncludingNoDataValues, toArrayIncludingNoDataValues, toArrayNotIncludingNoDataValues, toArrayNotIncludingNoDataValues
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.core.AbstractGrid2DSquareCellChunk
getChunkID, getChunkID, getGrid2DSquareCell, getGrid2DSquareCell, getIsSwapUpToDate, getIsSwapUpToDate, getName, getName, inChunk, inChunk, initChunkID, initGrid2DSquareCell, iterator, setIsSwapUpToDate, setIsSwapUpToDate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomAccessFile

public java.io.RandomAccessFile randomAccessFile
The RandomAccessFile for accessing file.

Constructor Detail

Grid2DSquareCellIntChunkRAF

public Grid2DSquareCellIntChunkRAF()
Default constructor


Grid2DSquareCellIntChunkRAF

protected Grid2DSquareCellIntChunkRAF(java.io.File file,
                                      Grid2DSquareCellInt grid2DSquareCellInt,
                                      AbstractGrid2DSquareCell.ChunkID _ChunkID)
Creates a new Grid2DSquareCellInt grid containing all no data values.

Parameters:
file -
grid2DSquareCellInt -
_ChunkID -

Grid2DSquareCellIntChunkRAF

protected Grid2DSquareCellIntChunkRAF(java.io.File file,
                                      AbstractGrid2DSquareCellIntChunk grid2DSquareCellIntChunk,
                                      AbstractGrid2DSquareCell.ChunkID _ChunkID)
TODO: docs Optimise for this type (see commented code for clues)

Method Detail

getDescription

protected java.lang.String getDescription()
Returns a description of this.

Overrides:
getDescription in class AbstractGrid2DSquareCellChunk

initData

public void initData()
Initialises the data associated with this.

Specified by:
initData in class AbstractGrid2DSquareCellIntChunk

getData

public java.io.RandomAccessFile getData()
TODO: docs


clearData

public void clearData()
Clears the data associated with this.

Specified by:
clearData in class AbstractGrid2DSquareCellIntChunk

getCell

public int getCell(int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int noDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.

Specified by:
getCell in class AbstractGrid2DSquareCellIntChunk
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
noDataValue - the noDataValue of this.grid2DSquareCellInt

initCell

protected void initCell(int chunkCellRowIndex,
                        int chunkCellColIndex,
                        int valueToInitialise)
Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex. Utility method for constructor. It is assumed that the file head is in the correct position

Specified by:
initCell in class AbstractGrid2DSquareCellIntChunk
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
valueToInitialise - the value with which the cell is initialised

setCell

public int setCell(int chunkCellRowIndex,
                   int chunkCellColIndex,
                   int valueToSet,
                   int noDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex and sets it to valueToSet

Specified by:
setCell in class AbstractGrid2DSquareCellIntChunk
Parameters:
chunkCellRowIndex - the row index of the cell w.r.t. the origin of this chunk
chunkCellColIndex - the column index of the cell w.r.t. the origin of this chunk
valueToSet - the value the cell is to be set to
noDataValue - the noDataValue of this.grid2DSquareCellInt

iterator

public AbstractIterator iterator()
Returns a Grid2DSquareCellIntChunkRAFIterator for iterating over the cells in this.

Specified by:
iterator in class AbstractGrid2DSquareCellChunk