Class TimeMediator

java.lang.Object
gaiasky.util.gaia.time.TimeMediator

public class TimeMediator
extends java.lang.Object
A small class to convert between GaiaTime/TCB and OBMT transparently. Needed for the attitude providers which support the retrieval of attitude in OBMT and GaiaTime/TCB.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected gaiasky.util.gaia.time.TimeMediator.TimeConverter converter  
  • Constructor Summary

    Constructors
    Constructor Description
    TimeMediator​(TimeContext nat, TimeContext req)
    Construct a new TimeMediator with a given native and requestd time context
  • Method Summary

    Modifier and Type Method Description
    long convert​(long t)
    Convert a given time.
    static TimeMediator getTimeMediator​(TimeContext nat, TimeContext req)
    Get an applicable TimeMediator for a given combination of time contexts.
    void setTimeContext​(TimeContext nat, TimeContext req)
    Setup a converter according to a requested and native time context.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • converter

      protected gaiasky.util.gaia.time.TimeMediator.TimeConverter converter
  • Constructor Details

    • TimeMediator

      public TimeMediator​(TimeContext nat, TimeContext req)
      Construct a new TimeMediator with a given native and requestd time context
      Parameters:
      nat - native time context
      req - requested time context
  • Method Details

    • convert

      public long convert​(long t)
      Convert a given time.
      Parameters:
      t - time [ns] to convert
      Returns:
      converted time
    • setTimeContext

      public void setTimeContext​(TimeContext nat, TimeContext req)
      Setup a converter according to a requested and native time context.
      Parameters:
      nat - native time context
      req - requested time context
    • getTimeMediator

      public static TimeMediator getTimeMediator​(TimeContext nat, TimeContext req)
      Get an applicable TimeMediator for a given combination of time contexts.
      Parameters:
      nat - native time context
      req - requested time context
      Returns: