IntYears

A number of years.

inline class IntYears(value: Int) : Comparable<IntYears>

Constructors

IntYears
Link copied to clipboard
common
fun IntYears(value: Int)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: IntYears): Int
div
Link copied to clipboard
common

Divides this duration by a scalar value.

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

Multiplies this duration by a scalar value.

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

Converts this duration to a Long value.

fun toLong(): Long
toLongYears
Link copied to clipboard
common

Converts this duration to LongYears.

fun toLongYears(): LongYears
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(): IntYears

Properties

absoluteValue
Link copied to clipboard
common

The absolute value of this duration.

val absoluteValue: IntYears
inCenturies
Link copied to clipboard
common

Converts this duration to the number of whole centuries.

val inCenturies: IntCenturies
inDecades
Link copied to clipboard
common

Converts this duration to the number of whole decades.

val inDecades: IntDecades
inMonths
Link copied to clipboard
common

Converts this duration to months.

val inMonths: IntMonths
value
Link copied to clipboard
common

The underlying value.

val value: Int

Extensions

asPeriod
Link copied to clipboard
common

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

fun IntYears.asPeriod(): Period
minus
Link copied to clipboard
common
operator fun IntYears.minus(period: Period): Period
plus
Link copied to clipboard
common
operator fun IntYears.plus(period: Period): Period
toJavaPeriod
Link copied to clipboard

Converts this duration to an equivalent Java Period.

fun IntYears.toJavaPeriod(): Period