public abstract class AbstractSharedTimerSet extends Object implements TimerSet
AbstractSharedTimerSet tracks a single counter that is
shared by all of the Timer instances that are part of the
set.
Each Timer returned by createTimer() becomes
part of the set that created it, and starting or stopping that
timer will increment or decrement the rate at which all other
active timers are advancing.
| Constructor and Description |
|---|
AbstractSharedTimerSet() |
| Modifier and Type | Method and Description |
|---|---|
Timer |
createTimer()
|
int |
getActiveCount()
Returns the number of
Timer instances in this set that
are currently active (i.e. |
protected abstract long |
getCurrentShared()
Returns the current value of a counter that is shared by all
timers created by calling
createTimer() on this
instance. |
protected abstract String |
getTitle()
Implementations should provide a short, readable string to be
included in the
toString() output of the timers that they
create (e.g. |
public Timer createTimer()
TimerSetcreateTimer in interface TimerSetpublic int getActiveCount()
TimerSetTimer instances in this set that
are currently active (i.e. Timer.start() has been called
since the last Timer.stop() call.getActiveCount in interface TimerSetprotected abstract long getCurrentShared()
createTimer() on this
instance. The rate of change of this counter will be evenly
divided among started Timer instances.protected abstract String getTitle()
toString() output of the timers that they
create (e.g. "hotspot").Copyright © 2022. All rights reserved.