Interface Duration

All Known Implementing Classes:
ConcreteDuration, Days, Hours, JulianYears, Mins, NanoSecs, Revs, Secs

public interface Duration
  • Field Details

  • Method Details

    • set

      Set this duration to a new given one
      Parameters:
      d - duration to set this one to
      Returns:
      updated object
    • asNanoSecs

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

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

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

      double asHours()
      Returns:
      duration expressed in h
    • asDays

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

      double asJulianYears()
      Returns:
      duration expressed in Julian years
    • asRevs

      double asRevs()
      Returns:
      duration expressed in revolutions
    • negate

      Duration negate()
      Returns:
      negated amount of time
    • add

      Add a duration to this one
      Parameters:
      d - amount of time to add
      Returns:
      updated object
    • sub

      Subtract a duration from this one
      Parameters:
      d - amount of time to subtract
      Returns:
      updated object
    • isLongerThan

      boolean isLongerThan(Duration d)
      Check that this duration is longer than a given one
      Parameters:
      d - duration to compare to
      Returns:
      true if this duration is longer than d
    • mult

      Duration mult(double s)
      Multiply this duration by a given factor
      Parameters:
      s - scale factor
      Returns:
      updated object
    • getScale

      TimeScale getScale()
      Returns:
      Current time scale of the duration
    • setScale

      void setScale(TimeScale scale)
      Set the time scale for this duration
      Parameters:
      scale - time scale to set the duration to