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 static Duration
Duration. ZERO
Constant for a duration of zero.Methods in javax.time that return Duration Modifier and Type Method Description Duration
Duration. 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.Duration
Duration. dividedBy(long divisor)
Returns a copy of this duration divided by the specified value.Duration
TAIInstant. durationUntil(TAIInstant taiInstant)
Returns the duration between this instant and the specified instant.Duration
UTCInstant. durationUntil(UTCInstant utcInstant)
Returns the duration between this instant and the specified instant.Duration
Duration. minus(long amount, TimeUnit unit)
Returns a copy of this duration with the specified duration subtracted.Duration
Duration. minus(Duration duration)
Returns a copy of this duration with the specifiedDuration
subtracted.Duration
Duration. minusMillis(long millisToSubtract)
Returns a copy of this duration with the specified number of milliseconds subtracted.Duration
Duration. minusNanos(long nanosToSubtract)
Returns a copy of this duration with the specified number of nanoseconds subtracted.Duration
Duration. minusSeconds(long secondsToSubtract)
Returns a copy of this duration with the specified number of seconds subtracted.Duration
Duration. multipliedBy(long multiplicand)
Returns a copy of this duration multiplied by the scalar.Duration
Duration. negated()
Returns a copy of this duration with the length negated.static Duration
Duration. of(long amount, TimeUnit unit)
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
Duration. parse(String text)
Obtains an instance ofDuration
by parsing a string.Duration
Duration. plus(long amount, TimeUnit unit)
Returns a copy of this duration with the specified duration added.Duration
Duration. plus(Duration duration)
Returns a copy of this duration with the specifiedDuration
added.Duration
Duration. plusMillis(long millisToAdd)
Returns a copy of this duration with the specified number of milliseconds added.Duration
Duration. plusNanos(long nanosToAdd)
Returns a copy of this duration with the specified number of nanoseconds added.Duration
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 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
.Duration
Duration. minus(Duration duration)
Returns a copy of this duration with the specifiedDuration
subtracted.Instant
Instant. minus(Duration duration)
Returns a copy of this instant with the specified duration subtracted.TAIInstant
TAIInstant. minus(Duration duration)
Returns a copy of this instant with the specified duration subtracted.UTCInstant
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
Duration. plus(Duration duration)
Returns a copy of this duration with the specifiedDuration
added.Instant
Instant. plus(Duration duration)
Returns a copy of this instant with the specified duration added.TAIInstant
TAIInstant. plus(Duration duration)
Returns a copy of this instant with the specified duration added.UTCInstant
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 Duration
PeriodUnit. getEstimatedDuration()
Gets an estimate of the duration of the unit in seconds.Duration
Period. toDuration()
Calculates the accurate duration of this period.Duration
PeriodField. toDuration()
Calculates the accurate duration of this period.Duration
PeriodFields. toDuration()
Calculates the accurate duration of this period.Duration
Period. toDurationWith24HourDays()
Calculates the accurate duration of this period.Duration
Period. toEstimatedDuration()
Estimates the duration of this period.Duration
PeriodField. toEstimatedDuration()
Estimates the duration of this period.Duration
PeriodFields. toEstimatedDuration()
Estimates the duration of this period.Methods in javax.time.calendar with parameters of type Duration Modifier and Type Method Description LocalDateTime
LocalDateTime. minus(Duration duration)
Returns a copy of thisLocalDateTime
with the specified duration subtracted.LocalTime
LocalTime. minus(Duration duration)
Returns a copy of thisLocalTime
with the specified duration subtracted.OffsetDateTime
OffsetDateTime. minus(Duration duration)
Returns a copy of thisOffsetDateTime
with the specified duration subtracted.OffsetTime
OffsetTime. minus(Duration duration)
Returns a copy of thisOffsetTime
with the specified duration subtracted.ZonedDateTime
ZonedDateTime. minusDuration(Duration duration)
Returns a copy of thisZonedDateTime
with the specified duration subtracted.static Period
Period. of(Duration duration)
Obtains aPeriod
from aDuration
.static PeriodFields
PeriodFields. of(Duration duration)
Obtains aPeriodFields
from aDuration
based on the standard durations of seconds and nanoseconds.LocalDateTime
LocalDateTime. plus(Duration duration)
Returns a copy of thisLocalDateTime
with the specified duration added.LocalTime
LocalTime. plus(Duration duration)
Returns a copy of thisLocalTime
with the specified duration added.OffsetDateTime
OffsetDateTime. plus(Duration duration)
Returns a copy of thisOffsetDateTime
with the specified duration added.OffsetTime
OffsetTime. plus(Duration duration)
Returns a copy of thisOffsetTime
with the specified duration added.ZonedDateTime
ZonedDateTime. plusDuration(Duration duration)
Returns a copy of thisZonedDateTime
with the specified duration added.Constructors in javax.time.calendar with parameters of type Duration Constructor Description PeriodUnit(String name, Duration estimatedDuration)
Constructor to create a base unit that cannot be derived.
-