Trait

com.twitter.util

TimeLike

Related Doc: package util

Permalink

trait TimeLike[This <: TimeLike[This]] extends Ordered[This]

A common trait for time-like values. It requires a companion TimeLikeOps module. TimeLikes 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.

TimeLikes are Long-valued nanoseconds, but have different interpretations: Durations 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
Linear Supertypes
Ordered[This], Comparable[This], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeLike
  2. Ordered
  3. Comparable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def diff(that: This): Duration

    Permalink

    The difference between the two TimeLikes

  2. abstract def inNanoseconds: Long

    Permalink

    The TimeLike's value in nanoseconds.

  3. abstract def isFinite: Boolean

    Permalink

    Is this a finite TimeLike value?

  4. abstract val ops: TimeLikeOps[This]

    Permalink
    Attributes
    protected

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(delta: Duration): This

    Permalink

    Adds delta to this TimeLike.

    Adds delta to this TimeLike. Adding Duration.Top results in the TimeLike's Top, adding Duration.Bottom results in the TimeLike's Bottom.

  4. def -(delta: Duration): This

    Permalink
  5. def <(that: This): Boolean

    Permalink
    Definition Classes
    Ordered
  6. def <=(that: This): Boolean

    Permalink
    Definition Classes
    Ordered
  7. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def >(that: This): Boolean

    Permalink
    Definition Classes
    Ordered
  9. def >=(that: This): Boolean

    Permalink
    Definition Classes
    Ordered
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def ceil(increment: Duration): This

    Permalink

    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.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def compare(that: This): Int

    Permalink
    Definition Classes
    TimeLike → Ordered
  14. def compareTo(that: This): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  15. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def floor(increment: Duration): This

    Permalink

    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.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def inDays: Int

    Permalink
  22. def inHours: Int

    Permalink
  23. def inLongSeconds: Long

    Permalink
  24. def inMicroseconds: Long

    Permalink
  25. def inMillis: Long

    Permalink
  26. def inMilliseconds: Long

    Permalink
  27. def inMinutes: Int

    Permalink
  28. def inSeconds: Int

    Permalink
  29. def inTimeUnit: (Long, TimeUnit)

    Permalink

    Returns a value/TimeUnit pair; attempting to return coarser grained values if possible (specifically: TimeUnit.SECONDS or TimeUnit.MILLISECONDS) before resorting to the default TimeUnit.NANOSECONDS.

  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. def isZero: Boolean

    Permalink

    Is this a finite TimeLike value and equals 0

  32. def max(that: This): This

    Permalink
  33. def min(that: This): This

    Permalink
  34. def moreOrLessEquals(other: This, maxDelta: Duration): Boolean

    Permalink

    Equality within maxDelta

  35. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Ordered[This]

Inherited from Comparable[This]

Inherited from AnyRef

Inherited from Any

Ungrouped