Class Time.Reference

All Implemented Interfaces:
org.djutils.base.Identifiable
Enclosing class:
Time

public static final class Time.Reference extends AbstractReference<Time.Reference,Duration>
The reference class to define a reference point for the time. Note that built-in time references are independent; DJUNITS does not embed calendar calculations.
  • Field Details

  • Constructor Details

    • Reference

      public Reference(String id, String name, Duration offset, Time.Reference offsetReference)
      Define a new reference point for the time, with an offset value to another reference.
      Parameters:
      id - the id
      name - the name or explanation
      offset - the offset w.r.t. offsetReference
      offsetReference - the reference to which the offset is relative
    • Reference

      public Reference(String id, String name)
      Define a new reference point for the time without an offset to a base reference.
      Parameters:
      id - the id
      name - the name or explanation
  • Method Details

    • add

      public static void add(String id, String name, Duration offset, Time.Reference offsetReference)
      Define a new reference point for the time, with an offset value to another reference.
      Parameters:
      id - the id
      name - the name or explanation
      offset - the offset w.r.t. offsetReference
      offsetReference - the reference to which the offset is relative
    • add

      public static void add(String id, String name)
      Define a new reference point for the time without an offset to a base reference.
      Parameters:
      id - the id
      name - the name or explanation
    • get

      public static Time.Reference get(String id)
      Get a reference point for the time, based on its id. Return null when the id could not be found.
      Parameters:
      id - the id
      Returns:
      the TimeReference object