Uses of Class
javax.time.Duration

Packages that use Duration
Package
Description
Provides classes to manage the continuous time scale including a wrapper for the system clock.
Provides classes to manage the human time scale including date, time, date-time and time-zone representations.
  • Uses of Duration in javax.time

    Classes in javax.time that implement interfaces with type arguments of type Duration
    Modifier and Type
    Class
    Description
    final class 
    A duration between two instants on the time-line.
    Fields in javax.time declared as Duration
    Modifier and Type
    Field
    Description
    static final Duration
    Duration.ZERO
    Constant for a duration of zero.
    Methods in javax.time that return Duration
    Modifier and Type
    Method
    Description
    Duration.abs()
    Returns a copy of this duration with a positive length.
    static Duration
    Duration.between(InstantProvider startInclusive, InstantProvider endExclusive)
    Obtains an instance of Duration representing the duration between two instants.
    Duration.dividedBy(long divisor)
    Returns a copy of this duration divided by the specified value.
    TAIInstant.durationUntil(TAIInstant taiInstant)
    Returns the duration between this instant and the specified instant.
    UTCInstant.durationUntil(UTCInstant utcInstant)
    Returns the duration between this instant and the specified instant.
    Duration.minus(long amount, TimeUnit unit)
    Returns a copy of this duration with the specified duration subtracted.
    Duration.minus(Duration duration)
    Returns a copy of this duration with the specified Duration subtracted.
    Duration.minusMillis(long millisToSubtract)
    Returns a copy of this duration with the specified number of milliseconds subtracted.
    Duration.minusNanos(long nanosToSubtract)
    Returns a copy of this duration with the specified number of nanoseconds subtracted.
    Duration.minusSeconds(long secondsToSubtract)
    Returns a copy of this duration with the specified number of seconds subtracted.
    Duration.multipliedBy(long multiplicand)
    Returns a copy of this duration multiplied by the scalar.
    Duration.negated()
    Returns a copy of this duration with the length negated.
    static Duration
    Duration.of(long amount, TimeUnit unit)
    Obtains an instance of Duration from a duration in a specified time unit.
    static Duration
    Duration.ofMillis(long millis)
    Obtains an instance of Duration from a number of milliseconds.
    static Duration
    Duration.ofNanos(long nanos)
    Obtains an instance of Duration from a number of nanoseconds.
    static Duration
    Duration.ofNanos(BigInteger nanos)
    Obtains an instance of Duration from a number of nanoseconds.
    static Duration
    Duration.ofSeconds(long seconds)
    Obtains an instance of Duration from a number of seconds.
    static Duration
    Duration.ofSeconds(long seconds, long nanoAdjustment)
    Obtains an instance of Duration from a number of seconds and an adjustment in nanoseconds.
    static Duration
    Duration.ofSeconds(BigDecimal seconds)
    Obtains an instance of Duration from a number of seconds.
    static Duration
    Duration.ofStandardDays(long days)
    Obtains an instance of Duration from a number of standard length days.
    static Duration
    Duration.ofStandardHours(long hours)
    Obtains an instance of Duration from a number of standard length hours.
    static Duration
    Duration.ofStandardMinutes(long minutes)
    Obtains an instance of Duration from a number of standard length minutes.
    static Duration
    Duration.parse(String text)
    Obtains an instance of Duration by parsing a string.
    Duration.plus(long amount, TimeUnit unit)
    Returns a copy of this duration with the specified duration added.
    Duration.plus(Duration duration)
    Returns a copy of this duration with the specified Duration added.
    Duration.plusMillis(long millisToAdd)
    Returns a copy of this duration with the specified number of milliseconds added.
    Duration.plusNanos(long nanosToAdd)
    Returns a copy of this duration with the specified number of nanoseconds added.
    Duration.plusSeconds(long secondsToAdd)
    Returns a copy of this duration with the specified number of seconds added.
    Methods in javax.time with parameters of type Duration
    Modifier and Type
    Method
    Description
    int
    Duration.compareTo(Duration otherDuration)
    Compares this duration to the specified Duration.
    boolean
    Duration.isGreaterThan(Duration otherDuration)
    Checks if this duration is greater than the specified Duration.
    boolean
    Duration.isLessThan(Duration otherDuration)
    Checks if this duration is less than the specified Duration.
    Duration.minus(Duration duration)
    Returns a copy of this duration with the specified Duration subtracted.
    Instant.minus(Duration duration)
    Returns a copy of this instant with the specified duration subtracted.
    TAIInstant.minus(Duration duration)
    Returns a copy of this instant with the specified duration subtracted.
    UTCInstant.minus(Duration duration)
    Returns a copy of this instant with the specified duration subtracted.
    static TimeSource
    TimeSource.offsetSystem(Duration offset)
    Gets a time-source that obtains the current instant using the system millisecond clock and adjusts by a fixed offset.
    Duration.plus(Duration duration)
    Returns a copy of this duration with the specified Duration added.
    Instant.plus(Duration duration)
    Returns a copy of this instant with the specified duration added.
    TAIInstant.plus(Duration duration)
    Returns a copy of this instant with the specified duration added.
    UTCInstant.plus(Duration duration)
    Returns a copy of this instant with the specified duration added.
  • Uses of Duration in javax.time.calendar

    Methods in javax.time.calendar that return Duration
    Modifier and Type
    Method
    Description
    Gets an estimate of the duration of the unit in seconds.
    Period.toDuration()
    Calculates the accurate duration of this period.
    PeriodField.toDuration()
    Calculates the accurate duration of this period.
    PeriodFields.toDuration()
    Calculates the accurate duration of this period.
    Calculates the accurate duration of this period.
    Estimates the duration of this period.
    PeriodField.toEstimatedDuration()
    Estimates the duration of this period.
    PeriodFields.toEstimatedDuration()
    Estimates the duration of this period.
    Methods in javax.time.calendar with parameters of type Duration
    Modifier and Type
    Method
    Description
    LocalDateTime.minus(Duration duration)
    Returns a copy of this LocalDateTime with the specified duration subtracted.
    LocalTime.minus(Duration duration)
    Returns a copy of this LocalTime with the specified duration subtracted.
    OffsetDateTime.minus(Duration duration)
    Returns a copy of this OffsetDateTime with the specified duration subtracted.
    OffsetTime.minus(Duration duration)
    Returns a copy of this OffsetTime with the specified duration subtracted.
    ZonedDateTime.minusDuration(Duration duration)
    Returns a copy of this ZonedDateTime with the specified duration subtracted.
    static Period
    Period.of(Duration duration)
    Obtains a Period from a Duration.
    PeriodFields.of(Duration duration)
    Obtains a PeriodFields from a Duration based on the standard durations of seconds and nanoseconds.
    LocalDateTime.plus(Duration duration)
    Returns a copy of this LocalDateTime with the specified duration added.
    LocalTime.plus(Duration duration)
    Returns a copy of this LocalTime with the specified duration added.
    OffsetDateTime.plus(Duration duration)
    Returns a copy of this OffsetDateTime with the specified duration added.
    OffsetTime.plus(Duration duration)
    Returns a copy of this OffsetTime with the specified duration added.
    ZonedDateTime.plusDuration(Duration duration)
    Returns a copy of this ZonedDateTime with the specified duration added.
    Constructors in javax.time.calendar with parameters of type Duration
    Modifier
    Constructor
    Description
    protected
    PeriodUnit(String name, Duration estimatedDuration)
    Constructor to create a base unit that cannot be derived.