Package org.drools.examples.conway
Class Cell
- java.lang.Object
-
- org.drools.examples.conway.Cell
-
public class Cell extends Object
ACellrepresents a single cell within aCellGrid. A cell may be either live or dead.- See Also:
CellState,CellGridImpl
-
-
Constructor Summary
Constructors Constructor Description Cell(int col, int row)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CellStategetCellState()intgetCol()intgetLiveNeighbors()intgetPhase()intgetRow()voidsetCellState(CellState newState)Sets this cells statevoidsetLiveNeighbors(int liveNeighbors)voidsetPhase(int phase)StringtoString()
-
-
-
Method Detail
-
getCol
public int getCol()
-
getRow
public int getRow()
-
getPhase
public int getPhase()
-
setPhase
public void setPhase(int phase)
-
getLiveNeighbors
public int getLiveNeighbors()
-
setLiveNeighbors
public void setLiveNeighbors(int liveNeighbors)
-
getCellState
public CellState getCellState()
- Returns:
- this cell's current life state
- See Also:
#queueNextCellState(org.drools.examples.conway.CellState),CellState
-
setCellState
public void setCellState(CellState newState)
Sets this cells state- Parameters:
newState- new state for this cell- See Also:
CellState
-
-