Uses of Class
javax.time.Duration
-
Packages that use Duration Package Description javax.time Provides classes to manage the continuous time scale including a wrapper for the system clock.javax.time.calendar 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 Duration Modifier and Type Field Description private DurationTimeSource.OffsetSystemTimeSource. offsetThe fixed offset to add.static DurationDuration. ZEROConstant for a duration of zero.Methods in javax.time that return Duration Modifier and Type Method Description DurationDuration. 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.DurationDuration. dividedBy(long divisor)Returns a copy of this duration divided by the specified value.DurationTAIInstant. durationUntil(TAIInstant taiInstant)Returns the duration between this instant and the specified instant.DurationUTCInstant. durationUntil(UTCInstant utcInstant)Returns the duration between this instant and the specified instant.DurationDuration. minus(long amount, java.util.concurrent.TimeUnit unit)Returns a copy of this duration with the specified duration subtracted.DurationDuration. minus(Duration duration)Returns a copy of this duration with the specifiedDurationsubtracted.DurationDuration. minusMillis(long millisToSubtract)Returns a copy of this duration with the specified number of milliseconds subtracted.DurationDuration. minusNanos(long nanosToSubtract)Returns a copy of this duration with the specified number of nanoseconds subtracted.DurationDuration. minusSeconds(long secondsToSubtract)Returns a copy of this duration with the specified number of seconds subtracted.DurationDuration. multipliedBy(long multiplicand)Returns a copy of this duration multiplied by the scalar.DurationDuration. negated()Returns a copy of this duration with the length negated.static DurationDuration. of(long amount, java.util.concurrent.TimeUnit unit)Obtains 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(java.math.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(java.math.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 DurationDuration. parse(java.lang.String text)Obtains an instance ofDurationby parsing a string.DurationDuration. plus(long amount, java.util.concurrent.TimeUnit unit)Returns a copy of this duration with the specified duration added.DurationDuration. plus(Duration duration)Returns a copy of this duration with the specifiedDurationadded.DurationDuration. plusMillis(long millisToAdd)Returns a copy of this duration with the specified number of milliseconds added.DurationDuration. plusNanos(long nanosToAdd)Returns a copy of this duration with the specified number of nanoseconds added.DurationDuration. 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 intDuration. compareTo(Duration otherDuration)Compares 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.DurationDuration. minus(Duration duration)Returns a copy of this duration with the specifiedDurationsubtracted.InstantInstant. minus(Duration duration)Returns a copy of this instant with the specified duration subtracted.TAIInstantTAIInstant. minus(Duration duration)Returns a copy of this instant with the specified duration subtracted.UTCInstantUTCInstant. minus(Duration duration)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.DurationDuration. plus(Duration duration)Returns a copy of this duration with the specifiedDurationadded.InstantInstant. plus(Duration duration)Returns a copy of this instant with the specified duration added.TAIInstantTAIInstant. plus(Duration duration)Returns a copy of this instant with the specified duration added.UTCInstantUTCInstant. plus(Duration duration)Returns a copy of this instant with the specified duration added.Constructors in javax.time with parameters of type Duration Constructor Description OffsetSystemTimeSource(Duration offset)Restricted constructor. -
Uses of Duration in javax.time.calendar
Fields in javax.time.calendar declared as Duration Modifier and Type Field Description private DurationPeriodUnit. estimatedDurationThe estimated duration of the unit, not null.Methods in javax.time.calendar that return Duration Modifier and Type Method Description DurationPeriodUnit. getEstimatedDuration()Gets an estimate of the duration of the unit in seconds.DurationPeriod. toDuration()Calculates the accurate duration of this period.DurationPeriodField. toDuration()Calculates the accurate duration of this period.DurationPeriodFields. toDuration()Calculates the accurate duration of this period.DurationPeriod. toDurationWith24HourDays()Calculates the accurate duration of this period.DurationPeriod. toEstimatedDuration()Estimates the duration of this period.DurationPeriodField. toEstimatedDuration()Estimates the duration of this period.DurationPeriodFields. toEstimatedDuration()Estimates the duration of this period.Methods in javax.time.calendar with parameters of type Duration Modifier and Type Method Description LocalDateTimeLocalDateTime. minus(Duration duration)Returns a copy of thisLocalDateTimewith the specified duration subtracted.LocalTimeLocalTime. minus(Duration duration)Returns a copy of thisLocalTimewith the specified duration subtracted.OffsetDateTimeOffsetDateTime. minus(Duration duration)Returns a copy of thisOffsetDateTimewith the specified duration subtracted.OffsetTimeOffsetTime. minus(Duration duration)Returns a copy of thisOffsetTimewith the specified duration subtracted.ZonedDateTimeZonedDateTime. minusDuration(Duration duration)Returns a copy of thisZonedDateTimewith the specified duration subtracted.static PeriodPeriod. of(Duration duration)Obtains aPeriodfrom aDuration.static PeriodFieldsPeriodFields. of(Duration duration)Obtains aPeriodFieldsfrom aDurationbased on the standard durations of seconds and nanoseconds.LocalDateTimeLocalDateTime. plus(Duration duration)Returns a copy of thisLocalDateTimewith the specified duration added.LocalTimeLocalTime. plus(Duration duration)Returns a copy of thisLocalTimewith the specified duration added.OffsetDateTimeOffsetDateTime. plus(Duration duration)Returns a copy of thisOffsetDateTimewith the specified duration added.OffsetTimeOffsetTime. plus(Duration duration)Returns a copy of thisOffsetTimewith the specified duration added.ZonedDateTimeZonedDateTime. plusDuration(Duration duration)Returns a copy of thisZonedDateTimewith the specified duration added.Constructors in javax.time.calendar with parameters of type Duration Constructor Description PeriodUnit(java.lang.String name, PeriodField equivalentPeriod, Duration estimatedDuration)Constructor used by ISOChronology.PeriodUnit(java.lang.String name, Duration estimatedDuration)Constructor to create a base unit that cannot be derived.Unit(int ordinal, java.lang.String name, PeriodField equivalentPeriod, Duration estimatedDuration)
-