sealed trait Duration extends Ordered[Duration] with Serializable with Product
Non-negative duration.
Operations that would result in negative value of nanoseconds return zero duration
and ones that would result in Long.MaxValue
overflow return infinity.
Infinity
has Long.MaxValue
nanoseconds value, but for arithmetic operations behaviour is
mathematical infinity like-ish.
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Duration
- Product
- Equals
- Serializable
- Serializable
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Abstract Value Members
-
abstract
def
*(factor: Double): Duration
Multiplies by factor, when nanoseconds overflow
Long.MaxValue
returnsInfinity
, if factor is negative returnsDuration.Zero
. -
abstract
def
+(other: Duration): Duration
Adds other
Duration
.Adds other
Duration
. When nanoseconds overflowLong.MaxValue
returnsInfinity
. -
abstract
def
asJava: java.time.Duration
The
java.time.Duration
returned for an infinite Duration is technically "only" ~2x10^16 hours long (Long.MaxValue
number of seconds) - abstract def asScala: scala.concurrent.duration.Duration
-
abstract
def
canEqual(that: Any): Boolean
- Definition Classes
- Equals
-
abstract
def
compare(that: Duration): Int
- Definition Classes
- Ordered
-
abstract
def
isZero: Boolean
Whether this is a zero duration
-
abstract
def
productArity: Int
- Definition Classes
- Product
-
abstract
def
productElement(n: Int): Any
- Definition Classes
- Product
-
abstract
def
toMillis: Long
Number of milliseconds.
-
abstract
def
toNanos: Long
Number of nanoseconds.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
<(that: Duration): Boolean
- Definition Classes
- Ordered
-
def
<=(that: Duration): Boolean
- Definition Classes
- Ordered
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
>(that: Duration): Boolean
- Definition Classes
- Ordered
-
def
>=(that: Duration): Boolean
- Definition Classes
- Ordered
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
compareTo(that: Duration): Int
- Definition Classes
- Ordered → Comparable
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- final def fold[Z](infinity: ⇒ Z, finite: (Finite) ⇒ Z): Z
-
final
def
getClass(): Class[_]
- 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 max(other: Duration): Duration
- final def min(other: Duration): Duration
-
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
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
-
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( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )