LongMonths

A number of months.

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

Constructors

LongMonths
Link copied to clipboard
common
fun LongMonths(value: Long)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

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

Divides this duration by a scalar value.

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

Multiplies this duration by a scalar value.

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

Converts this duration to an Int value.

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

Converts this duration to IntMonths.

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

Properties

absoluteValue
Link copied to clipboard
common

The absolute value of this duration.

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

Converts this duration to the number of whole years.

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

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

Converts this duration to an equivalent Java Period.

fun LongMonths.toJavaPeriod(): Period