public interface Chronograph
Modifier and Type | Method and Description |
---|---|
RelativeTime |
getEpochOffset()
Determines the difference between the epoch of this clock from the Epoch.
|
RelativeTime |
getEpochOffset(RelativeTime dest)
Determines the difference between the epoch of this clock from the Epoch.
|
default RelativeTime |
getQueryPrecision()
Obtains the precision with which time can be read, i.e.,
the nominal interval between ticks.
|
RelativeTime |
getQueryPrecision(RelativeTime dest)
Obtains the precision with which time can be read, i.e., the nominal
interval between ticks.
|
AbsoluteTime |
getTime()
Determines the current time.
|
AbsoluteTime |
getTime(AbsoluteTime dest)
Obtains the current time.
|
default boolean |
isUpdated()
Determine whether or not this time keeper is asynchronously synchronized
with an external time source.
|
default AbsoluteTime |
lastSynchronized()
Determine the last time this chronograph was synchronized.
|
default AbsoluteTime |
lastSynchronized(AbsoluteTime result)
Determine the last time this chronograph was synchronized with an external
time source.
|
RelativeTime getEpochOffset() throws StaticUnsupportedOperationException, UninitializedStateException
RelativeTime
value equal to
zero. For other clocks, it is a value representing the difference between
zero on that clock and zero on the UTC measured on the UTC, where
a positive epoc is later than the EPOC.RelativeTime
object in the current
execution context with the UTC as its chronograph and containing
the time when this chronograph was zero.StaticUnsupportedOperationException
- when the chronograph
does not have the concept of date.UninitializedStateException
- when UTC time is not yet available.RelativeTime getEpochOffset(RelativeTime dest) throws StaticUnsupportedOperationException, UninitializedStateException
RelativeTime
value equal to
zero. For other clocks, it is a value representing the difference between
zero on that clock and zero on the UTC measured on the UTC.dest
- An instance of RelativeTime
object
which will be updated in place.RelativeTime
passed as parameter,
or a new object when dest
is null
. The returned
object represents the time differnce between its associated
chronograph and the Epoch.StaticUnsupportedOperationException
- when the chronograph
does not have the concept of date.UninitializedStateException
- when UTC time is not yet available.AbsoluteTime getTime()
AbsoluteTime
in the
current allocation context, representing the current time.
The returned object has the chronograph from this
.AbsoluteTime getTime(AbsoluteTime dest)
AbsoluteTime
is changed at some time between the
invocation of the method and the return of the method. This
method will return an absolute time value that represents this
chronographs's notion of the absolute time. For chronographs
that do not measure calendar time, this absolute time may not
represent a wall clock time.dest
- The instance of AbsoluteTime
object
which will be updated in place.AbsoluteTime
passed as parameter,
or a new object when dest
is null
. The returned
object represents the current time and is associated with
this
chronograph.default boolean isUpdated()
true
for chronographs that are synchronized and
false
otherwise.default AbsoluteTime lastSynchronized() throws StaticUnsupportedOperationException
lastSynchronized(AbsoluteTime)
with
null
as an argument.StaticUnsupportedOperationException
- when the chronograph
will never be updated, i.e., is never synchronized with an
external time source.default AbsoluteTime lastSynchronized(AbsoluteTime result) throws StaticUnsupportedOperationException
result
- a time object to hold the result.result
is null
, a newly allocated time value
holding the value corresponding to the last synchronized time;
otherwise result
updated with that current value.StaticUnsupportedOperationException
- when the chronograph
will never be updated, i.e., is never synchronized with an
external time source.default RelativeTime getQueryPrecision()
getQueryPrecision(RelativeTime)
with
null
as an argument.RelativeTime getQueryPrecision(RelativeTime dest)
dest
- The time object in which to return the results.dest
, when dest
is not
null
, or in a newly created object otherwise.