|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CellPhone
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.
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 |
public CellPhone()
Method Detail |
public void updateScore()
public void displayQuarter()
public void homeTeamScored(int points)
homeTeamScored
in interface FootballListener
points
- The number of points to add to the home score.public void visitingTeamScored(int points)
visitingTeamScored
in interface FootballListener
points
- The number of points to add to the visiting score.public void endOfQuarter(int quarter)
endOfQuarter
in interface FootballListener
quarter
- The quarter that just ended.public void setHomeTeam(java.lang.String name)
setHomeTeam
in interface FootballListener
name
- The name of the home teampublic void setVisitingTeam(java.lang.String name)
setVisitingTeam
in interface FootballListener
name
- The name of the visiting team
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |