Class CellPhone

java.lang.Object
  |
  +--CellPhone
All Implemented Interfaces:
FootballListener

public class CellPhone
extends java.lang.Object
implements FootballListener

The CellPhone class displays the status of a football game using abbreviated System.out.println() statements as if they were being displayed on a cellphone.

Version:
1.0
Author:
Rich Raposa

Constructor Summary
CellPhone()
          Constructs a new CellPhone object and sets the current quarter to 1.
 
Method Summary
 void displayQuarter()
          Displays the current quarter
 void endOfQuarter(int quarter)
          Updates the quarter of the game
 void homeTeamScored(int points)
          Add the given points to the home team's score
 void setHomeTeam(java.lang.String name)
          Sets the home team
 void setVisitingTeam(java.lang.String name)
          Sets the visiting team
 void updateScore()
          Prints out the current score and quarter
 void visitingTeamScored(int points)
          Add the given points to the visiting team's score
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellPhone

public CellPhone()
Constructs a new CellPhone object and sets the current quarter to 1.

Method Detail

updateScore

public void updateScore()
Prints out the current score and quarter


displayQuarter

public void displayQuarter()
Displays the current quarter


homeTeamScored

public void homeTeamScored(int points)
Add the given points to the home team's score

Specified by:
homeTeamScored in interface FootballListener
Parameters:
points - The number of points to add to the home score.

visitingTeamScored

public void visitingTeamScored(int points)
Add the given points to the visiting team's score

Specified by:
visitingTeamScored in interface FootballListener
Parameters:
points - The number of points to add to the visiting score.

endOfQuarter

public void endOfQuarter(int quarter)
Updates the quarter of the game

Specified by:
endOfQuarter in interface FootballListener
Parameters:
quarter - The quarter that just ended.

setHomeTeam

public void setHomeTeam(java.lang.String name)
Sets the home team

Specified by:
setHomeTeam in interface FootballListener
Parameters:
name - The name of the home team

setVisitingTeam

public void setVisitingTeam(java.lang.String name)
Sets the visiting team

Specified by:
setVisitingTeam in interface FootballListener
Parameters:
name - The name of the visiting team