trait TimeLike[This <: TimeLike[This]] extends Ordered[This]
A common trait for time-like values. It requires a companion
TimeLikeOps
module. TimeLike
s are finite, but they must always
have two sentinels: Top
and Bottom
. These act like positive
and negative infinities: Arithmetic involving them preserves their
values, and so on.
TimeLike
s are Long
-valued nanoseconds, but have different
interpretations: Duration
s measure the number of nanoseconds
between two points in time, while Time
measure the number of
nanoseconds since the Unix epoch (1 January 1970 00:00:00 UTC).
TimeLike behave like boxed java Double values with respect
to infinity and undefined values. In particular, this means that a
TimeLike
's Undefined
value is comparable to other values. In
turn this means it can be used as keys in maps, etc.
Overflows are also handled like doubles.
- Self Type
- This
- Alphabetic
- By Inheritance
- TimeLike
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(delta: Duration): This
Adds
delta
to thisTimeLike
.Adds
delta
to thisTimeLike
. AddingDuration.Top
results in theTimeLike
'sTop
, addingDuration.Bottom
results in theTimeLike
'sBottom
. - def -(delta: Duration): This
- def <(that: This): Boolean
- Definition Classes
- Ordered
- def <=(that: This): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: This): Boolean
- Definition Classes
- Ordered
- def >=(that: This): Boolean
- Definition Classes
- Ordered
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ceil(increment: Duration): This
Rounds up to the nearest multiple of the given duration.
Rounds up to the nearest multiple of the given duration. For example: 127.seconds.ceiling(1.minute) => 3.minutes. Taking the ceiling of a Time object with duration greater than 1.hour can have unexpected results because of timezones.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compare(that: This): Int
- Definition Classes
- TimeLike → Ordered
- def compareTo(that: This): Int
- Definition Classes
- Ordered → Comparable
- 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 floor(increment: Duration): This
Rounds down to the nearest multiple of the given duration.
Rounds down to the nearest multiple of the given duration. For example: 127.seconds.floor(1.minute) => 2.minutes. Taking the floor of a Time object with duration greater than 1.hour can have unexpected results because of timezones.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def inDays: Int
- def inHours: Int
- def inLongSeconds: Long
- def inMicroseconds: Long
- def inMillis: Long
- def inMilliseconds: Long
- def inMinutes: Int
- def inSeconds: Int
- def inTimeUnit: (Long, TimeUnit)
Returns a value/
TimeUnit
pair; attempting to return coarser grained values if possible (specifically:TimeUnit.MINUTES
,TimeUnit.SECONDS
orTimeUnit.MILLISECONDS
) before resorting to the defaultTimeUnit.NANOSECONDS
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isZero: Boolean
Is this a finite TimeLike value and equals 0
- def max(that: This): This
- def min(that: This): This
- def moreOrLessEquals(other: This, maxDelta: Duration): Boolean
Equality within
maxDelta
- 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()
- 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()