|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.util.Timer
public class Timer
Provides timer functionality. A timer is can either be in an activated or stopped state. A timer can sum up the time elapsed while it is in an activated state.

| Constructor Summary | |
|---|---|
Timer()
Creates a new instance of a timer. |
|
Timer(boolean activate)
Creates a new instance of a timer, initially active or not. |
|
| Method Summary | |
|---|---|
long |
getElapsedTime()
Returns the period of time the timer has been in an activated state since the last reset occurred. |
boolean |
isActive()
Returns whether or not this timer is active right now. |
boolean |
isStopped()
Returns whether or not this timer is stopped (not active) right now. |
void |
reset()
Resets the elapsed time to 0. |
void |
start()
Starts or restarts this timer, if not already running. |
void |
stop()
Stops this timer, if not already stopped. |
void |
toggle()
Toggles the activation state if this timer. |
java.lang.String |
toString()
Returns the elapsed time as String in a minutes, seconds, milliseconds format. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Timer()
public Timer(boolean activate)
activate - whether or not the timer should be initially active.| Method Detail |
|---|
public void start()
public void stop()
public void toggle()
public long getElapsedTime()
public boolean isActive()
public boolean isStopped()
public final void reset()
public final java.lang.String toString()
toString in class java.lang.Object
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||