IntMonths

A number of months.

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

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

Divides this duration by a scalar value.

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

Multiplies this duration by a scalar value.

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

Converts this duration to a Long value.

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

Converts this duration to LongMonths.

fun toLongMonths(): LongMonths
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(): IntMonths

Properties

absoluteValue
Link copied to clipboard
common

The absolute value of this duration.

val absoluteValue: IntMonths
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
inYears
Link copied to clipboard
common

Converts this duration to the number of whole years.

val inYears: IntYears
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 months.

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

Converts this duration to an equivalent Java Period.

fun IntMonths.toJavaPeriod(): Period