Package org.todo.gameOfLife
Class CellMatrix
java.lang.Object
org.todo.gameOfLife.CellMatrix
- All Implemented Interfaces:
java.lang.Cloneable
public class CellMatrix
extends java.lang.Object
implements java.lang.Cloneable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CellMatrix.Cell
-
Field Summary
Fields Modifier and Type Field Description private CellMatrix.Cell[][]
matrix
private int
size
-
Constructor Summary
Constructors Constructor Description CellMatrix(int size)
-
Method Summary
Modifier and Type Method Description private void
BLDiagnal(int i, int j)
private void
BRDiagnal(int i, int j)
private void
checkBottom(int i, int j)
private void
checkLeft(int i, int j)
private void
checkRight(int i, int j)
private void
checkTop(int i, int j)
CellMatrix
clone()
CellMatrix.Cell
get(int i, int j)
int
getSize()
void
nextGeneration()
void
randomize(int max)
private void
TLDiagnal(int i, int j)
private void
TRDiagnal(int i, int j)
private void
updateCellNeighborCount()
-
Field Details
-
Constructor Details
-
CellMatrix
public CellMatrix(int size)
-
-
Method Details
-
clone
- Overrides:
clone
in classjava.lang.Object
-
randomize
public void randomize(int max) -
nextGeneration
public void nextGeneration() -
updateCellNeighborCount
private void updateCellNeighborCount() -
checkTop
private void checkTop(int i, int j) -
checkBottom
private void checkBottom(int i, int j) -
checkRight
private void checkRight(int i, int j) -
checkLeft
private void checkLeft(int i, int j) -
TRDiagnal
private void TRDiagnal(int i, int j) -
TLDiagnal
private void TLDiagnal(int i, int j) -
BRDiagnal
private void BRDiagnal(int i, int j) -
BLDiagnal
private void BLDiagnal(int i, int j) -
getSize
public int getSize() -
get
-