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
Fields in javax.time declared as DurationModifier and TypeFieldDescriptionprivate final Duration
TimeSource.OffsetSystemTimeSource.offset
The fixed offset to add.static final Duration
Duration.ZERO
Constant for a duration of zero.Methods in javax.time that return DurationModifier and TypeMethodDescriptionDuration.abs()
Returns a copy of this duration with a positive length.static Duration
Duration.between
(InstantProvider startInclusive, InstantProvider endExclusive) Obtains an instance ofDuration
representing the duration between two instants.private static Duration
Duration.create
(long seconds, int nanoAdjustment) Obtains an instance ofDuration
using seconds and nanoseconds.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.Returns a copy of this duration with the specified duration subtracted.Returns a copy of this duration with the specifiedDuration
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
Obtains an instance ofDuration
from a duration in a specified time unit.static Duration
Duration.ofMillis
(long millis) Obtains an instance ofDuration
from a number of milliseconds.static Duration
Duration.ofNanos
(long nanos) Obtains an instance ofDuration
from a number of nanoseconds.static Duration
Duration.ofNanos
(BigInteger nanos) Obtains an instance ofDuration
from a number of nanoseconds.static Duration
Duration.ofSeconds
(long seconds) Obtains an instance ofDuration
from a number of seconds.static Duration
Duration.ofSeconds
(long seconds, long nanoAdjustment) Obtains an instance ofDuration
from a number of seconds and an adjustment in nanoseconds.static Duration
Duration.ofSeconds
(BigDecimal seconds) Obtains an instance ofDuration
from a number of seconds.static Duration
Duration.ofStandardDays
(long days) Obtains an instance ofDuration
from a number of standard length days.static Duration
Duration.ofStandardHours
(long hours) Obtains an instance ofDuration
from a number of standard length hours.static Duration
Duration.ofStandardMinutes
(long minutes) Obtains an instance ofDuration
from a number of standard length minutes.static Duration
Obtains an instance ofDuration
by parsing a string.Returns a copy of this duration with the specified duration added.Returns a copy of this duration with the specifiedDuration
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 DurationModifier and TypeMethodDescriptionint
Compares this duration to the specifiedDuration
.boolean
Duration.isGreaterThan
(Duration otherDuration) Checks if this duration is greater than the specifiedDuration
.boolean
Duration.isLessThan
(Duration otherDuration) Checks if this duration is less than the specifiedDuration
.Returns a copy of this duration with the specifiedDuration
subtracted.Returns a copy of this instant with the specified duration subtracted.Returns a copy of this instant with the specified duration subtracted.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.Returns a copy of this duration with the specifiedDuration
added.Returns a copy of this instant with the specified duration added.Returns a copy of this instant with the specified duration added.Returns a copy of this instant with the specified duration added.Constructors in javax.time with parameters of type DurationModifierConstructorDescriptionprivate
OffsetSystemTimeSource
(Duration offset) Restricted constructor. -
Uses of Duration in javax.time.calendar
Fields in javax.time.calendar declared as DurationModifier and TypeFieldDescriptionprivate final Duration
PeriodUnit.estimatedDuration
The estimated duration of the unit, not null.Methods in javax.time.calendar that return DurationModifier and TypeMethodDescriptionPeriodUnit.getEstimatedDuration()
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.Period.toDurationWith24HourDays()
Calculates the accurate duration of this period.Period.toEstimatedDuration()
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 DurationModifier and TypeMethodDescriptionReturns a copy of thisLocalDateTime
with the specified duration subtracted.Returns a copy of thisLocalTime
with the specified duration subtracted.Returns a copy of thisOffsetDateTime
with the specified duration subtracted.Returns a copy of thisOffsetTime
with the specified duration subtracted.ZonedDateTime.minusDuration
(Duration duration) Returns a copy of thisZonedDateTime
with the specified duration subtracted.static Period
Obtains aPeriod
from aDuration
.static PeriodFields
Obtains aPeriodFields
from aDuration
based on the standard durations of seconds and nanoseconds.Returns a copy of thisLocalDateTime
with the specified duration added.Returns a copy of thisLocalTime
with the specified duration added.Returns a copy of thisOffsetDateTime
with the specified duration added.Returns a copy of thisOffsetTime
with the specified duration added.ZonedDateTime.plusDuration
(Duration duration) Returns a copy of thisZonedDateTime
with the specified duration added.Constructors in javax.time.calendar with parameters of type DurationModifierConstructorDescription(package private)
PeriodUnit
(String name, PeriodField equivalentPeriod, Duration estimatedDuration) Constructor used by ISOChronology.protected
PeriodUnit
(String name, Duration estimatedDuration) Constructor to create a base unit that cannot be derived.private
Unit
(int ordinal, String name, PeriodField equivalentPeriod, Duration estimatedDuration)