|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drools.examples.conway.Cell
public class Cell
A Cell
represents a single cell within a CellGrid
.
A cell may be either live or dead.
CellState
,
CellGrid
Constructor Summary | |
---|---|
Cell()
|
Method Summary | |
---|---|
void |
addNeighbor(Cell neighbor)
ads a new neighbor to this neighbor |
CellState |
getCellState()
|
int |
getNumberOfLiveNeighbors()
|
int |
getNumberOfNeighboringCells()
|
void |
queueNextCellState(CellState nextLiveState)
tell this cell to queue its next live state. this is the state that this cell will be in after the cell is transitioned (after the next iteration). |
void |
setCellState(CellState newState)
Sets this cells state |
boolean |
transitionState()
Transitions this cell 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 Cell()
Method Detail |
---|
public int getNumberOfNeighboringCells()
Cell.getNumberOfLiveNeighbors()
public int getNumberOfLiveNeighbors()
Cell.getNumberOfNeighboringCells()
public void addNeighbor(Cell neighbor)
neighbor
- new neighborpublic void queueNextCellState(CellState nextLiveState)
nextLiveState
- this cell's next live stateCellState
,
Cell.getCellState()
,
Cell.transitionState()
public boolean transitionState()
true
if the state changed, otherwise falseCell.queueNextCellState(CellState)
public CellState getCellState()
Cell.queueNextCellState(org.drools.examples.conway.CellState)
,
CellState
public void setCellState(CellState newState)
newState
- new state for this cellCellState
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |