Package org.cache2k.operation
Class TimeReference.Milliseconds
- java.lang.Object
-
- org.cache2k.operation.TimeReference.Milliseconds
-
- All Implemented Interfaces:
TimeReference
- Direct Known Subclasses:
TimeReference.Default
- Enclosing interface:
- TimeReference
public abstract static class TimeReference.Milliseconds extends Object implements TimeReference
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cache2k.operation.TimeReference
TimeReference.Default, TimeReference.Milliseconds
-
-
Field Summary
-
Fields inherited from interface org.cache2k.operation.TimeReference
DEFAULT, MINIMUM_TICKS
-
-
Constructor Summary
Constructors Constructor Description Milliseconds()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instant
ticksToInstant(long ticks)
Convert a time value in ticks to an instant object.long
ticksToMillisCeiling(long ticks)
Convert a duration in ticks to milliseconds, rounding up to the next full millisecond.long
toTicks(Duration v)
Convert a duration to ticks.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cache2k.operation.TimeReference
sleep, ticks
-
-
-
-
Method Detail
-
ticksToMillisCeiling
public long ticksToMillisCeiling(long ticks)
Description copied from interface:TimeReference
Convert a duration in ticks to milliseconds, rounding up to the next full millisecond.This can be overridden in case another timescale is used. Conversion is needed for correctly scheduling a timer tasks.
- Specified by:
ticksToMillisCeiling
in interfaceTimeReference
-
toTicks
public long toTicks(Duration v)
Description copied from interface:TimeReference
Convert a duration to ticks. Used to convert configuration durations.- Specified by:
toTicks
in interfaceTimeReference
-
ticksToInstant
public Instant ticksToInstant(long ticks)
Description copied from interface:TimeReference
Convert a time value in ticks to an instant object. Needed for display purposes.- Specified by:
ticksToInstant
in interfaceTimeReference
-
-