Class NanoSecs

All Implemented Interfaces:
Duration

public class NanoSecs extends ConcreteDuration
  • Constructor Details

    • NanoSecs

      public NanoSecs()
      Default constructor
    • NanoSecs

      public NanoSecs(long ns)
      Construct object from number of nanoseconds.
      Parameters:
      ns - The amount of nanoseconds.
  • Method Details

    • asSecs

      public static double asSecs(long nanoSecs)
      Parameters:
      nanoSecs - The nanoseconds.
      Returns:
      nanoSecs expressed in s.
    • asMins

      public static double asMins(long nanoSecs)
      Parameters:
      nanoSecs - The amount of nanoseconds.
      Returns:
      nanoSecs expressed in mins
    • asHours

      public static double asHours(long nanoSecs)
      Parameters:
      nanoSecs - The amount of nanoseconds.
      Returns:
      nanoSecs expressed in hours
    • asRevs

      public static double asRevs(long nanoSecs)
      Parameters:
      nanoSecs - The amount of nanoseconds.
      Returns:
      nanoSecs expressed in revs
    • asDays

      public static double asDays(long nanoSecs)
      Parameters:
      nanoSecs - the time in nanoseconds to convert.
      Returns:
      nanoSecs expressed in days.
    • asJulianYears

      public static double asJulianYears(long nanoSecs)
      Parameters:
      nanoSecs - the time in nanoseconds to convert.
      Returns:
      nanoSecs expressed in years.
    • set

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

      public long asNanoSecs()
      Returns:
      duration expressed in ns
      See Also:
    • asSecs

      public double asSecs()
      Returns:
      duration expressed in s
      See Also:
    • asMins

      public double asMins()
      Returns:
      duration expressed in min
      See Also:
    • asHours

      public double asHours()
      Returns:
      duration expressed in h
      See Also:
    • asRevs

      public double asRevs()
      Returns:
      duration expressed in revolutions
      See Also:
    • asDays

      public double asDays()
      Returns:
      number of ns expressed days
      See Also:
    • asJulianYears

      public double asJulianYears()
      Returns:
      duration expressed in Julian years
      See Also:
    • negate

      public NanoSecs negate()
      Specified by:
      negate in interface Duration
      Overrides:
      negate in class ConcreteDuration
      Returns:
      negated amount of time
      See Also:
    • add

      public Duration add(Duration d)
      Description copied from interface: Duration
      Add a duration to this one
      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
      Parameters:
      d - amount of time to subtract
      Returns:
      updated object
      See Also:
    • mult

      public Duration mult(double s)
      Description copied from interface: Duration
      Multiply this duration by a given factor
      Specified by:
      mult in interface Duration
      Overrides:
      mult in class ConcreteDuration
      Parameters:
      s - scale factor
      Returns:
      updated object
      See Also:
    • clone

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