|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBaseStat
public class BaseStat
This class implements a mutable baseball player statistic object. The object maintains a player's hitting statistics: number of official at-bats, walks, hits, and total bases.
Constructor Summary | |
---|---|
BaseStat()
This constructor creates a BaseStat object with all statistics set to 0. |
Method Summary | |
---|---|
java.lang.String |
addDouble()
The method modifies the object by adding a double to the player's statistics. |
java.lang.String |
addHomer()
The method modifies the object by adding a home run to the player's statistics. |
java.lang.String |
addOut()
The method modifies the object by adding an out to the player's statistics. |
java.lang.String |
addSingle()
The method modifies the object by adding a single to the player's statistics. |
java.lang.String |
addTriple()
The method modifies the object by adding a triple to the player's statistics. |
java.lang.String |
addWalk()
The method modifies the object by adding a walk to the player's statistics. |
int |
getBatAvg()
This method returns this object's batting average. |
int |
getOnBaseAvg()
This method returns this object's on-base average. |
int |
getSlugAvg()
This method returns this object's slugging average. |
java.lang.String |
toString()
This method returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BaseStat()
Method Detail |
---|
public java.lang.String addOut()
public java.lang.String addWalk()
public java.lang.String addSingle()
public java.lang.String addDouble()
public java.lang.String addTriple()
public java.lang.String addHomer()
public int getBatAvg()
public int getSlugAvg()
public int getOnBaseAvg()
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 |