public class BinaryTimer extends Object implements RateTimer
Constructor and Description |
---|
BinaryTimer(long timeframe,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
double |
getFrequencyOfEvents()
This method returns average frequency of events happened within predefined timeframe
|
long |
getNumberOfEvents()
This method returns total number of events happened withing predefined timeframe
|
protected boolean |
isAlive() |
void |
triggerEvent()
This method notifies timer about event
|
public BinaryTimer(long timeframe, TimeUnit timeUnit)
public void triggerEvent()
triggerEvent
in interface RateTimer
public double getFrequencyOfEvents()
getFrequencyOfEvents
in interface RateTimer
public long getNumberOfEvents()
getNumberOfEvents
in interface RateTimer
protected boolean isAlive()
Copyright © 2016. All Rights Reserved.