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

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

public class Grid2DSquareCellDoubleChunkRAF
extends AbstractGrid2DSquareCellDoubleChunk
implements java.io.Serializable

AbstractGrid2DSquareCellDoubleChunk 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
protected  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
  Grid2DSquareCellDoubleChunkRAF()
          Default constructor
protected Grid2DSquareCellDoubleChunkRAF(java.io.File file, AbstractGrid2DSquareCellDoubleChunk grid2DSquareCellDoubleChunk, AbstractGrid2DSquareCell.ChunkID chunkID)
          TODO: docs Optimise for this type (see commented code for clues)
protected Grid2DSquareCellDoubleChunkRAF(java.io.File file, Grid2DSquareCellDouble grid2DSquareCellDouble, AbstractGrid2DSquareCell.ChunkID _ChunkID)
          Creates a new Grid2DSquareCellDouble grid containing all no data values.
 
Method Summary
protected  void clearData()
          Clears the data associated with this.
protected  double getCell(int chunkCellRowIndex, int chunkCellColIndex, double _NoDataValue)
          Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell row chunkCellColIndex.
protected  java.io.RandomAccessFile getData()
          For returning this.randomAccessFile.
protected  void initCell(int chunkCellRowIndex, int chunkCellColIndex, double valueToInitialise)
          Initialises the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex.
protected  void initData()
          Initialises the data associated with this.
protected  AbstractIterator iterator()
          Returns a Grid2DSquareCellDoubleChunkRAFIterator for iterating over the cells in this.
protected  double setCell(int chunkCellRowIndex, int chunkCellColIndex, double valueToSet, double _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.AbstractGrid2DSquareCellDoubleChunk
getArithmeticMeanBigDecimal, getArithmeticMeanBigDecimal, getArithmeticMeanDouble, getArithmeticMeanDouble, getCell, getCell, getCellBigDecimal, getGrid2DSquareCellDouble, getGrid2DSquareCellDouble, getMaxDouble, getMaxDouble, getMedianDouble, getMedianDouble, getMinDouble, getMinDouble, getModeTDoubleHashSet, getModeTDoubleHashSet, 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, getDescription, 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

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

Constructor Detail

Grid2DSquareCellDoubleChunkRAF

public Grid2DSquareCellDoubleChunkRAF()
Default constructor


Grid2DSquareCellDoubleChunkRAF

protected Grid2DSquareCellDoubleChunkRAF(java.io.File file,
                                         Grid2DSquareCellDouble grid2DSquareCellDouble,
                                         AbstractGrid2DSquareCell.ChunkID _ChunkID)
Creates a new Grid2DSquareCellDouble grid containing all no data values.

Parameters:
grid2DSquareCellDouble -
_ChunkID -

Grid2DSquareCellDoubleChunkRAF

protected Grid2DSquareCellDoubleChunkRAF(java.io.File file,
                                         AbstractGrid2DSquareCellDoubleChunk grid2DSquareCellDoubleChunk,
                                         AbstractGrid2DSquareCell.ChunkID chunkID)
TODO: docs Optimise for this type (see commented code for clues)

Method Detail

initData

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

Specified by:
initData in class AbstractGrid2DSquareCellDoubleChunk

getData

protected java.io.RandomAccessFile getData()
For returning this.randomAccessFile. TODO: Return a copy of this.randomAccessFile and make public? Should the file be copied?


clearData

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

Specified by:
clearData in class AbstractGrid2DSquareCellDoubleChunk

getCell

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

Specified by:
getCell in class AbstractGrid2DSquareCellDoubleChunk
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.grid2DSquareCellDouble

initCell

protected void initCell(int chunkCellRowIndex,
                        int chunkCellColIndex,
                        double 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 AbstractGrid2DSquareCellDoubleChunk
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

protected double setCell(int chunkCellRowIndex,
                         int chunkCellColIndex,
                         double valueToSet,
                         double _NoDataValue)
Returns the value at position given by: chunk cell row chunkCellRowIndex; chunk cell column chunkCellColIndex and sets it to valueToSet. The swapped version remains up to date (if it is) since the data resides in filespace.

Specified by:
setCell in class AbstractGrid2DSquareCellDoubleChunk
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.grid2DSquareCellDouble

iterator

protected AbstractIterator iterator()
Returns a Grid2DSquareCellDoubleChunkRAFIterator for iterating over the cells in this.

Specified by:
iterator in class AbstractGrid2DSquareCellChunk