implicit class TimeNum extends Numeric[TimeNum] with Ordered[TimeNum] with Serializable
The TimeNum
implicit class is used to represent and operate on date-time
numbers. Internally, a date-time number is represented as Instant
.
---------------------------------------------------------------------
- Alphabetic
- By Inheritance
- TimeNum
- Ordered
- Comparable
- Numeric
- Ordering
- PartialOrdering
- Equiv
- Serializable
- Comparator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TimeNum(dt: String, dtPattern: String = DEFAULT_DATETIME_FORMAT)
Construct a
TimeNum
object from the given date-time by creating aZonedDateTime
from the string and converting it to the correspondingInstant
, the underlying type ofTimeNum
class.Construct a
TimeNum
object from the given date-time by creating aZonedDateTime
from the string and converting it to the correspondingInstant
, the underlying type ofTimeNum
class. Format it using 'dtPattern'.- dt
the given date-time as a string
- dtPattern
the given date-time pattern/format
- new TimeNum(dt: ZonedDateTime)
Construct a
TimeNum
object from the given date-time by taking aZonedDateTime
and converting it to the correspondingInstant
, the underlying type ofTimeNum
class.Construct a
TimeNum
object from the given date-time by taking aZonedDateTime
and converting it to the correspondingInstant
, the underlying type ofTimeNum
class.- dt
the given date-time
- new TimeNum(inst: Instant)
- inst
the underlying
Instant
of time
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def !=~(t: TimeNum): Boolean
Return whether two
TimeNum
numbers not are nearly equal.Return whether two
TimeNum
numbers not are nearly equal.- t
compare this with t
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def *(t: TimeNum): TimeNum
Multiply 'this'
TimeNum
andTimeNum
't'.Multiply 'this'
TimeNum
andTimeNum
't'.- t
the TimeNum that multiplies this
- def +(t: TimeNum): TimeNum
Add 'this'
TimeNum
andTimeNum
't'.Add 'this'
TimeNum
andTimeNum
't'. The seconds and nanoseconds are added separately, with carry from nanoseconds handled.- t
the TimeNum to add to this
- def -(t: TimeNum): TimeNum
Subtract TimeNum
't' from 'this'
TimeNum.
Subtract TimeNum
't' from 'this'
TimeNum.
- t
the TimeNum to subtract from this
- def /(t: TimeNum): TimeNum
Divide 'this'
TimeNum
byTimeNum
't'.Divide 'this'
TimeNum
byTimeNum
't'.- t
the TimeNum that divides this
- def <(that: TimeNum): Boolean
- Definition Classes
- Ordered
- def <=(that: TimeNum): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def =~(t: TimeNum): Boolean
Return whether two
TimeNum
numbers are nearly equal.Return whether two
TimeNum
numbers are nearly equal.- t
the TimeNum to compare with this
- def >(that: TimeNum): Boolean
- Definition Classes
- Ordered
- def >=(that: TimeNum): Boolean
- Definition Classes
- Ordered
- def abs(x: TimeNum): TimeNum
- Definition Classes
- Numeric
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def compare(s: TimeNum, t: TimeNum): Int
Compare two 'TimeNum
numbers (negative for <, zero for ==, positive for >).
Compare two 'TimeNum
numbers (negative for <, zero for ==, positive for >).
- s
the first TimeNum number
- t
the second TimeNum number
- Definition Classes
- TimeNum → Ordering → Comparator
- def compare(t: TimeNum): Int
Compare two
TimeNum
numbers (negative for <, zero for ==, positive for >).Compare two
TimeNum
numbers (negative for <, zero for ==, positive for >).- t
the TimeNum number to compare with this
- Definition Classes
- TimeNum → Ordered
- def compareTo(that: TimeNum): Int
- Definition Classes
- Ordered → Comparable
- def divide(s: TimeNum, t: TimeNum): TimeNum
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(t: Any): Boolean
Override equals to determine whether 'this' date-time number equals date-time 't'.
Override equals to determine whether 'this' date-time number equals date-time 't'.
- t
the date-time number to compare with this
- Definition Classes
- TimeNum → Comparator → AnyRef → Any
- def equiv(x: TimeNum, y: TimeNum): Boolean
- Definition Classes
- Ordering → PartialOrdering → Equiv
- def fromDouble(d: Double): TimeNum
Create a
TimeNum
number from aDouble
, where the seconds are extracted from the whole number part and the nanoseconds from the fractional part.Create a
TimeNum
number from aDouble
, where the seconds are extracted from the whole number part and the nanoseconds from the fractional part.- d
the source double
- def fromInt(n: Int): TimeNum
Create a
TimeNum
number from anInt
. - def getChrono(chrono: ChronoField, zone: ZoneId = ZoneOffset.UTC): Long
Get a temporal aspect (e.g., month, week, day, hour, ...)
Get a temporal aspect (e.g., month, week, day, hour, ...)
- chrono
the enumeration type specifying the aspect to return
- See also
docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoField.html Currently only four (INSTANT_SECONDS, MICRO_OF_SECOND, MILLI_OF_SECOND, NANO_OF_SECOND) of the enumeration values are implemented, but ScalaTion adds five more (see below).
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def gt(x: TimeNum, y: TimeNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def gteq(x: TimeNum, y: TimeNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def hashCode(): Int
Must also override hashCode to be compatible with equals.
Must also override hashCode to be compatible with equals.
- Definition Classes
- TimeNum → AnyRef → Any
- def in(set: Set[TimeNum]): Boolean
Determine whether 'this' is in the given set.
- def in(lim: (TimeNum, TimeNum)): Boolean
Determine whether 'this' is within the given bounds
Determine whether 'this' is within the given bounds
- lim
the given (lower, upper) bounds
- val inst: Instant
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isReverseOf(other: Ordering[_]): Boolean
- Definition Classes
- Ordering
- def lt(x: TimeNum, y: TimeNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def lteq(x: TimeNum, y: TimeNum): Boolean
- Definition Classes
- Ordering → PartialOrdering
- def max(t: TimeNum): TimeNum
Return the maximum of 'this' and 't'
TimeNum
numbers.Return the maximum of 'this' and 't'
TimeNum
numbers.- t
the TimeNum number to compare with this
- def max[U <: TimeNum](x: U, y: U): U
- Definition Classes
- Ordering
- def min(t: TimeNum): TimeNum
Return the minimum of 'this' and 't'
TimeNum
numbers.Return the minimum of 'this' and 't'
TimeNum
numbers.- t
the TimeNum number to compare with this
- def min[U <: TimeNum](x: U, y: U): U
- Definition Classes
- Ordering
- def minus(s: TimeNum, t: TimeNum): TimeNum
- Definition Classes
- TimeNum → Numeric
- implicit def mkNumericOps(lhs: TimeNum): NumericOps
- Definition Classes
- Numeric
- implicit def mkOrderingOps(lhs: TimeNum): OrderingOps
- Definition Classes
- Ordering
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def negate(s: TimeNum): TimeNum
- Definition Classes
- TimeNum → Numeric
- def not_in(set: Set[TimeNum]): Boolean
Determine whether 'this' is not in the given set.
- def not_in(lim: (TimeNum, TimeNum)): Boolean
Determine whether 'this' is not within the given bounds
Determine whether 'this' is not within the given bounds
- lim
the given (lower, upper) bounds
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def on[U](f: (U) => TimeNum): Ordering[U]
- Definition Classes
- Ordering
- def one: TimeNum
- Definition Classes
- Numeric
- def orElse(other: Ordering[TimeNum]): Ordering[TimeNum]
- Definition Classes
- Ordering
- def orElseBy[S](f: (TimeNum) => S)(implicit ord: Ordering[S]): Ordering[TimeNum]
- Definition Classes
- Ordering
- def parseString(str: String): Option[TimeNum]
Parse the string to create a time number.
Parse the string to create a time number.
- Definition Classes
- TimeNum → Numeric
- def plus(s: TimeNum, t: TimeNum): TimeNum
- Definition Classes
- TimeNum → Numeric
- def reverse: Ordering[TimeNum]
- Definition Classes
- Ordering → PartialOrdering
- def reversed(): Comparator[TimeNum]
- Definition Classes
- Comparator
- def sign(x: TimeNum): TimeNum
- Definition Classes
- Numeric
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thenComparing[U <: Comparable[_ >: U <: AnyRef]](arg0: Function[_ >: TimeNum <: AnyRef, _ <: U]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def thenComparing[U <: AnyRef](arg0: Function[_ >: TimeNum <: AnyRef, _ <: U], arg1: Comparator[_ >: U <: AnyRef]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def thenComparing(arg0: Comparator[_ >: TimeNum <: AnyRef]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def thenComparingDouble(arg0: ToDoubleFunction[_ >: TimeNum <: AnyRef]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def thenComparingInt(arg0: ToIntFunction[_ >: TimeNum <: AnyRef]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def thenComparingLong(arg0: ToLongFunction[_ >: TimeNum <: AnyRef]): Comparator[TimeNum]
- Definition Classes
- Comparator
- def times(s: TimeNum, t: TimeNum): TimeNum
- Definition Classes
- TimeNum → Numeric
- def toDouble: Double
- def toDouble(t: TimeNum): Double
Convert the given
TimeNum
number to aDouble
.Convert the given
TimeNum
number to aDouble
.- t
that date-time number to convert
- Definition Classes
- TimeNum → Numeric
- def toFloat: Float
- def toFloat(t: TimeNum): Float
Convert 'this'
TimeNum
number to aFloat
.Convert 'this'
TimeNum
number to aFloat
.- t
that date-time number to convert
- Definition Classes
- TimeNum → Numeric
- def toInt: Int
- def toInt(t: TimeNum): Int
Convert 'this'
TimeNum
number to anInt
.Convert 'this'
TimeNum
number to anInt
.- t
that date-time number to convert
- Definition Classes
- TimeNum → Numeric
- def toLong: Long
- def toLong(t: TimeNum): Long
Convert 'this'
TimeNum
number to aLong
.Convert 'this'
TimeNum
number to aLong
.- t
that date-time number to convert
- Definition Classes
- TimeNum → Numeric
- def toString(): String
Convert 'this' date-time number to a String.
Convert 'this' date-time number to a String.
- Definition Classes
- TimeNum → AnyRef → Any
- def toString2(format: String = DEFAULT_DATETIME_FORMAT): String
Convert 'this' date time number to a String in the format specified by the user, use 'DEFAULT_DATETIME_FORMAT' if user does not specify any format.
Convert 'this' date time number to a String in the format specified by the user, use 'DEFAULT_DATETIME_FORMAT' if user does not specify any format.
- format
the format to be used
- def toTimeNum: TimeNum
Convert 'this' date-time number to a
TimeNum
. - def tryCompare(x: TimeNum, y: TimeNum): Some[Int]
- Definition Classes
- Ordering → PartialOrdering
- def unary_-: TimeNum
Compute the unary minus (-).
- lazy val val1: Long
General alias for the parts of a time number
- lazy val val2: Int
General alias for the parts of a time number
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def zero: TimeNum
- Definition Classes
- Numeric
- def ~^(t: TimeNum): TimeNum
Raise 'this'
TimeNum
to powerTimeNum
't'.Raise 'this'
TimeNum
to powerTimeNum
't'.- t
the TimeNum that raises this
- def ↑(t: TimeNum): TimeNum
- def ∈(set: Set[TimeNum]): Boolean
- def ∈(lim: (TimeNum, TimeNum)): Boolean
- def ∉(set: Set[TimeNum]): Boolean
- def ∉(lim: (TimeNum, TimeNum)): Boolean
- def ≈(t: TimeNum): Boolean
- def ≉(t: TimeNum): Boolean
- def ≠(t: TimeNum): Boolean
Compare 'this'
TimeNum
number with that date-time number 't' for inequality.Compare 'this'
TimeNum
number with that date-time number 't' for inequality.- t
that TimeNum number
- def ≤(t: TimeNum): Boolean
Compare 'this'
TimeNum
number with that date-time number 't' for less than or equal to.Compare 'this'
TimeNum
number with that date-time number 't' for less than or equal to.- t
that TimeNum number
- def ≥(t: TimeNum): Boolean
Compare 'this'
TimeNum
number with that date-time number 't' for greater than or equal to.Compare 'this'
TimeNum
number with that date-time number 't' for greater than or equal to.- t
that TimeNum number