object Duration extends TimeLikeOps[Duration] with Serializable
- Alphabetic
- By Inheritance
- Duration
- Serializable
- TimeLikeOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val Bottom: Duration
Duration
Bottom
is smaller than any other duration, except for itself.Duration
Bottom
is smaller than any other duration, except for itself.Bottom
's complement isTop
.- Definition Classes
- Duration → TimeLikeOps
- val NanosPerDay: Long
- val NanosPerHour: Long
- val NanosPerMicrosecond: Long
- val NanosPerMillisecond: Long
- val NanosPerMinute: Long
- val NanosPerSecond: Long
- val Top: Duration
Duration
Top
is greater than any other duration, except for itself.Duration
Top
is greater than any other duration, except for itself.Top
's complement isBottom
.- Definition Classes
- Duration → TimeLikeOps
- val Undefined: Duration
An undefined value: behaves like
Double.NaN
An undefined value: behaves like
Double.NaN
- Definition Classes
- Duration → TimeLikeOps
- val Zero: Duration
The zero value
The zero value
- Definition Classes
- Duration → TimeLikeOps
- def apply(value: Long, unit: TimeUnit): Duration
Create a duration from a
java.util.concurrent.TimeUnit
. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromDays(days: Int): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromFractionalSeconds(seconds: Double): Duration
Make a new
This
from the given number of seconds.Make a new
This
from the given number of seconds. Because this method takes a Double, it can represent values less than a second. Note however that there is some slop in floating-point conversion that limits precision. Currently we can assume at least microsecond precision.- Definition Classes
- Duration → TimeLikeOps
- def fromHours(hours: Int): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromJava(value: java.time.Duration): Duration
Create a duration from a java.time.Duration.
- def fromMicroseconds(micros: Long): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromMilliseconds(millis: Long): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromMinutes(minutes: Int): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromNanoseconds(nanoseconds: Long): Duration
Make a new
This
from the given number of nanosecondsMake a new
This
from the given number of nanoseconds- Definition Classes
- Duration → TimeLikeOps
- def fromSeconds(seconds: Int): Duration
- Definition Classes
- Duration → TimeLikeOps
- def fromTimeUnit(value: Long, unit: TimeUnit): Duration
Create a duration from a
java.util.concurrent.TimeUnit
.Create a duration from a
java.util.concurrent.TimeUnit
. Synonym for apply. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parse(s: String): Duration
Parse a String representation of a duration.
Parse a String representation of a duration. This method will parse any duration generated by Duration.toString.
The format is either one of the special values, or non-empty sequence of durations. Each duration is a sign, an integer, a dot, and a unit. The unit may be plural or singular. The parser will ignore whitespace around signs and at the beginning and end. (That is, it accepts "1.second + 1.minute" and " 1.second ".) It's permissible to omit the sign before the first duration.
The special values are "Duration.Top", "Duration.Bottom" and "Duration.Undefined".
The parser is case-insensitive.
- Note
Throws
RuntimeException
if the string cannot be parsed.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object Finite
An extractor for finite TimeLikes; eg.:
An extractor for finite TimeLikes; eg.:
duration match { case Duration.Finite(d) => ... case Duration.Top => ..
- Definition Classes
- TimeLikeOps
- object Nanoseconds
An extractor for finite
This
, yielding its value in nanoseconds.An extractor for finite
This
, yielding its value in nanoseconds.duration match { case Duration.Nanoseconds(ns) => ... case Duration.Top => ... }
- Definition Classes
- TimeLikeOps