org.drools.examples.conway
Class Cell

java.lang.Object
  extended by org.drools.examples.conway.Cell

public class Cell
extends Object

A Cell represents a single cell within a CellGrid. A cell may be either live or dead.

See Also:
CellState, CellGridImpl

Constructor Summary
Cell(int col, int row)
           
 
Method Summary
 CellState getCellState()
           
 int getCol()
           
 int getLiveNeighbors()
           
 int getPhase()
           
 int getRow()
           
 void setCellState(CellState newState)
          Sets this cells state
 void setLiveNeighbors(int liveNeighbors)
           
 void setPhase(int phase)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cell

public Cell(int col,
            int row)
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

toString

public String toString()
Overrides:
toString in class Object


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