public static class TimeWindow.Companion
Modifier and Type | Method and Description |
---|---|
TimeWindow |
between(java.time.Instant fromTime,
java.time.Instant untilTime)
Creates a
class TimeWindow with the time interval [fromTime, untilTime) . TimeWindow.getMidpoint will return
fromTime + (untilTime - fromTime) / 2 . |
TimeWindow |
fromOnly(java.time.Instant fromTime)
Creates a
class TimeWindow with null TimeWindow.getUntilTime , i.e. the time interval [fromTime, ∞) . TimeWindow.getMidpoint will return null. |
TimeWindow |
fromStartAndDuration(java.time.Instant fromTime,
java.time.Duration duration)
Creates a
class TimeWindow with the time interval [fromTime, fromTime + duration) . TimeWindow.getMidpoint will return
fromTime + duration / 2 |
TimeWindow |
untilOnly(java.time.Instant untilTime)
Creates a
class TimeWindow with null TimeWindow.getFromTime , i.e. the time interval (∞, untilTime) . TimeWindow.getMidpoint will return null. |
TimeWindow |
withTolerance(java.time.Instant instant,
java.time.Duration tolerance)
Creates a
class TimeWindow which is centered around instant with the given tolerance on both sides, i.e the
time interval [instant - tolerance, instant + tolerance) . TimeWindow.getMidpoint will return instant. |
public TimeWindow fromOnly(java.time.Instant fromTime)
Creates a class TimeWindow
with null TimeWindow.getUntilTime
, i.e. the time interval [fromTime, ∞)
. TimeWindow.getMidpoint
will return null.
public TimeWindow untilOnly(java.time.Instant untilTime)
Creates a class TimeWindow
with null TimeWindow.getFromTime
, i.e. the time interval (∞, untilTime)
. TimeWindow.getMidpoint
will return null.
public TimeWindow between(java.time.Instant fromTime, java.time.Instant untilTime)
Creates a class TimeWindow
with the time interval [fromTime, untilTime)
. TimeWindow.getMidpoint
will return
fromTime + (untilTime - fromTime) / 2
.
class TimeWindow
,
TimeWindow.getMidpoint
public TimeWindow fromStartAndDuration(java.time.Instant fromTime, java.time.Duration duration)
Creates a class TimeWindow
with the time interval [fromTime, fromTime + duration)
. TimeWindow.getMidpoint
will return
fromTime + duration / 2
class TimeWindow
,
TimeWindow.getMidpoint
public TimeWindow withTolerance(java.time.Instant instant, java.time.Duration tolerance)
Creates a class TimeWindow
which is centered around instant with the given tolerance on both sides, i.e the
time interval [instant - tolerance, instant + tolerance)
. TimeWindow.getMidpoint
will return instant.
class TimeWindow
,
TimeWindow.getMidpoint