@MinDoc(copyright="Copyright 2016 A. Weinert", author="Albrecht Weinert", version="V.33", lastModified="27.03.2021", usage="wrap use", purpose="a Clock ia a AClock disguise") public final class AsyClock extends Clock implements Serializable, AClock
java.time.Clock
for as an AClock object. It is
asynchronous and update()
does nothing.Clock
when an AClock
is required
and, then, preferably use Clock
methods only:
getZone()
, instant()
and millis()
. TimeHelper
,
Serialized FormModifier and Type | Field and Description |
---|---|
Clock |
clock
The underlying clock.
|
ZoneId |
zone
This Clock's / SynClocks's time-zone.
|
Modifier and Type | Method and Description |
---|---|
FixClock |
fix()
Provide another AClock with a fixed time according to current state.
|
ZoneId |
getZone()
The clock's time-zone.
|
Instant |
instant()
The current instant of this AsyClock.
|
static AsyClock |
make(Clock clock,
ZoneId zone)
Obtain a AsyClock.
|
long |
millis()
The current time of this AsyClock.
|
String |
toString()
The state as String.
|
boolean |
update()
Update this AsyClock to its current time.
|
AsyClock |
withZone(ZoneId zone)
Provide another AsyClock with a different time-zone.
|
equals, fixed, hashCode, offset, system, systemDefaultZone, systemUTC, tick, tickMinutes, tickSeconds
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
format, formatDIN, getActTime, getActTime, getDayOfMonth, getHour, getMilli, getMinute, getMonth, getMonthOfYear, getNano, getSecond, getYear, of, setActTime, setActTimeMs, setInstant
public final Clock clock
public final ZoneId zone
public static AsyClock make(Clock clock, ZoneId zone)
Clock.systemDefaultZone()
will be used
for clock and zone. Clock.system(zone)
will be used.zone
- the time zone to useclock
- the underlying Clockupdated
to clock's actual timepublic ZoneId getZone()
ZonedDateTime
.
It is finally set at construction, never null and defaults to
clock's
zone.public Instant instant()
public long millis()
public boolean update()
clock
this method does the same. I.e., if the wrapped
clock
is an AClock
the update is just forwarded.public String toString()