|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.examples.conway.CellGrid
public class CellGrid
A CellGrid
represents a grid of Cell
objects.
Cell
Constructor Summary | |
---|---|
CellGrid(int rows,
int columns)
Constructs a CellGrid |
Method Summary | |
---|---|
Cell |
getCellAt(int row,
int column)
|
int |
getNumberOfColumns()
|
int |
getNumberOfLiveCells()
|
int |
getNumberOfRows()
|
void |
killAll()
kills all cells in the grid |
boolean |
nextGeneration()
Moves this grid to its next generation |
void |
setPattern(ConwayPattern pattern)
Populates the grid with a ConwayPattern |
boolean |
transitionState()
Transitions this grid to its next state of evolution |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CellGrid(int rows, int columns)
rows
- number of rows in the gridcolumns
- number of columns in the gridMethod Detail |
---|
public Cell getCellAt(int row, int column)
row
- row of the requested cellcolumn
- column of the requested cell
Cell
public int getNumberOfRows()
CellGrid.getNumberOfColumns()
public int getNumberOfColumns()
CellGrid.getNumberOfRows()
public boolean nextGeneration()
true
if the state changed, otherwise falseCellGrid.transitionState()
public int getNumberOfLiveCells()
CellState
public void killAll()
public boolean transitionState()
true
if the state changed, otherwise falseCellGrid.nextGeneration()
public void setPattern(ConwayPattern pattern)
ConwayPattern
pattern
- pattern to populate the grid withConwayPattern
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |