IntYears

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

A number of years.

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
operator fun div(scalar: Int): IntYears
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): IntYears
operator fun minus(decades: IntDecades): IntYears
operator fun minus(months: IntMonths): IntMonths
operator fun minus(years: IntYears): IntYears
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): IntYears
operator fun plus(decades: IntDecades): IntYears
operator fun plus(months: IntMonths): IntMonths
operator fun plus(years: IntYears): IntYears
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): IntYears
operator fun rem(scalar: Long): LongYears
times
Link copied to clipboard
common
operator fun times(scalar: Int): IntYears
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: IntDecades, years: IntYears) -> T): T
inline fun <T> toComponents(action: (centuries: IntCenturies, decades: IntDecades, years: IntYears) -> T): T
toLong
Link copied to clipboard
common
fun toLong(): Long
Converts this duration to a Long value.
toLongYears
Link copied to clipboard
common
fun toLongYears(): LongYears
Converts this duration to LongYears.
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(): IntYears
Negates this duration.

Properties

absoluteValue
Link copied to clipboard
common
val absoluteValue: IntYears
The absolute value of this duration.
inCenturies
Link copied to clipboard
common
val inCenturies: IntCenturies
Converts this duration to the number of whole centuries.
inDecades
Link copied to clipboard
common
val inDecades: IntDecades
Converts this duration to the number of whole decades.
inMonths
Link copied to clipboard
common
val inMonths: IntMonths
Converts this duration to months.
value
Link copied to clipboard
common
val value: Int
The underlying value.

Extensions

asPeriod
Link copied to clipboard
common
fun IntYears.asPeriod(): Period
Converts this duration into a Period with the same number of years.
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
fun IntYears.toJavaPeriod(): Period
Converts this duration to an equivalent Java Period.