|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gamekeeper2a.Contestant
Information about a single contestant. Unless the subclass specifies otherwise, assume that contestant names are case sensitive; and that leading and trailing spaces (but not internal spaces) are ignored and trimmed.
Constructor Summary | |
Contestant(java.lang.String contestant)
Creates a new instance of contestant, with initial no games recorded. |
Method Summary | |
int |
getGamesDrawn()
Tells the number of games tied (draws) so far. |
int |
getGamesLost()
Tells the number of games lost so far. |
int |
getGamesWon()
Tells the number of games won so far. |
java.lang.String |
getName()
Tells the name of this contestant. |
double |
getWinRatio()
Return a number which summarizes how well the contestant has done so far. |
void |
recordDraw()
Remember that a game was a draw. |
void |
recordLoss()
Remember that a game was lost. |
void |
recordWin()
Remember that a game was won. |
java.lang.String |
toString()
Format a string, without line feeds or surrounding whitespace, with basic contestant information. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Contestant(java.lang.String contestant)
Method Detail |
public int getGamesLost()
IContestant
getGamesLost
in interface IContestant
public int getGamesWon()
IContestant
getGamesWon
in interface IContestant
public int getGamesDrawn()
IContestant
getGamesDrawn
in interface IContestant
public java.lang.String getName()
getName
in interface IContestant
public void recordLoss()
recordLoss
in interface IContestant
public void recordWin()
recordWin
in interface IContestant
public void recordDraw()
IContestant
recordDraw
in interface IContestant
public double getWinRatio()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |