|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.IntervalTimer
A class that represents an interval timer. The timer can be started, stopped, resumed, and cleared, much like a stopwatch.
Field Summary | |
private long |
accum_time
|
private java.lang.String |
name
|
private boolean |
running
|
private long |
start
|
private long |
stop
|
private long |
time
|
Constructor Summary | |
IntervalTimer()
Construct a new IntervalTimer . |
Method Summary | |
void |
clear()
Clear a timer. |
java.lang.String |
getName()
Get the name for this timer. |
long |
getTime()
Get the accumulated time for the timer. |
boolean |
isRunning()
Determine if the timer is currently running. |
void |
release()
Release the timer. |
void |
reserve()
Reserve the timer. |
void |
resume()
Resume a stopped timer. |
void |
setName(java.lang.String name)
Set the name for this timer. |
void |
start()
Start the timer. |
void |
stop()
Stop the timer. |
java.lang.String |
toString()
Create a string representation of the timer, which includes its name and accumulated time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private long start
private long stop
private long time
private long accum_time
private boolean running
private java.lang.String name
Constructor Detail |
public IntervalTimer()
IntervalTimer
.
Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The new name for the timer.public boolean isRunning()
true
if the timer is running and false
otherwise.public void start()
public void stop()
public void resume()
public void clear()
public long getTime()
-1
if the timer is currently running.public java.lang.String toString()
public void reserve()
reserve
in interface Resource
public void release()
release
in interface Resource
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |