|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--TimeCounter
This class stores elapsed time. The time is recorded in 10ths of a second. Methods exist to convert the stored time into standard minute, second, hours format.
Constructor Summary | |
TimeCounter()
Create a TimeCounter that is initialized to 0. |
|
TimeCounter(int tenthSecs)
Create a TimeCounter set to a specified value. |
Method Summary | |
int |
getHours()
If the elapsed time was written in HH:MM:SS.T form (where HH==hours, MM==minutes, SS==seconds, and T==10ths of seconds), this method returns the number of hours (or HH above). |
int |
getMinutes()
If the elapsed time was written in HH:MM:SS.T form (where HH==hours, MM==minutes, SS==seconds, and T==10ths of seconds), this method returns the number of minutes (or MM above). |
int |
getSeconds()
If the elapsed time was written in HH:MM:SS.T form (where HH==hours, MM==minutes, SS==seconds, and T==10ths of seconds), this method returns the number of seconds (or SS above). |
int |
getTime()
Get the elapsed time in 10ths of a second. |
int |
getTSeconds()
If the elapsed time was written in HH:MM:SS.T form (where HH==hours, MM==minutes, SS==seconds, and T==10ths of seconds), this method returns the number of 10ths of seconds (or T above). |
void |
reset()
Resets the elapsed time to 0. |
void |
setTime(int tenthSecs)
Set the elapsed time. |
void |
tick()
Add a 10th of a second to the elapsed time. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TimeCounter()
public TimeCounter(int tenthSecs)
tenthSecs
- number of 10ths of a second to record. Must
be a positive value.Method Detail |
public int getTime()
public void setTime(int tenthSecs)
tenthSecs
- Elapsed time in 10ths of a secondpublic void tick()
public int getTSeconds()
public int getSeconds()
public int getMinutes()
public int getHours()
public void reset()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |