scala.concurrent.duration

Duration

object Duration extends Serializable

Linear Supertypes
Serializable, java.io.Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Duration
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class Infinite extends Duration

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. implicit object DurationIsOrdered extends Ordering[Duration]

    The natural ordering of durations matches the natural ordering for Double, including non-finite values.

  7. val Inf: Infinite

    Infinite duration: greater than any other (apart from Undefined) and not equal to any other but itself.

    Infinite duration: greater than any other (apart from Undefined) and not equal to any other but itself. This value closely corresponds to Double.PositiveInfinity, matching its semantics in arithmetic operations.

  8. val MinusInf: Infinite

    Infinite duration: less than any other and not equal to any other but itself.

    Infinite duration: less than any other and not equal to any other but itself. This value closely corresponds to Double.NegativeInfinity, matching its semantics in arithmetic operations.

  9. val Undefined: Infinite

    The Undefined value corresponds closely to Double.

    The Undefined value corresponds closely to Double.NaN:

    • it is the result of otherwise invalid operations
    • it does not equal itself (according to equals())
    • it compares greater than any other Duration apart from itself (for which compare returns 0)

    The particular comparison semantics mirror those of Double.NaN.

    Use eq when checking an input of a method against this value.

  10. val Zero: FiniteDuration

    Preconstructed value of 0.days.

  11. def apply(s: String): Duration

    Parse String into Duration.

    Parse String into Duration. Format is "<length><unit>", where whitespace is allowed before, between and after the parts. Infinities are designated by "Inf", "PlusInf", "+Inf" and "-Inf" or "MinusInf".

    Exceptions thrown
    NumberFormatException

    if format is not parseable

  12. def apply(length: Long, unit: String): FiniteDuration

    Construct a finite duration from the given length and time unit, where the latter is looked up in a list of string representation.

    Construct a finite duration from the given length and time unit, where the latter is looked up in a list of string representation. Valid choices are:

    d, day, h, hour, min, minute, s, sec, second, ms, milli, millisecond, µs, micro, microsecond, ns, nano, nanosecond and their pluralized forms (for every but the first mentioned form of each unit, i.e. no "ds", but "days").

  13. def apply(length: Long, unit: TimeUnit): FiniteDuration

    Construct a finite duration from the given length and time unit.

    Construct a finite duration from the given length and time unit. The unit given is retained throughout calculations as long as possible, so that it can be retrieved later.

  14. def apply(length: Double, unit: TimeUnit): Duration

    Construct a Duration from the given length and unit.

    Construct a Duration from the given length and unit. Observe that nanosecond precision may be lost if

    • the unit is NANOSECONDS
    • and the length has an absolute value greater than 2^53

    Infinite inputs (and NaN) are converted into Duration.Inf, Duration.MinusInf and Duration.Undefined, respectively.

    Exceptions thrown
    IllegalArgumentException

    if the length was finite but the resulting duration cannot be expressed as a FiniteDuration

  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def create(s: String): Duration

    Parse String into Duration.

    Parse String into Duration. Format is "<length><unit>", where whitespace is allowed before, between and after the parts. Infinities are designated by "Inf", "PlusInf", "+Inf" and "-Inf" or "MinusInf".

    Exceptions thrown
    NumberFormatException

    if format is not parseable

  18. def create(length: Long, unit: String): FiniteDuration

    Construct a finite duration from the given length and time unit, where the latter is looked up in a list of string representation.

    Construct a finite duration from the given length and time unit, where the latter is looked up in a list of string representation. Valid choices are:

    d, day, h, hour, min, minute, s, sec, second, ms, milli, millisecond, µs, micro, microsecond, ns, nano, nanosecond and their pluralized forms (for every but the first mentioned form of each unit, i.e. no "ds", but "days").

  19. def create(length: Double, unit: TimeUnit): Duration

    Construct a Duration from the given length and unit.

    Construct a Duration from the given length and unit. Observe that nanosecond precision may be lost if

    • the unit is NANOSECONDS
    • and the length has an absolute value greater than 2^53

    Infinite inputs (and NaN) are converted into Duration.Inf, Duration.MinusInf and Duration.Undefined, respectively.

    Exceptions thrown
    IllegalArgumentException

    if the length was finite but the resulting duration cannot be expressed as a FiniteDuration

  20. def create(length: Long, unit: TimeUnit): FiniteDuration

    Construct a finite duration from the given length and time unit.

    Construct a finite duration from the given length and time unit. The unit given is retained throughout calculations as long as possible, so that it can be retrieved later.

  21. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def fromNanos(nanos: Long): FiniteDuration

    Construct a finite duration from the given number of nanoseconds.

    Construct a finite duration from the given number of nanoseconds. The result will have the coarsest possible time unit which can exactly express this duration.

    Exceptions thrown
    IllegalArgumentException

    for Long.MinValue since that would lead to inconsistent behavior afterwards (cannot be negated)

  25. def fromNanos(nanos: Double): Duration

    Construct a possibly infinite or undefined Duration from the given number of nanoseconds.

    Construct a possibly infinite or undefined Duration from the given number of nanoseconds.

    The semantics of the resulting Duration objects matches the semantics of their Double counterparts with respect to arithmetic operations.

    Exceptions thrown
    IllegalArgumentException

    if the length was finite but the resulting duration cannot be expressed as a FiniteDuration

  26. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. val timeUnit: Map[String, TimeUnit]

    Attributes
    protected[scala.concurrent.duration]
  34. val timeUnitName: Map[TimeUnit, String]

    Attributes
    protected[scala.concurrent.duration]
  35. def toString(): String

    Definition Classes
    AnyRef → Any
  36. def unapply(d: Duration): Option[(Long, TimeUnit)]

    Extract length and time unit out of a duration, if it is finite.

  37. def unapply(s: String): Option[(Long, TimeUnit)]

    Extract length and time unit out of a string, where the format must match the description for apply(String).

    Extract length and time unit out of a string, where the format must match the description for apply(String). The extractor will not match for malformed strings or non-finite durations.

  38. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from java.io.Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped