org.drools.examples.conway
Class CellGridImpl

java.lang.Object
  extended by org.drools.examples.conway.CellGridImpl
All Implemented Interfaces:
CellGrid

public class CellGridImpl
extends Object
implements CellGrid

A CellGrid represents a grid of Cell objects.

See Also:
Cell

Constructor Summary
CellGridImpl(int rows, int columns, int executionControl)
          Constructs a CellGrid
 
Method Summary
 void dispose()
           
 Cell getCellAt(int row, int column)
           
 int getNumberOfColumns()
           
 int getNumberOfRows()
           
 void killAll()
           
 boolean nextGeneration()
           
 void setPattern(ConwayPattern pattern)
           
 String toString()
           
 void updateCell(Cell cell, CellState state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellGridImpl

public CellGridImpl(int rows,
                    int columns,
                    int executionControl)
Constructs a CellGrid

Parameters:
rows - number of rows in the grid
columns - number of columns in the grid
Method Detail

getCellAt

public Cell getCellAt(int row,
                      int column)
Specified by:
getCellAt in interface CellGrid

getNumberOfRows

public int getNumberOfRows()
Specified by:
getNumberOfRows in interface CellGrid

getNumberOfColumns

public int getNumberOfColumns()
Specified by:
getNumberOfColumns in interface CellGrid

nextGeneration

public boolean nextGeneration()
Specified by:
nextGeneration in interface CellGrid

killAll

public void killAll()
Specified by:
killAll in interface CellGrid

setPattern

public void setPattern(ConwayPattern pattern)
Specified by:
setPattern in interface CellGrid

updateCell

public void updateCell(Cell cell,
                       CellState state)
Specified by:
updateCell in interface CellGrid

dispose

public void dispose()
Specified by:
dispose in interface CellGrid

toString

public String toString()
Specified by:
toString in interface CellGrid
Overrides:
toString in class Object


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.