|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Player
Class Player A class that models a player in a golf tournament.
Constructor Summary | |
Player()
constructor builds the player with default values |
|
Player(java.lang.String fn,
java.lang.String ln,
int r1,
int r2)
constructor builds the player with the supplied parameters |
Method Summary | |
int |
compareTo(java.lang.Object obj)
Compares two Players based on their score If not passed a Player, 0 is returned |
java.lang.String |
getFName()
returns first name of the player |
java.lang.String |
getLName()
returns last name of the player |
int |
getRound1()
returns first round score |
int |
getRound2()
returns second round score |
int |
getTotal()
returns total score |
java.lang.String |
toString()
returns player information as a String |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Player(java.lang.String fn, java.lang.String ln, int r1, int r2)
first
- name of the playerlast
- name of the playerscore
- of first roundscore
- of second roundpublic Player()
Method Detail |
public java.lang.String getFName()
public java.lang.String getLName()
public int getRound1()
public int getRound2()
public int getTotal()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
Player
- object to compare with
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |