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 DurationModifier and TypeClassDescriptionfinal classA duration between two instants on the time-line.Fields in javax.time declared as DurationModifier and TypeFieldDescriptionprivate final DurationTimeSource.OffsetSystemTimeSource.offsetThe fixed offset to add.static final DurationDuration.ZEROConstant 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 DurationDuration.between(InstantProvider startInclusive, InstantProvider endExclusive) Obtains an instance ofDurationrepresenting the duration between two instants.private static DurationDuration.create(long seconds, int nanoAdjustment) Obtains an instance ofDurationusing 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 specifiedDurationsubtracted.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 DurationObtains an instance ofDurationfrom a duration in a specified time unit.static DurationDuration.ofMillis(long millis) Obtains an instance ofDurationfrom a number of milliseconds.static DurationDuration.ofNanos(long nanos) Obtains an instance ofDurationfrom a number of nanoseconds.static DurationDuration.ofNanos(BigInteger nanos) Obtains an instance ofDurationfrom a number of nanoseconds.static DurationDuration.ofSeconds(long seconds) Obtains an instance ofDurationfrom a number of seconds.static DurationDuration.ofSeconds(long seconds, long nanoAdjustment) Obtains an instance ofDurationfrom a number of seconds and an adjustment in nanoseconds.static DurationDuration.ofSeconds(BigDecimal seconds) Obtains an instance ofDurationfrom a number of seconds.static DurationDuration.ofStandardDays(long days) Obtains an instance ofDurationfrom a number of standard length days.static DurationDuration.ofStandardHours(long hours) Obtains an instance ofDurationfrom a number of standard length hours.static DurationDuration.ofStandardMinutes(long minutes) Obtains an instance ofDurationfrom a number of standard length minutes.static DurationObtains an instance ofDurationby parsing a string.Returns a copy of this duration with the specified duration added.Returns a copy of this duration with the specifiedDurationadded.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 TypeMethodDescriptionintCompares this duration to the specifiedDuration.booleanDuration.isGreaterThan(Duration otherDuration) Checks if this duration is greater than the specifiedDuration.booleanDuration.isLessThan(Duration otherDuration) Checks if this duration is less than the specifiedDuration.Returns a copy of this duration with the specifiedDurationsubtracted.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 TimeSourceTimeSource.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 specifiedDurationadded.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 DurationModifierConstructorDescriptionprivateOffsetSystemTimeSource(Duration offset) Restricted constructor. -
Uses of Duration in javax.time.calendar
Fields in javax.time.calendar declared as DurationModifier and TypeFieldDescriptionprivate final DurationPeriodUnit.estimatedDurationThe 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 thisLocalDateTimewith the specified duration subtracted.Returns a copy of thisLocalTimewith the specified duration subtracted.Returns a copy of thisOffsetDateTimewith the specified duration subtracted.Returns a copy of thisOffsetTimewith the specified duration subtracted.ZonedDateTime.minusDuration(Duration duration) Returns a copy of thisZonedDateTimewith the specified duration subtracted.static PeriodObtains aPeriodfrom aDuration.static PeriodFieldsObtains aPeriodFieldsfrom aDurationbased on the standard durations of seconds and nanoseconds.Returns a copy of thisLocalDateTimewith the specified duration added.Returns a copy of thisLocalTimewith the specified duration added.Returns a copy of thisOffsetDateTimewith the specified duration added.Returns a copy of thisOffsetTimewith the specified duration added.ZonedDateTime.plusDuration(Duration duration) Returns a copy of thisZonedDateTimewith 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.protectedPeriodUnit(String name, Duration estimatedDuration) Constructor to create a base unit that cannot be derived.privateUnit(int ordinal, String name, PeriodField equivalentPeriod, Duration estimatedDuration)