Class TimerEventDispatcher
- java.lang.Object
-
- com.google.cloud.tools.jib.builder.TimerEventDispatcher
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class TimerEventDispatcher extends java.lang.Object implements java.io.Closeable
HandlesTimer
s to dispatchTimerEvent
s.
-
-
Constructor Summary
Constructors Constructor Description TimerEventDispatcher(EventHandlers eventHandlers, java.lang.String description)
Creates a newTimerEventDispatcher
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Laps and dispatches aTimerEvent.State.FINISHED
TimerEvent
upon close.void
lap()
Captures the time since last lap or creation and dispatches anTimerEvent.State.LAP
TimerEvent
.void
lap(java.lang.String newDescription)
Captures the time since last lap or creation and dispatches anTimerEvent.State.LAP
TimerEvent
.TimerEventDispatcher
subTimer(java.lang.String description)
Creates a newTimerEventDispatcher
with its parent timer as this.
-
-
-
Constructor Detail
-
TimerEventDispatcher
public TimerEventDispatcher(EventHandlers eventHandlers, java.lang.String description)
Creates a newTimerEventDispatcher
.- Parameters:
eventHandlers
- theEventHandlers
used to dispatch theTimerEvent
sdescription
- the default description for theTimerEvent
s
-
-
Method Detail
-
subTimer
public TimerEventDispatcher subTimer(java.lang.String description)
Creates a newTimerEventDispatcher
with its parent timer as this.- Parameters:
description
- a new description- Returns:
- the new
TimerEventDispatcher
-
lap
public void lap()
Captures the time since last lap or creation and dispatches anTimerEvent.State.LAP
TimerEvent
.- See Also:
lap(String)
-
lap
public void lap(java.lang.String newDescription)
Captures the time since last lap or creation and dispatches anTimerEvent.State.LAP
TimerEvent
.- Parameters:
newDescription
- the description to use instead of theTimerEventDispatcher
's description
-
close
public void close()
Laps and dispatches aTimerEvent.State.FINISHED
TimerEvent
upon close.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-