public class TimerEventDispatcher extends Object implements Closeable
Timers to dispatch TimerEvents.| Constructor and Description |
|---|
TimerEventDispatcher(EventHandlers eventHandlers,
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(String newDescription)
Captures the time since last lap or creation and dispatches an
TimerEvent.State.LAP TimerEvent. |
TimerEventDispatcher |
subTimer(String description)
Creates a new
TimerEventDispatcher with its parent timer as this. |
public TimerEventDispatcher(EventHandlers eventHandlers, String description)
TimerEventDispatcher.eventHandlers - the EventHandlers used to dispatch the TimerEventsdescription - the default description for the TimerEventspublic TimerEventDispatcher subTimer(String description)
TimerEventDispatcher with its parent timer as this.description - a new descriptionTimerEventDispatcherpublic void lap()
TimerEvent.State.LAP TimerEvent.lap(String)public void lap(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 Closeableclose in interface AutoCloseableCopyright © 2019. All rights reserved.