Class NanoSecs

  • All Implemented Interfaces:
    Duration, java.io.Serializable

    public class NanoSecs
    extends ConcreteDuration
    implements java.io.Serializable
    A finite number of nanoseconds. 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:
    Serialized Form
    • Constructor Detail

      • NanoSecs

        public NanoSecs()
        Default constructor
      • NanoSecs

        public NanoSecs​(long ns)
        Construct object from number of nano seconds.
        Parameters:
        ns - [ns]
    • Method Detail

      • asSecs

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

        public static double asMins​(long nanoSecs)
        Parameters:
        nanoSecs -
        Returns:
        nanoSecs expressed in mins
      • asHours

        public static double asHours​(long nanoSecs)
        Parameters:
        nanoSecs -
        Returns:
        nanoSecs expressed in hours
      • asRevs

        public static double asRevs​(long nanoSecs)
        Parameters:
        nanoSecs -
        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.
      • clone

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