LongYears

A number of years.

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

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

Divides this duration by a scalar value.

operator fun div(scalar: Int): LongYears
operator fun div(scalar: Long): LongYears
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

Checks if this duration is negative.

fun isNegative(): Boolean
isPositive
Link copied to clipboard
common

Checks if this duration is positive.

fun isPositive(): Boolean
isZero
Link copied to clipboard
common

Checks if this duration is zero.

fun isZero(): Boolean
minus
Link copied to clipboard
common
operator fun minus(months: IntMonths): LongMonths
operator fun minus(months: LongMonths): LongMonths
operator fun minus(years: IntYears): LongYears
operator fun minus(years: LongYears): LongYears
operator fun minus(decades: IntDecades): LongYears
operator fun minus(decades: LongDecades): LongYears
operator fun minus(centuries: IntCenturies): LongYears
operator fun minus(centuries: LongCenturies): LongYears
plus
Link copied to clipboard
common
operator fun plus(months: IntMonths): LongMonths
operator fun plus(months: LongMonths): LongMonths
operator fun plus(years: IntYears): LongYears
operator fun plus(years: LongYears): LongYears
operator fun plus(decades: IntDecades): LongYears
operator fun plus(decades: LongDecades): LongYears
operator fun plus(centuries: IntCenturies): LongYears
operator fun plus(centuries: LongCenturies): 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

Multiplies this duration by a scalar value.

operator fun times(scalar: Int): LongYears
operator fun times(scalar: Long): LongYears
toComponents
Link copied to clipboard
common
inline fun <T> toComponents(action: (LongDecades, IntYears) -> T): T
inline fun <T> toComponents(action: (LongCenturies, IntDecades, IntYears) -> T): T
toInt
Link copied to clipboard
common

Converts this duration to an Int value.

fun toInt(): Int
toIntYears
Link copied to clipboard
common

Converts this duration to IntYears.

fun toIntYears(): IntYears
toString
Link copied to clipboard
common

Converts this duration to an ISO-8601 time interval representation.

open override fun toString(): String
unaryMinus
Link copied to clipboard
common

Negates this duration.

operator fun unaryMinus(): LongYears

Properties

absoluteValue
Link copied to clipboard
common

The absolute value of this duration.

val absoluteValue: LongYears
inCenturies
Link copied to clipboard
common

Converts this duration to the number of whole centuries.

val inCenturies: LongCenturies
inDecades
Link copied to clipboard
common

Converts this duration to the number of whole decades.

val inDecades: LongDecades
inMonths
Link copied to clipboard
common

Converts this duration to months.

val inMonths: LongMonths
value
Link copied to clipboard
common

The underlying value.

val value: Long

Extensions

asPeriod
Link copied to clipboard
common

Converts this duration into a Period with the same number of years.

fun LongYears.asPeriod(): Period
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

Converts this duration to an equivalent Java Period.

fun LongYears.toJavaPeriod(): Period