Class Secs

All Implemented Interfaces:
Duration, Serializable

public class Secs extends ConcreteDuration implements Serializable
A finite number of seconds. There are two implementations provided of the conversions methods one as object interface, where an object of the current class has to be instantiated. The oder implementation is provided as static class methods. Performance tests of both implementations have come up with a performance improvement of 20% of the static methods compared with the object methods.
See Also:
  • Constructor Details

    • Secs

      public Secs()
      Default constructor
    • Secs

      public Secs(double secs)
      Construct object from an elapsed number of seconds.
      Parameters:
      secs - elapsed time [seconds]
  • Method Details

    • set

      public Duration set(Duration d)
      Description copied from interface: Duration
      Set this duration to a new given one
      Specified by:
      set in interface Duration
      Parameters:
      d - duration to set this one to
      Returns:
      updated object
      See Also:
    • asNanoSecs

      public long asNanoSecs()
      Specified by:
      asNanoSecs in interface Duration
      Returns:
      duration expressed in ns
      See Also:
    • asNanoSecs

      public static long asNanoSecs(double secs)
      Parameters:
      secs - Time in secs to process
      Returns:
      Secs expressed in nanosec
    • asSecs

      public double asSecs()
      Specified by:
      asSecs in interface Duration
      Returns:
      duration expressed in s
      See Also:
    • asMins

      public double asMins()
      Specified by:
      asMins in interface Duration
      Returns:
      duration expressed in min
      See Also:
    • asMins

      public static double asMins(double secs)
      Parameters:
      secs - Time in secs to convert
      Returns:
      Secs expressed in mins
    • asHours

      public double asHours()
      Specified by:
      asHours in interface Duration
      Returns:
      duration expressed in h
      See Also:
    • asHours

      public static double asHours(double secs)
      Parameters:
      secs - Time in secs to convert
      Returns:
      Secs expressed in hours
    • asRevs

      public double asRevs()
      Specified by:
      asRevs in interface Duration
      Returns:
      duration expressed in revolutions
      See Also:
    • asRevs

      public static double asRevs(double secs)
      Parameters:
      secs - Time in secs to convert
      Returns:
      Secs expressed in days
    • asDays

      public double asDays()
      Specified by:
      asDays in interface Duration
      Returns:
      number of ns expressed days
      See Also:
    • asDays

      public static double asDays(double secs)
      Parameters:
      secs - Time in secs to convert
      Returns:
      Secs expressed in days
    • asJulianYears

      public double asJulianYears()
      Specified by:
      asJulianYears in interface Duration
      Returns:
      duration expressed in Julian years
      See Also:
    • asJulianYears

      public static double asJulianYears(double secs)
      Parameters:
      secs - Time in secs to convert
      Returns:
      Secs expressed in JulianYears
    • add

      public Duration add(Duration d)
      Description copied from interface: Duration
      Add a duration to this one
      Specified by:
      add in interface Duration
      Parameters:
      d - amount of time to add
      Returns:
      updated object
      See Also:
    • sub

      public Duration sub(Duration d)
      Description copied from interface: Duration
      Subtract a duration from this one
      Specified by:
      sub in interface Duration
      Parameters:
      d - amount of time to subtract
      Returns:
      updated object
      See Also:
    • clone

      public Secs clone()
      Overrides:
      clone in class Object
      See Also: