TimeNum

scalation.TimeNum
See theTimeNum companion object
class TimeNum(val inst: Instant) extends Numeric[TimeNum], Ordered[TimeNum], Serializable

The TimeNum class is used to represent and operate on date-time numbers. Internally, a date-time number is represented as an Instant.

Value parameters

inst

the underlying Instant of time

Attributes

Companion
object
Graph
Supertypes
trait Ordered[TimeNum]
trait Comparable[TimeNum]
trait Numeric[TimeNum]
trait Ordering[TimeNum]
trait PartialOrdering[TimeNum]
trait Equiv[TimeNum]
trait Serializable
trait Comparator[TimeNum]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited classlikes

class NumericOps(lhs: T)

Attributes

Inherited from:
Numeric
Supertypes
class Object
trait Matchable
class Any
class OrderingOps(lhs: T)

Attributes

Inherited from:
Ordering
Supertypes
class Object
trait Matchable
class Any

Value members

Constructors

def this(dt: ZonedDateTime)

Construct a TimeNum object from the given date-time by taking a ZonedDateTime and converting it to the corresponding Instant, the underlying type of TimeNum class.

Construct a TimeNum object from the given date-time by taking a ZonedDateTime and converting it to the corresponding Instant, the underlying type of TimeNum class.

Value parameters

dt

the given date-time

Attributes

def this(dt: String, dtPattern: String)

Construct a TimeNum object from the given date-time by creating a ZonedDateTime from the string and converting it to the corresponding Instant, the underlying type of TimeNum class. Format it using dtPattern.

Construct a TimeNum object from the given date-time by creating a ZonedDateTime from the string and converting it to the corresponding Instant, the underlying type of TimeNum class. Format it using dtPattern.

Value parameters

dt

the given date-time as a string

dtPattern

the given date-time pattern/format

Attributes

Concrete methods

def !=~(t: TimeNum): Boolean

Return whether two TimeNum numbers not are nearly equal.

Return whether two TimeNum numbers not are nearly equal.

Value parameters

t

compare this with t

Attributes

inline def *(t: TimeNum): TimeNum
inline def *(tl: Long): TimeNum
inline def +(t: TimeNum): TimeNum
inline def +(tl: Long): TimeNum
inline def -(t: TimeNum): TimeNum
inline def -(tl: Long): TimeNum
inline def /(t: TimeNum): TimeNum
def =~(t: TimeNum): Boolean

Return whether two TimeNum numbers are nearly equal.

Return whether two TimeNum numbers are nearly equal.

Value parameters

t

the TimeNum to compare with this

Attributes

infix 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 >).

Value parameters

t

the TimeNum number to compare with this

Attributes

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 >).

Value parameters

s

the first TimeNum number

t

the second TimeNum number

Attributes

def divide(s: TimeNum, t: TimeNum): TimeNum

Divide this TimeNum by TimeNum t.

Divide this TimeNum by TimeNum t.

Value parameters

t

the TimeNum that divides this

Attributes

infix override 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.

Value parameters

t

the date-time number to compare with this

Attributes

Definition Classes
Comparator -> Any
def fromDouble(d: Double): TimeNum
def fromInt(i: Int): TimeNum
def getChrono(chrono: ChronoField, zone: ZoneId): Long

Get a temporal aspect (e.g., month, week, day, hour, ...).

Get a temporal aspect (e.g., month, week, day, hour, ...).

Value parameters

chrono

the enumeration type specifying the aspect to return

Attributes

See also

https://docs.oracle.com/en/java/javase/17/docs/api//java.base/java/time/ZonedDateTime.html Currently only four (INSTANT_SECONDS, MICRO_OF_SECOND, MILLI_OF_SECOND, NANO_OF_SECOND) of the enumeration values are implemented, but ScalaTion adds seven more (see below).

override def hashCode: Int

Must also override hashCode to be compatible with equals.

Must also override hashCode to be compatible with equals.

Attributes

Definition Classes
Any
def in(lim: (TimeNum, TimeNum)): Boolean

Determine whether this is within the given bounds

Determine whether this is within the given bounds

Value parameters

lim

the given (lower, upper) bounds

Attributes

def in(set: Set[TimeNum]): Boolean

Determine whether this is in the given set.

Determine whether this is in the given set.

Value parameters

lim

the given set of values

Attributes

def max(t: TimeNum): TimeNum

Return the maximum of this and t TimeNum numbers.

Return the maximum of this and t TimeNum numbers.

Value parameters

t

the TimeNum number to compare with this

Attributes

def min(t: TimeNum): TimeNum

Return the minimum of this and t TimeNum numbers.

Return the minimum of this and t TimeNum numbers.

Value parameters

t

the TimeNum number to compare with this

Attributes

def minus(s: TimeNum, t: TimeNum): TimeNum

Subtract TimeNumt from thisTimeNum`.

Subtract TimeNumt from thisTimeNum`.

Value parameters

t

the TimeNum to subtract from this

Attributes

Compute the unary minus (-).

Compute the unary minus (-).

Attributes

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

Value parameters

lim

the given (lower, upper) bounds

Attributes

def not_in(set: Set[TimeNum]): Boolean

Determine whether this is not in the given set.

Determine whether this is not in the given set.

Value parameters

lim

the given set of values

Attributes

def parseString(str: String): Option[TimeNum]

Parse the string to create a time number.

Parse the string to create a time number.

Attributes

def plus(s: TimeNum, t: TimeNum): TimeNum

Add this TimeNum and TimeNum t. The seconds and nanoseconds are added separately, with carry from nanoseconds handled.

Add this TimeNum and TimeNum t. The seconds and nanoseconds are added separately, with carry from nanoseconds handled.

Value parameters

t

the TimeNum to add to this

Attributes

def times(s: TimeNum, t: TimeNum): TimeNum

Multiply this TimeNum and TimeNum t.

Multiply this TimeNum and TimeNum t.

Value parameters

t

the TimeNum that multiplies this

Attributes

def toDouble(t: TimeNum): Double

Convert the given TimeNum number to a Double.

Convert the given TimeNum number to a Double.

Value parameters

t

that date-time number to convert

Attributes

def toDouble: Double
def toFloat(t: TimeNum): Float

Convert this TimeNum number to a Float.

Convert this TimeNum number to a Float.

Value parameters

t

that date-time number to convert

Attributes

def toFloat: Float
def toInt(t: TimeNum): Int

Convert this TimeNum number to an Int.

Convert this TimeNum number to an Int.

Value parameters

t

that date-time number to convert

Attributes

def toInt: Int
def toLong(t: TimeNum): Long

Convert this TimeNum number to a Long.

Convert this TimeNum number to a Long.

Value parameters

t

that date-time number to convert

Attributes

def toLong: Long
override def toString: String

Convert this date-time number to a String.

Convert this date-time number to a String.

Attributes

Definition Classes
Any
def toString2(format: String): 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.

Value parameters

format

the format to be used

Attributes

Convert this date-time number to a TimeNum.

Convert this date-time number to a TimeNum.

Attributes

inline def unary_-: TimeNum
def ~^(t: TimeNum): TimeNum

Raise this TimeNum to power TimeNum t.

Raise this TimeNum to power TimeNum t.

Value parameters

t

the TimeNum that raises this

Attributes

inline def (t: TimeNum): TimeNum
inline def (lim: (TimeNum, TimeNum)): Boolean
inline def (set: Set[TimeNum]): Boolean
inline def (lim: (TimeNum, TimeNum)): Boolean
inline def (set: Set[TimeNum]): Boolean
inline def (t: TimeNum): Boolean
inline def (t: TimeNum): Boolean
inline 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.

Value parameters

t

that TimeNum number

Attributes

inline 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.

Value parameters

t

that TimeNum number

Attributes

inline 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.

Value parameters

t

that TimeNum number

Attributes

Inherited methods

def <(that: TimeNum): Boolean

Attributes

Inherited from:
Ordered
def <=(that: TimeNum): Boolean

Attributes

Inherited from:
Ordered
def >(that: TimeNum): Boolean

Attributes

Inherited from:
Ordered
def >=(that: TimeNum): Boolean

Attributes

Inherited from:
Ordered
def abs(x: TimeNum): TimeNum

Attributes

Inherited from:
Numeric
def compareTo(that: TimeNum): Int

Attributes

Inherited from:
Ordered
override def equiv(x: TimeNum, y: TimeNum): Boolean

Attributes

Definition Classes
Ordering -> PartialOrdering -> Equiv
Inherited from:
Ordering
override def gt(x: TimeNum, y: TimeNum): Boolean

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def gteq(x: TimeNum, y: TimeNum): Boolean

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def isReverseOf(other: Ordering[_]): Boolean

Attributes

Inherited from:
Ordering
override def lt(x: TimeNum, y: TimeNum): Boolean

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def lteq(x: TimeNum, y: TimeNum): Boolean

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def max[U <: TimeNum](x: U, y: U): U

Attributes

Inherited from:
Ordering
def min[U <: TimeNum](x: U, y: U): U

Attributes

Inherited from:
Ordering
def on[U](f: U => TimeNum): Ordering[U]

Attributes

Inherited from:
Ordering
def one: TimeNum

Attributes

Inherited from:
Numeric
def orElse(other: Ordering[TimeNum]): Ordering[TimeNum]

Attributes

Inherited from:
Ordering
def orElseBy[S](f: TimeNum => S)(implicit ord: Ordering[S]): Ordering[TimeNum]

Attributes

Inherited from:
Ordering
override def reverse: Ordering[TimeNum]

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def reversed(): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def sign(x: TimeNum): TimeNum

Attributes

Inherited from:
Numeric
def thenComparing[U <: Comparable[_ >: U <: <FromJavaObject>]](x$0: Function[_ >: TimeNum <: <FromJavaObject>, _ <: U]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def thenComparing[U <: <FromJavaObject>](x$0: Function[_ >: TimeNum <: <FromJavaObject>, _ <: U], x$1: Comparator[_ >: U <: <FromJavaObject>]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def thenComparing(x$0: Comparator[_ >: TimeNum <: <FromJavaObject>]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def thenComparingDouble(x$0: ToDoubleFunction[_ >: TimeNum <: <FromJavaObject>]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def thenComparingInt(x$0: ToIntFunction[_ >: TimeNum <: <FromJavaObject>]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def thenComparingLong(x$0: ToLongFunction[_ >: TimeNum <: <FromJavaObject>]): Comparator[TimeNum]

Attributes

Inherited from:
Comparator
def tryCompare(x: TimeNum, y: TimeNum): Some[Int]

Attributes

Inherited from:
Ordering
def zero: TimeNum

Attributes

Inherited from:
Numeric

Deprecated and Inherited methods

def signum(x: TimeNum): Int

Attributes

Deprecated
[Since version 2.13.0] use `sign` method instead
Inherited from:
Numeric

Concrete fields

val inst: Instant

Implicits

Inherited implicits

implicit def mkNumericOps(lhs: TimeNum): NumericOps

Attributes

Inherited from:
Numeric
implicit def mkOrderingOps(lhs: TimeNum): OrderingOps

Attributes

Inherited from:
Ordering