|
Game of Life 1.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.bitstorm.gameoflife.Cell
Every cell in the grid is a Cell-object. So it must be as small as possible. Because every cell is pre-generated, no cells have to be generated when the Game Of Life playw. Whether a cell is alive or not, is not part of the Cell-object.
| Field Summary | |
short |
col
|
private int |
HASHFACTOR
HASHFACTOR must be larger than the maximum number of columns (that is: the max width of a monitor in pixels). |
byte |
neighbour
Number of neighbours of this cell. |
short |
row
|
| Constructor Summary | |
Cell(int col,
int row)
Constructor |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
Compare cell-objects for use in hashtables |
int |
hashCode()
Calculate hash for use in hashtables |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final short col
public final short row
public byte neighbour
private final int HASHFACTOR
| Constructor Detail |
public Cell(int col,
int row)
col - column of cellrow - row or cell| Method Detail |
public boolean equals(java.lang.Object o)
Object.equals(java.lang.Object)public int hashCode()
Object.hashCode()public java.lang.String toString()
Object.toString()
|
Game of Life 1.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This API descibes the Game of Life program, written by Edwin Martin. The source code is available online too.
Copyright 1996-2004 Edwin Martin <edwin@bitstorm.org>.