|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--BattingAverage
The BattingAverge class is used to store and calculate a player's batting average.
| Constructor Summary | |
BattingAverage()
Constructor |
|
BattingAverage(BattingAverage obj)
Clone Constructor |
|
BattingAverage(int hits,
int atBats)
Full Constructor |
|
| Method Summary | |
boolean |
equals(java.lang.Object obj)
Determine if an object is equal to this object. |
int |
getAtBats()
Get the value of atBats. |
double |
getBattingAverage()
Calculate and return a player's batting average. |
int |
getHits()
Get the value of hits. |
void |
setAtBats(int atBats)
Set the value of atBats |
void |
setHits(int hits)
Set the value of hits |
java.lang.String |
toString()
Convert object to String |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public BattingAverage()
public BattingAverage(BattingAverage obj)
obj - clone this object.
public BattingAverage(int hits,
int atBats)
hits - - The number of hits a player has.atBats - - The number of "at bat" attempts a player has.| Method Detail |
public void setHits(int hits)
hits - The number of hits a player has.public int getHits()
public void setAtBats(int atBats)
atBats - The number of "at bat" attempts a player has.public int getAtBats()
public java.lang.String toString()
public boolean equals(java.lang.Object obj)
obj - the object to test.public double getBattingAverage()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||