Class Days

All Implemented Interfaces:
Duration, Serializable

public class Days extends ConcreteDuration implements Serializable
A finite number of days 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 Details

    • Days

      public Days()
      Default constructor
    • Days

      public Days(double days)
      Construct object
      Parameters:
      days - number of days
  • 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
      Returns:
      Duration
      See Also:
      Duration.set(Duration)
    • asNanoSecs

      public long asNanoSecs()
      Specified by:
      asNanoSecs in interface Duration
      Returns:
      long
      See Also:
      Duration.asNanoSecs()
    • asNanoSecs

      public static long asNanoSecs(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in nanoSec
    • asSecs

      public double asSecs()
      Specified by:
      asSecs in interface Duration
      Returns:
      double
      See Also:
      Duration.asSecs()
    • asSecs

      public static double asSecs(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in sec
    • asMins

      public double asMins()
      Specified by:
      asMins in interface Duration
      Returns:
      double
      See Also:
      Duration.asMins()
    • asMins

      public static double asMins(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in mins
    • asHours

      public double asHours()
      Specified by:
      asHours in interface Duration
      Returns:
      double
      See Also:
      Duration.asHours()
    • asRevs

      public double asRevs()
      Specified by:
      asRevs in interface Duration
      Returns:
      double
      See Also:
      Duration.asRevs()
    • asRevs

      public static double asRevs(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in revolutions
    • asHours

      public static double asHours(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in hours
    • asDays

      public double asDays()
      Specified by:
      asDays in interface Duration
      Returns:
      double
      See Also:
      Duration.asDays()
    • asJulianYears

      public double asJulianYears()
      Specified by:
      asJulianYears in interface Duration
      Returns:
      double
      See Also:
      Duration.asJulianYears()
    • asJulianYears

      public static double asJulianYears(double days)
      Parameters:
      days - The time in days to convert.
      Returns:
      days expressed in julian years
    • negate

      public Duration negate()
      Specified by:
      negate in interface Duration
      Overrides:
      negate in class ConcreteDuration
      Returns:
      Duration
      See Also:
      Duration.negate()
    • 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 - Duration
      Returns:
      Duration
      See Also:
      Duration.sub(Duration)
    • 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 - Duration
      Returns:
      Duration
      See Also:
      Duration.sub(Duration)
    • clone

      public Days clone()
      Overrides:
      clone in class Object
      See Also:
      Object.clone()