Package net.time4j

Enum Class SI

All Implemented Interfaces:
Serializable, Comparable<SI>, java.lang.constant.Constable, ChronoUnit

public enum SI extends Enum<SI> implements ChronoUnit

Defines the SI-second as the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom.

SI-seconds were first officially defined in 1967 so that any reference before that date are meaningless. Time4J supports SI-seconds first with the start of UTC epoch 1972-01-01 because especially the class Moment stores everything before 1972 in mean solar seconds.

Meno Hochschild
  • Enum Constant Details


      public static final SI SECONDS

      public static final SI NANOSECONDS
  • Method Details

    • values

      public static SI[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SI valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • between

      public long between(Moment start, Moment end)

      Calculates the time distance between given time points in SI-units.

      start - start time point
      end - end time point
      count of SI-units between start and end
      UnsupportedOperationException - if any time point is before 1972
    • getLength

      public double getLength()
      Description copied from interface: ChronoUnit

      Defines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.

      Important note: This method can only yield an estimated value and is not intended to assist in calculations of durations, but only in sorting of units.

      Specified by:
      getLength in interface ChronoUnit
      estimated decimal value in seconds
    • isCalendrical

      public boolean isCalendrical()
      Description copied from interface: ChronoUnit

      Queries if this time unit is calendrical respective is at least as long as a calendar day.

      Implementation note: The method must be consistent with the typical length of the unit. The expression, 86400.0) >= 0 is equivalent to unit.isCalendrical().

      Specified by:
      isCalendrical in interface ChronoUnit
      true if at least as long as a day else false