Package gaiasky.util.gaia.time
Class TimeMediator
java.lang.Object
gaiasky.util.gaia.time.TimeMediator
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTimeMediator
(TimeContext nat, TimeContext req) Construct a new TimeMediator with a given native and requested time context -
Method Summary
Modifier and TypeMethodDescriptionlong
convert
(long t) Convert a given time.static TimeMediator
getTimeMediator
(TimeContext nat, TimeContext req) Get an applicableTimeMediator
for a given combination of time contexts.void
setTimeContext
(TimeContext nat, TimeContext req) Setup a converter according to a requested and native time context.
-
Field Details
-
converter
-
-
Constructor Details
-
TimeMediator
Construct a new TimeMediator with a given native and requested time context- Parameters:
nat
- native time contextreq
- requested time context
-
-
Method Details
-
getTimeMediator
Get an applicableTimeMediator
for a given combination of time contexts.- Parameters:
nat
- native time contextreq
- requested time context- Returns:
- The time mediator.
-
convert
public long convert(long t) Convert a given time.- Parameters:
t
- time [ns] to convert.- Returns:
- converted time.
-
setTimeContext
Setup a converter according to a requested and native time context.- Parameters:
nat
- native time contextreq
- requested time context
-