Game of Life 1.5

org.bitstorm.gameoflife
Class Shape

java.lang.Object
  extended byorg.bitstorm.gameoflife.Shape

public class Shape
extends java.lang.Object

Shape contains data of one (predefined) shape.

Author:
Edwin Martin

Field Summary
private  java.lang.String name
           
private  int[][] shape
           
 
Constructor Summary
Shape(java.lang.String name, int[][] shape)
          Constructa a Shape.
 
Method Summary
 java.util.Enumeration getCells()
          Get shape data.
 java.awt.Dimension getDimension()
          Get dimension of shape.
 java.lang.String getName()
          Get name of shape.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final java.lang.String name

shape

private final int[][] shape
Constructor Detail

Shape

public Shape(java.lang.String name,
             int[][] shape)
Constructa a Shape.

Parameters:
name - name of shape
shape - shape data
Method Detail

getDimension

public java.awt.Dimension getDimension()
Get dimension of shape.

Returns:
dimension of the shape in cells

getName

public java.lang.String getName()
Get name of shape.

Returns:
name of shape

getCells

public java.util.Enumeration getCells()
Get shape data. Hide the shape implementation. Returns a anonymous Enumerator object.

Returns:
enumerated shape data

toString

public java.lang.String toString()
See Also:
Object.toString()

Game of Life 1.5

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>.