OOPI.tetris.util
Class Cell

java.lang.Object
  extended byOOPI.tetris.util.Cell

public class Cell
extends java.lang.Object

Cell - an immutable class that represents one cell on a tetris game. Each cell can be filled (or not) and has a color.

Author:
Ben Bederson Copyright (C) 2004 University of Maryland
See Also:
TetrisFrame, TetrisLogic, Position

Constructor Summary
Cell()
          Constructor for a new unfilled cell;
Cell(java.awt.Color color)
          Constructor for a new filled cell.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Utility to determine if too cells are equal
 java.awt.Color getColor()
          Determines the color of this cell.
 int hashCode()
          Utility to generate a hashcode for a cell
 boolean isFilled()
          Determines if this cell is filled or not.
 java.lang.String toString()
          Creates a string representation of this cell for debugging.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cell

public Cell()
Constructor for a new unfilled cell;


Cell

public Cell(java.awt.Color color)
Constructor for a new filled cell.

Parameters:
color - Specifies the color of this cell
Method Detail

isFilled

public boolean isFilled()
Determines if this cell is filled or not.

Returns:
True if this cell is filled.

getColor

public java.awt.Color getColor()
Determines the color of this cell.

Returns:
The color of this cell.

equals

public boolean equals(java.lang.Object obj)
Utility to determine if too cells are equal


hashCode

public int hashCode()
Utility to generate a hashcode for a cell


toString

public java.lang.String toString()
Creates a string representation of this cell for debugging.

Returns:
The string representation.