Interface Duration

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

public interface Duration extends Serializable
  • Field Details Link icon

  • Method Details Link icon

    • set Link icon

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

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

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

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

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

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

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

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

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

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

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

      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 Link icon

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

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

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