LongYears

inline class LongYears(value: Long) : Comparable<LongYears>

A number of years.

Constructors

LongYears
Link copied to clipboard
common
fun LongYears(value: Long)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: LongYears): Int
div
Link copied to clipboard
common
operator fun div(scalar: Int): LongYears
Divides this duration by a scalar value.
operator fun div(scalar: Long): LongYears
Divides this duration by a scalar value.
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
isNegative
Link copied to clipboard
common
fun isNegative(): Boolean
Checks if this duration is negative.
isPositive
Link copied to clipboard
common
fun isPositive(): Boolean
Checks if this duration is positive.
isZero
Link copied to clipboard
common
fun isZero(): Boolean
Checks if this duration is zero.
minus
Link copied to clipboard
common
operator fun minus(centuries: IntCenturies): LongYears
operator fun minus(decades: IntDecades): LongYears
operator fun minus(months: IntMonths): LongMonths
operator fun minus(years: IntYears): LongYears
operator fun minus(centuries: LongCenturies): LongYears
operator fun minus(decades: LongDecades): LongYears
operator fun minus(months: LongMonths): LongMonths
operator fun minus(years: LongYears): LongYears
plus
Link copied to clipboard
common
operator fun plus(centuries: IntCenturies): LongYears
operator fun plus(decades: IntDecades): LongYears
operator fun plus(months: IntMonths): LongMonths
operator fun plus(years: IntYears): LongYears
operator fun plus(centuries: LongCenturies): LongYears
operator fun plus(decades: LongDecades): LongYears
operator fun plus(months: LongMonths): LongMonths
operator fun plus(years: LongYears): LongYears
rem
Link copied to clipboard
common
operator fun rem(scalar: Int): LongYears
operator fun rem(scalar: Long): LongYears
times
Link copied to clipboard
common
operator fun times(scalar: Int): LongYears
Multiplies this duration by a scalar value.
operator fun times(scalar: Long): LongYears
Multiplies this duration by a scalar value.
toComponents
Link copied to clipboard
common
inline fun <T> toComponents(action: (decades: LongDecades, years: IntYears) -> T): T
inline fun <T> toComponents(action: (centuries: LongCenturies, decades: IntDecades, years: IntYears) -> T): T
toInt
Link copied to clipboard
common
fun toInt(): Int
Converts this duration to an Int value.
toIntYears
Link copied to clipboard
common
fun toIntYears(): IntYears
Converts this duration to IntYears.
toString
Link copied to clipboard
common
open override fun toString(): String
Converts this duration to an ISO-8601 time interval representation.
unaryMinus
Link copied to clipboard
common
operator fun unaryMinus(): LongYears
Negates this duration.

Properties

absoluteValue
Link copied to clipboard
common
val absoluteValue: LongYears
The absolute value of this duration.
inCenturies
Link copied to clipboard
common
val inCenturies: LongCenturies
Converts this duration to the number of whole centuries.
inDecades
Link copied to clipboard
common
val inDecades: LongDecades
Converts this duration to the number of whole decades.
inMonths
Link copied to clipboard
common
val inMonths: LongMonths
Converts this duration to months.
value
Link copied to clipboard
common
val value: Long
The underlying value.

Extensions

asPeriod
Link copied to clipboard
common
fun LongYears.asPeriod(): Period
Converts this duration into a Period with the same number of years.
minus
Link copied to clipboard
common
operator fun LongYears.minus(period: Period): Period
plus
Link copied to clipboard
common
operator fun LongYears.plus(period: Period): Period
toJavaPeriod
Link copied to clipboard
fun LongYears.toJavaPeriod(): Period
Converts this duration to an equivalent Java Period.