public class FixedIntervalSupplier extends Object implements SleepIntervalSupplier
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
mLogger |
Constructor and Description |
---|
FixedIntervalSupplier(long fixedInterval)
Constructs a new
FixedIntervalSupplier . |
FixedIntervalSupplier(long fixedInterval,
org.slf4j.Logger logger)
Constructs a new
FixedIntervalSupplier . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getNextInterval(long previousTickedMs,
long nowTimeStampMillis)
Gets the next interval for sleeping.
|
long |
getRunLimit(long previousTickedMs)
Gets the run limit from previous ticked.
|
int |
hashCode() |
public FixedIntervalSupplier(long fixedInterval, org.slf4j.Logger logger)
FixedIntervalSupplier
.fixedInterval
- the fixed intervallogger
- the loggerpublic FixedIntervalSupplier(long fixedInterval)
FixedIntervalSupplier
.fixedInterval
- the fixed intervalpublic long getNextInterval(long previousTickedMs, long nowTimeStampMillis)
SleepIntervalSupplier
getNextInterval
in interface SleepIntervalSupplier
previousTickedMs
- previous ticked time stamp in millisecondnowTimeStampMillis
- current time stamp in millisecondpublic long getRunLimit(long previousTickedMs)
SleepIntervalSupplier
getRunLimit
in interface SleepIntervalSupplier
previousTickedMs
- previous ticked time stamp in millisecondCopyright © 2023. All Rights Reserved.