@MinDoc(copyright="Copyright 2016 A. Weinert", author="Albrecht Weinert", version="V.33", lastModified="27.03.2021", usage="implement", purpose="a common type for settable Clocks") public interface SClock extends EventListener
AClock
or Clock
, using the event to update its own
time.AClock
's promises consistent readings and
updates
. This most often implies synchronised
implementations of all AClock
methods. Notwithstanding this, it is
essential for most clock sources used that no event listener method
— neither instantChange()
nor
msChange()
— must ever block the clock
sources thread.instantChange()
and
msChange()
setting a (volatile) flag reseted by
update()
plus implementing a conditional update,
either explicitly or automatically on reads.ComVar
Modifier and Type | Method and Description |
---|---|
void |
instantChange(Instant instant)
Set the time by an Instant.
|
void |
instantChange(ZonedDateTime actTimeZd)
Set the time by a ZonedDateTime.
|
void |
msChange(long ms)
Set the time by ms since 1.1.1970.
|
void instantChange(Instant instant)
instant
- the changed time providedvoid instantChange(ZonedDateTime actTimeZd)
actTimeZd
- the changed time providedvoid msChange(long ms)
ms
- the changed time provided by the source