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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.core.Grid2DSquareCellChunkAbstract
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Grid2DSquareCellDoubleChunkAbstract, Grid2DSquareCellIntChunkAbstract

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

Grid2DSquareCellChunkAbstract provides inner classes for ChunkCellID and general geometry methods for extended classes. It also controls what methods extended classes must implement acting 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.

See Also:
Serialized Form

Nested Class Summary
 class Grid2DSquareCellChunkAbstract.ChunkCellID
          A simple ChunkCellID class for distinguishing cells in this chunk.
 
Field Summary
protected  Grid2DSquareCellAbstract.ChunkID chunkID
          For storing the ChunkID of this.
protected  Grid2DSquareCellAbstract grid2DSquareCell
          A reference to the Grid2DSquareCellDoubleAbstract instance.
 
Constructor Summary
Grid2DSquareCellChunkAbstract()
           
 
Method Summary
abstract  void clearData()
          For clearing the data associated with this.
 Grid2DSquareCellAbstract.ChunkID getChunkID()
          Returns this.chunkID TODO: Check that returning a clone is fine.
 Grid2DSquareCellAbstract getGrid2DSquareCell()
          Returns grid2DSquareCellDouble.
 java.lang.String getName()
          Returns the name of this.
 boolean inChunk(int row, int col)
          Returns true if the cell is in the grid chunk
protected  void initChunkID(Grid2DSquareCellAbstract.ChunkID chunkID)
          Initialises chunkID.
abstract  void initData()
          For initialising the data associated with this.
protected  void initGrid2DSquareCell(Grid2DSquareCellAbstract grid2DSquareCell)
          Initialises grid2DSquareCell
abstract  AbstractIterator iterator()
          Returns an iterator over the cell value in this.
abstract  java.lang.String toString()
          For returning a descritption of this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

grid2DSquareCell

protected transient Grid2DSquareCellAbstract grid2DSquareCell
A reference to the Grid2DSquareCellDoubleAbstract instance.


chunkID

protected transient Grid2DSquareCellAbstract.ChunkID chunkID
For storing the ChunkID of this. TODO: Is this transient for caching?

Constructor Detail

Grid2DSquareCellChunkAbstract

public Grid2DSquareCellChunkAbstract()
Method Detail

getGrid2DSquareCell

public Grid2DSquareCellAbstract getGrid2DSquareCell()
Returns grid2DSquareCellDouble.


initGrid2DSquareCell

protected void initGrid2DSquareCell(Grid2DSquareCellAbstract grid2DSquareCell)
Initialises grid2DSquareCell

Parameters:
grid2DSquareCell -

initChunkID

protected void initChunkID(Grid2DSquareCellAbstract.ChunkID chunkID)
Initialises chunkID.

Parameters:
chunkID -

getChunkID

public Grid2DSquareCellAbstract.ChunkID getChunkID()
Returns this.chunkID TODO: Check that returning a clone is fine.


toString

public abstract java.lang.String toString()
For returning a descritption of this.

Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
Returns the name of this.


iterator

public abstract AbstractIterator iterator()
Returns an iterator over the cell value in this. TODO: docs


inChunk

public boolean inChunk(int row,
                       int col)
Returns true if the cell is in the grid chunk


clearData

public abstract void clearData()
For clearing the data associated with this.


initData

public abstract void initData()
For initialising the data associated with this.