public class TimerEventDispatcher
extends java.lang.Object
implements java.io.Closeable
Timer
s to dispatch TimerEvent
s.Constructor and Description |
---|
TimerEventDispatcher(EventHandlers eventHandlers,
java.lang.String description)
Creates a new
TimerEventDispatcher . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Laps and dispatches a
TimerEvent.State.FINISHED TimerEvent upon close. |
void |
lap()
Captures the time since last lap or creation and dispatches an
TimerEvent.State.LAP TimerEvent . |
void |
lap(java.lang.String newDescription)
Captures the time since last lap or creation and dispatches an
TimerEvent.State.LAP TimerEvent . |
TimerEventDispatcher |
subTimer(java.lang.String description)
Creates a new
TimerEventDispatcher with its parent timer as this. |
public TimerEventDispatcher(EventHandlers eventHandlers, java.lang.String description)
TimerEventDispatcher
.eventHandlers
- the EventHandlers
used to dispatch the TimerEvent
sdescription
- the default description for the TimerEvent
spublic TimerEventDispatcher subTimer(java.lang.String description)
TimerEventDispatcher
with its parent timer as this.description
- a new descriptionTimerEventDispatcher
public void lap()
TimerEvent.State.LAP
TimerEvent
.lap(String)
public void lap(java.lang.String newDescription)
TimerEvent.State.LAP
TimerEvent
.newDescription
- the description to use instead of the TimerEventDispatcher
's
descriptionpublic void close()
TimerEvent.State.FINISHED
TimerEvent
upon close.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable