IntMonths

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

A number of months.

Constructors

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

Types

Companion
Link copied to clipboard
common
object Companion

Functions

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

Properties

absoluteValue
Link copied to clipboard
common
val absoluteValue: IntMonths
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.
inYears
Link copied to clipboard
common
val inYears: IntYears
Converts this duration to the number of whole years.
value
Link copied to clipboard
common
val value: Int
The underlying value.

Extensions

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