|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Time
The Time class is the total time spent solving a map.
Constructor Summary | |
Time()
Constructor - initializes the timer |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Required for the ActionListener interface. |
int |
getTime()
Returns the current time in seconds. |
boolean |
isPaused()
Returns the true if the time is paused, otherwise false. |
void |
reset()
The total time is reset to 0. |
void |
setTime(int newTime)
The total time is set to the time value passed. |
void |
start()
Starts the timer so that the actionPerformed method will be called once every second. |
void |
stop()
Stops the timer from firing ActionEvents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Time()
Method Detail |
public void start()
Starts the timer so that the actionPerformed method will be called once every second.
Pre-condition:the timer has been initialized.public void stop()
Stops the timer from firing ActionEvents.
Pre-condition:the timer is started and firing ActionEvents.public void reset()
The total time is reset to 0.
Pre-condition:none.public void setTime(int newTime)
The total time is set to the time value passed.
newTime
- the time to set the new time topublic boolean isPaused()
public int getTime()
Returns the current time in seconds.
public void actionPerformed(java.awt.event.ActionEvent e)
Required for the ActionListener interface. actionPerformed is called every time the timer fires an ActionEvent, once per second.
Pre-condition:the timer is started and firing ActionEvents.actionPerformed
in interface java.awt.event.ActionListener
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |