|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlife.Cell
public class Cell
Models a cell in Conway's Game of Life.
| Field Summary | |
|---|---|
private boolean |
flagState
Whether or not the cell is flagged to be changed. |
private int |
positionX
The x-coordinate of the cell. |
private int |
positionY
The y-coordinate of the cell. |
private boolean |
state
Whether or not the cell is alive. |
| Constructor Summary | |
|---|---|
Cell(int x,
int y,
boolean state)
Constructs a cell given an x-coordinate, y-coordinate, and state. |
|
| Method Summary | |
|---|---|
void |
changeState(boolean newState)
|
void |
flagChangeState(boolean newState)
Changes the cell's state to its flagState. |
boolean |
getFlagChangeState()
|
int |
getNeighbors()
|
double |
getPositionX()
|
double |
getPositionY()
|
boolean |
getState()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int positionX
private int positionY
private boolean state
private boolean flagState
| Constructor Detail |
|---|
public Cell(int x,
int y,
boolean state)
x - The x-coordinate of the cell.y - The y-coordinate of the cell.state - Whether or not the cell is alive.| Method Detail |
|---|
public double getPositionX()
public double getPositionY()
public boolean getState()
public void changeState(boolean newState)
newState - The state to which the cell will be changed.public void flagChangeState(boolean newState)
newState - The state to which the cell will be changed.public boolean getFlagChangeState()
public int getNeighbors()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||