From ae4d23b303da13b38254781f1a360d681a473ab5 Mon Sep 17 00:00:00 2001 From: Erik Christensen <40830816+erikc5000@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:57:01 -0400 Subject: [PATCH] Fix various documentation issues (#269) --- .../io/islandtime/_DateProperties.kt | 100 +++++++----------- .../io/islandtime/measures/_Centuries.kt | 54 +++++++--- .../generated/io/islandtime/measures/_Days.kt | 66 ++++++++---- .../io/islandtime/measures/_Decades.kt | 50 ++++++--- .../io/islandtime/measures/_Hours.kt | 62 ++++++++--- .../io/islandtime/measures/_Microseconds.kt | 48 ++++++--- .../io/islandtime/measures/_Milliseconds.kt | 52 ++++++--- .../io/islandtime/measures/_Minutes.kt | 58 +++++++--- .../io/islandtime/measures/_Months.kt | 42 +++++--- .../io/islandtime/measures/_Nanoseconds.kt | 44 +++++--- .../io/islandtime/measures/_Seconds.kt | 54 +++++++--- .../io/islandtime/measures/_Weeks.kt | 46 +++++--- .../io/islandtime/measures/_Years.kt | 46 +++++--- .../commonMain/kotlin/io/islandtime/Date.kt | 6 +- .../commonMain/kotlin/io/islandtime/Month.kt | 8 +- .../commonMain/kotlin/io/islandtime/Time.kt | 2 +- .../kotlin/io/islandtime/WeekDate.kt | 4 +- .../islandtime/format/DateTimeTextProvider.kt | 2 +- .../kotlin/io/islandtime/ranges/DateRange.kt | 6 +- .../io/islandtime/ranges/DateTimeInterval.kt | 2 +- .../io/islandtime/ranges/InstantInterval.kt | 2 +- .../ranges/OffsetDateTimeInterval.kt | 2 +- .../ranges/ZonedDateTimeInterval.kt | 2 +- .../generators/DatePropertiesGenerator.kt | 20 ++-- .../generators/TemporalUnitGenerator.kt | 8 ++ 25 files changed, 520 insertions(+), 266 deletions(-) diff --git a/core/src/commonMain/generated/io/islandtime/_DateProperties.kt b/core/src/commonMain/generated/io/islandtime/_DateProperties.kt index ac015226c..b539f3fb0 100644 --- a/core/src/commonMain/generated/io/islandtime/_DateProperties.kt +++ b/core/src/commonMain/generated/io/islandtime/_DateProperties.kt @@ -46,9 +46,8 @@ public fun Date.week(settings: WeekSettings): DateRange = * The range defining the week that this date falls within. The first day of the week will be the * default associated with the provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun Date.week(locale: Locale): DateRange = startOfWeek(locale).let { it..it + 6.days } @@ -67,9 +66,8 @@ public fun Date.weekOfMonth(settings: WeekSettings): Int = weekOfMonthImpl(setti * The week of the month, from 0-6, calculated using the default week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun Date.weekOfMonth(locale: Locale): Int = weekOfMonthImpl(locale.weekSettings) @@ -100,9 +98,8 @@ public fun Date.weekOfYear(settings: WeekSettings): Int = weekOfYearImpl(setting * * To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -131,9 +128,8 @@ public fun Date.weekBasedYear(settings: WeekSettings): Int = weekBasedYearImpl(s * This value differs from the regular ISO year when the week number falls in the preceding or * following year. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -158,9 +154,8 @@ public fun Date.weekOfWeekBasedYear(settings: WeekSettings): Int = weekOfWeekBas * The week number of the week-based year, calculated using the week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekBasedYear */ @@ -254,9 +249,8 @@ public fun DateTime.week(settings: WeekSettings): DateTimeInterval = * The interval defining the week that this date-time falls within. The first day of the week will * be the default associated with the provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun DateTime.week(locale: Locale): DateTimeInterval = startOfWeek(locale).let { it until it + 7.days } @@ -276,9 +270,8 @@ public fun DateTime.weekOfMonth(settings: WeekSettings): Int = date.weekOfMonth( * The week of the month, from 0-6, calculated using the default week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun DateTime.weekOfMonth(locale: Locale): Int = date.weekOfMonth(locale) @@ -309,9 +302,8 @@ public fun DateTime.weekOfYear(settings: WeekSettings): Int = date.weekOfYear(se * * To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -340,9 +332,8 @@ public fun DateTime.weekBasedYear(settings: WeekSettings): Int = date.weekBasedY * This value differs from the regular ISO year when the week number falls in the preceding or * following year. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -368,9 +359,8 @@ public fun DateTime.weekOfWeekBasedYear(settings: WeekSettings): Int = * The week number of the week-based year, calculated using the week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekBasedYear */ @@ -447,9 +437,8 @@ public fun OffsetDateTime.week(settings: WeekSettings): OffsetDateTimeInterval = * The interval defining the week that this date-time falls within. The first day of the week will * be the default associated with the provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun OffsetDateTime.week(locale: Locale): OffsetDateTimeInterval = startOfWeek(locale).let { it until it + 7.days } @@ -469,9 +458,8 @@ public fun OffsetDateTime.weekOfMonth(settings: WeekSettings): Int = dateTime.we * The week of the month, from 0-6, calculated using the default week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun OffsetDateTime.weekOfMonth(locale: Locale): Int = dateTime.weekOfMonth(locale) @@ -502,9 +490,8 @@ public fun OffsetDateTime.weekOfYear(settings: WeekSettings): Int = dateTime.wee * * To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -534,9 +521,8 @@ public fun OffsetDateTime.weekBasedYear(settings: WeekSettings): Int = * This value differs from the regular ISO year when the week number falls in the preceding or * following year. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -562,9 +548,8 @@ public fun OffsetDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int = * The week number of the week-based year, calculated using the week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekBasedYear */ @@ -644,9 +629,8 @@ public fun ZonedDateTime.week(settings: WeekSettings): ZonedDateTimeInterval = * The interval defining the week that this date-time falls within. The first day of the week will * be the default associated with the provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun ZonedDateTime.week(locale: Locale): ZonedDateTimeInterval = startOfWeek(locale).let { it until it + 7.days } @@ -666,9 +650,8 @@ public fun ZonedDateTime.weekOfMonth(settings: WeekSettings): Int = dateTime.wee * The week of the month, from 0-6, calculated using the default week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ public fun ZonedDateTime.weekOfMonth(locale: Locale): Int = dateTime.weekOfMonth(locale) @@ -699,9 +682,8 @@ public fun ZonedDateTime.weekOfYear(settings: WeekSettings): Int = dateTime.week * * To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -731,9 +713,8 @@ public fun ZonedDateTime.weekBasedYear(settings: WeekSettings): Int = * This value differs from the regular ISO year when the week number falls in the preceding or * following year. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekOfWeekBasedYear */ @@ -759,9 +740,8 @@ public fun ZonedDateTime.weekOfWeekBasedYear(settings: WeekSettings): Int = * The week number of the week-based year, calculated using the week definition associated with the * provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale - * on some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] - * instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on + * some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. * * @see weekBasedYear */ diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Centuries.kt b/core/src/commonMain/generated/io/islandtime/measures/_Centuries.kt index 7032f376a..49e6bc62f 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Centuries.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Centuries.kt @@ -53,13 +53,17 @@ public value class Centuries( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Centuries get() = Centuries(absExact(value)) /** - * Converts this duration to months. @throws ArithmeticException if overflow occurs + * Converts this duration to months. + * + * @throws ArithmeticException if overflow occurs */ public val inMonths: Months get() = Months(value timesExact MONTHS_PER_CENTURY) @@ -71,7 +75,9 @@ public value class Centuries( get() = Months(value * MONTHS_PER_CENTURY) /** - * Converts this duration to years. @throws ArithmeticException if overflow occurs + * Converts this duration to years. + * + * @throws ArithmeticException if overflow occurs */ public val inYears: Years get() = Years(value timesExact YEARS_PER_CENTURY) @@ -83,7 +89,9 @@ public value class Centuries( get() = Years(value * YEARS_PER_CENTURY) /** - * Converts this duration to decades. @throws ArithmeticException if overflow occurs + * Converts this duration to decades. + * + * @throws ArithmeticException if overflow occurs */ public val inDecades: Decades get() = Decades(value timesExact DECADES_PER_CENTURY) @@ -145,7 +153,9 @@ public value class Centuries( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Centuries = Centuries(value.negateExact()) @@ -173,13 +183,16 @@ public value class Centuries( centuries.value) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Centuries = Centuries(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Centuries { return if (scalar == -1) { @@ -195,13 +208,16 @@ public value class Centuries( public operator fun rem(scalar: Int): Centuries = Centuries(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Centuries = Centuries(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Centuries { return if (scalar == -1L) { @@ -217,7 +233,9 @@ public value class Centuries( public operator fun rem(scalar: Long): Centuries = Centuries(value % scalar) /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -227,7 +245,9 @@ public value class Centuries( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntCenturies]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntCenturies]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -277,7 +297,9 @@ public val Int.centuries: Centuries get() = Centuries(this) /** - * Multiplies this value by a duration of centuries. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of centuries. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(centuries: Centuries): Centuries = centuries * this @@ -288,6 +310,8 @@ public val Long.centuries: Centuries get() = Centuries(this) /** - * Multiplies this value by a duration of centuries. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of centuries. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(centuries: Centuries): Centuries = centuries * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Days.kt b/core/src/commonMain/generated/io/islandtime/measures/_Days.kt index 7d0810e8d..e84c3ea65 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Days.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Days.kt @@ -63,13 +63,17 @@ public value class Days( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Days get() = Days(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_DAY) @@ -81,7 +85,9 @@ public value class Days( get() = Nanoseconds(value * NANOSECONDS_PER_DAY) /** - * Converts this duration to microseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to microseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMicroseconds: Microseconds get() = Microseconds(value timesExact MICROSECONDS_PER_DAY) @@ -93,7 +99,9 @@ public value class Days( get() = Microseconds(value * MICROSECONDS_PER_DAY) /** - * Converts this duration to milliseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMilliseconds: Milliseconds get() = Milliseconds(value timesExact MILLISECONDS_PER_DAY) @@ -105,7 +113,9 @@ public value class Days( get() = Milliseconds(value * MILLISECONDS_PER_DAY) /** - * Converts this duration to seconds. @throws ArithmeticException if overflow occurs + * Converts this duration to seconds. + * + * @throws ArithmeticException if overflow occurs */ public val inSeconds: Seconds get() = Seconds(value timesExact SECONDS_PER_DAY) @@ -117,7 +127,9 @@ public value class Days( get() = Seconds(value * SECONDS_PER_DAY) /** - * Converts this duration to minutes. @throws ArithmeticException if overflow occurs + * Converts this duration to minutes. + * + * @throws ArithmeticException if overflow occurs */ public val inMinutes: Minutes get() = Minutes(value timesExact MINUTES_PER_DAY) @@ -129,7 +141,9 @@ public value class Days( get() = Minutes(value * MINUTES_PER_DAY) /** - * Converts this duration to hours. @throws ArithmeticException if overflow occurs + * Converts this duration to hours. + * + * @throws ArithmeticException if overflow occurs */ public val inHours: Hours get() = Hours(value timesExact HOURS_PER_DAY) @@ -210,7 +224,9 @@ public value class Days( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Days = Days(value.negateExact()) @@ -257,13 +273,16 @@ public value class Days( public operator fun minus(weeks: Weeks): Days = this - weeks.inDays /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Days = Days(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Days { return if (scalar == -1) { @@ -279,13 +298,16 @@ public value class Days( public operator fun rem(scalar: Int): Days = Days(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Days = Days(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Days { return if (scalar == -1L) { @@ -315,7 +337,9 @@ public value class Days( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -325,7 +349,9 @@ public value class Days( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntDays]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntDays]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -375,7 +401,9 @@ public val Int.days: Days get() = Days(this) /** - * Multiplies this value by a duration of days. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of days. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(days: Days): Days = days * this @@ -386,7 +414,9 @@ public val Long.days: Days get() = Days(this) /** - * Multiplies this value by a duration of days. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of days. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(days: Days): Days = days * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Decades.kt b/core/src/commonMain/generated/io/islandtime/measures/_Decades.kt index dd7bd88f3..7561ab8f8 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Decades.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Decades.kt @@ -56,13 +56,17 @@ public value class Decades( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Decades get() = Decades(absExact(value)) /** - * Converts this duration to months. @throws ArithmeticException if overflow occurs + * Converts this duration to months. + * + * @throws ArithmeticException if overflow occurs */ public val inMonths: Months get() = Months(value timesExact MONTHS_PER_DECADE) @@ -74,7 +78,9 @@ public value class Decades( get() = Months(value * MONTHS_PER_DECADE) /** - * Converts this duration to years. @throws ArithmeticException if overflow occurs + * Converts this duration to years. + * + * @throws ArithmeticException if overflow occurs */ public val inYears: Years get() = Years(value timesExact YEARS_PER_DECADE) @@ -150,7 +156,9 @@ public value class Decades( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Decades = Decades(value.negateExact()) @@ -176,13 +184,16 @@ public value class Decades( public operator fun minus(centuries: Centuries): Decades = this - centuries.inDecades /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Decades = Decades(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Decades { return if (scalar == -1) { @@ -198,13 +209,16 @@ public value class Decades( public operator fun rem(scalar: Int): Decades = Decades(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Decades = Decades(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Decades { return if (scalar == -1L) { @@ -234,7 +248,9 @@ public value class Decades( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -244,7 +260,9 @@ public value class Decades( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntDecades]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntDecades]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -294,7 +312,9 @@ public val Int.decades: Decades get() = Decades(this) /** - * Multiplies this value by a duration of decades. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of decades. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(decades: Decades): Decades = decades * this @@ -305,6 +325,8 @@ public val Long.decades: Decades get() = Decades(this) /** - * Multiplies this value by a duration of decades. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of decades. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(decades: Decades): Decades = decades * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Hours.kt b/core/src/commonMain/generated/io/islandtime/measures/_Hours.kt index 791c6acce..2eae0637c 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Hours.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Hours.kt @@ -62,13 +62,17 @@ public value class Hours( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Hours get() = Hours(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_HOUR) @@ -80,7 +84,9 @@ public value class Hours( get() = Nanoseconds(value * NANOSECONDS_PER_HOUR) /** - * Converts this duration to microseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to microseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMicroseconds: Microseconds get() = Microseconds(value timesExact MICROSECONDS_PER_HOUR) @@ -92,7 +98,9 @@ public value class Hours( get() = Microseconds(value * MICROSECONDS_PER_HOUR) /** - * Converts this duration to milliseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMilliseconds: Milliseconds get() = Milliseconds(value timesExact MILLISECONDS_PER_HOUR) @@ -104,7 +112,9 @@ public value class Hours( get() = Milliseconds(value * MILLISECONDS_PER_HOUR) /** - * Converts this duration to seconds. @throws ArithmeticException if overflow occurs + * Converts this duration to seconds. + * + * @throws ArithmeticException if overflow occurs */ public val inSeconds: Seconds get() = Seconds(value timesExact SECONDS_PER_HOUR) @@ -116,7 +126,9 @@ public value class Hours( get() = Seconds(value * SECONDS_PER_HOUR) /** - * Converts this duration to minutes. @throws ArithmeticException if overflow occurs + * Converts this duration to minutes. + * + * @throws ArithmeticException if overflow occurs */ public val inMinutes: Minutes get() = Minutes(value timesExact MINUTES_PER_HOUR) @@ -197,7 +209,9 @@ public value class Hours( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Hours = Hours(value.negateExact()) @@ -240,13 +254,16 @@ public value class Hours( public operator fun minus(days: Days): Hours = this - days.inHours /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Hours = Hours(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Hours { return if (scalar == -1) { @@ -262,13 +279,16 @@ public value class Hours( public operator fun rem(scalar: Int): Hours = Hours(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Hours = Hours(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Hours { return if (scalar == -1L) { @@ -298,7 +318,9 @@ public value class Hours( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -308,7 +330,9 @@ public value class Hours( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntHours]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntHours]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -358,7 +382,9 @@ public val Int.hours: Hours get() = Hours(this) /** - * Multiplies this value by a duration of hours. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of hours. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(hours: Hours): Hours = hours * this @@ -369,7 +395,9 @@ public val Long.hours: Hours get() = Hours(this) /** - * Multiplies this value by a duration of hours. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of hours. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(hours: Hours): Hours = hours * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Microseconds.kt b/core/src/commonMain/generated/io/islandtime/measures/_Microseconds.kt index 648fa01d2..09a575fca 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Microseconds.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Microseconds.kt @@ -63,13 +63,17 @@ public value class Microseconds( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Microseconds get() = Microseconds(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_MICROSECOND) @@ -212,7 +216,9 @@ public value class Microseconds( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Microseconds = Microseconds(value.negateExact()) @@ -255,13 +261,16 @@ public value class Microseconds( public operator fun minus(days: Days): Microseconds = this - days.inMicroseconds /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Microseconds = Microseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Microseconds { return if (scalar == -1) { @@ -277,13 +286,16 @@ public value class Microseconds( public operator fun rem(scalar: Int): Microseconds = Microseconds(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Microseconds = Microseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Microseconds { return if (scalar == -1L) { @@ -427,7 +439,9 @@ public value class Microseconds( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -437,7 +451,9 @@ public value class Microseconds( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntMicroseconds]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntMicroseconds]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -487,8 +503,9 @@ public val Int.microseconds: Microseconds get() = Microseconds(this) /** - * Multiplies this value by a duration of microseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of microseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(microseconds: Microseconds): Microseconds = microseconds * this @@ -499,8 +516,9 @@ public val Long.microseconds: Microseconds get() = Microseconds(this) /** - * Multiplies this value by a duration of microseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of microseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(microseconds: Microseconds): Microseconds = microseconds * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Milliseconds.kt b/core/src/commonMain/generated/io/islandtime/measures/_Milliseconds.kt index 0b4b8c020..d10df305a 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Milliseconds.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Milliseconds.kt @@ -63,13 +63,17 @@ public value class Milliseconds( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Milliseconds get() = Milliseconds(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_MILLISECOND) @@ -81,7 +85,9 @@ public value class Milliseconds( get() = Nanoseconds(value * NANOSECONDS_PER_MILLISECOND) /** - * Converts this duration to microseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to microseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMicroseconds: Microseconds get() = Microseconds(value timesExact MICROSECONDS_PER_MILLISECOND) @@ -210,7 +216,9 @@ public value class Milliseconds( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Milliseconds = Milliseconds(value.negateExact()) @@ -253,13 +261,16 @@ public value class Milliseconds( public operator fun minus(days: Days): Milliseconds = this - days.inMilliseconds /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Milliseconds = Milliseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Milliseconds { return if (scalar == -1) { @@ -275,13 +286,16 @@ public value class Milliseconds( public operator fun rem(scalar: Int): Milliseconds = Milliseconds(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Milliseconds = Milliseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Milliseconds { return if (scalar == -1L) { @@ -391,7 +405,9 @@ public value class Milliseconds( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -401,7 +417,9 @@ public value class Milliseconds( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntMilliseconds]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntMilliseconds]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -451,8 +469,9 @@ public val Int.milliseconds: Milliseconds get() = Milliseconds(this) /** - * Multiplies this value by a duration of milliseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(milliseconds: Milliseconds): Milliseconds = milliseconds * this @@ -463,8 +482,9 @@ public val Long.milliseconds: Milliseconds get() = Milliseconds(this) /** - * Multiplies this value by a duration of milliseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(milliseconds: Milliseconds): Milliseconds = milliseconds * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Minutes.kt b/core/src/commonMain/generated/io/islandtime/measures/_Minutes.kt index aaf8b4190..0db1789d6 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Minutes.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Minutes.kt @@ -62,13 +62,17 @@ public value class Minutes( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Minutes get() = Minutes(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_MINUTE) @@ -80,7 +84,9 @@ public value class Minutes( get() = Nanoseconds(value * NANOSECONDS_PER_MINUTE) /** - * Converts this duration to microseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to microseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMicroseconds: Microseconds get() = Microseconds(value timesExact MICROSECONDS_PER_MINUTE) @@ -92,7 +98,9 @@ public value class Minutes( get() = Microseconds(value * MICROSECONDS_PER_MINUTE) /** - * Converts this duration to milliseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMilliseconds: Milliseconds get() = Milliseconds(value timesExact MILLISECONDS_PER_MINUTE) @@ -104,7 +112,9 @@ public value class Minutes( get() = Milliseconds(value * MILLISECONDS_PER_MINUTE) /** - * Converts this duration to seconds. @throws ArithmeticException if overflow occurs + * Converts this duration to seconds. + * + * @throws ArithmeticException if overflow occurs */ public val inSeconds: Seconds get() = Seconds(value timesExact SECONDS_PER_MINUTE) @@ -199,7 +209,9 @@ public value class Minutes( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Minutes = Minutes(value.negateExact()) @@ -242,13 +254,16 @@ public value class Minutes( public operator fun minus(days: Days): Minutes = this - days.inMinutes /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Minutes = Minutes(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Minutes { return if (scalar == -1) { @@ -264,13 +279,16 @@ public value class Minutes( public operator fun rem(scalar: Int): Minutes = Minutes(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Minutes = Minutes(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Minutes { return if (scalar == -1L) { @@ -323,7 +341,9 @@ public value class Minutes( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -333,7 +353,9 @@ public value class Minutes( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntMinutes]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntMinutes]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -383,7 +405,9 @@ public val Int.minutes: Minutes get() = Minutes(this) /** - * Multiplies this value by a duration of minutes. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of minutes. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(minutes: Minutes): Minutes = minutes * this @@ -394,7 +418,9 @@ public val Long.minutes: Minutes get() = Minutes(this) /** - * Multiplies this value by a duration of minutes. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of minutes. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(minutes: Minutes): Minutes = minutes * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Months.kt b/core/src/commonMain/generated/io/islandtime/measures/_Months.kt index ed61af6e3..808b81af6 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Months.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Months.kt @@ -56,7 +56,9 @@ public value class Months( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Months get() = Months(absExact(value)) @@ -154,7 +156,9 @@ public value class Months( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Months = Months(value.negateExact()) @@ -180,13 +184,16 @@ public value class Months( public operator fun minus(centuries: Centuries): Months = this - centuries.inMonths /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Months = Months(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Months { return if (scalar == -1) { @@ -202,13 +209,16 @@ public value class Months( public operator fun rem(scalar: Int): Months = Months(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Months = Months(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Months { return if (scalar == -1L) { @@ -287,7 +297,9 @@ public value class Months( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -297,7 +309,9 @@ public value class Months( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntMonths]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntMonths]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -347,7 +361,9 @@ public val Int.months: Months get() = Months(this) /** - * Multiplies this value by a duration of months. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of months. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(months: Months): Months = months * this @@ -358,6 +374,8 @@ public val Long.months: Months get() = Months(this) /** - * Multiplies this value by a duration of months. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of months. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(months: Months): Months = months * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Nanoseconds.kt b/core/src/commonMain/generated/io/islandtime/measures/_Nanoseconds.kt index 8c5b16ff2..49322b7b6 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Nanoseconds.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Nanoseconds.kt @@ -63,7 +63,9 @@ public value class Nanoseconds( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Nanoseconds get() = Nanoseconds(absExact(value)) @@ -214,7 +216,9 @@ public value class Nanoseconds( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Nanoseconds = Nanoseconds(value.negateExact()) @@ -258,13 +262,16 @@ public value class Nanoseconds( public operator fun minus(days: Days): Nanoseconds = this - days.inNanoseconds /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Nanoseconds = Nanoseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Nanoseconds { return if (scalar == -1) { @@ -280,13 +287,16 @@ public value class Nanoseconds( public operator fun rem(scalar: Int): Nanoseconds = Nanoseconds(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Nanoseconds = Nanoseconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Nanoseconds { return if (scalar == -1L) { @@ -467,7 +477,9 @@ public value class Nanoseconds( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -477,7 +489,9 @@ public value class Nanoseconds( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntNanoseconds]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntNanoseconds]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -527,8 +541,9 @@ public val Int.nanoseconds: Nanoseconds get() = Nanoseconds(this) /** - * Multiplies this value by a duration of nanoseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(nanoseconds: Nanoseconds): Nanoseconds = nanoseconds * this @@ -539,8 +554,9 @@ public val Long.nanoseconds: Nanoseconds get() = Nanoseconds(this) /** - * Multiplies this value by a duration of nanoseconds. @throws ArithmeticException if overflow - * occurs + * Multiplies this value by a duration of nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(nanoseconds: Nanoseconds): Nanoseconds = nanoseconds * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Seconds.kt b/core/src/commonMain/generated/io/islandtime/measures/_Seconds.kt index 2a0290ae9..4ba07d0bb 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Seconds.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Seconds.kt @@ -62,13 +62,17 @@ public value class Seconds( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Seconds get() = Seconds(absExact(value)) /** - * Converts this duration to nanoseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to nanoseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inNanoseconds: Nanoseconds get() = Nanoseconds(value timesExact NANOSECONDS_PER_SECOND) @@ -80,7 +84,9 @@ public value class Seconds( get() = Nanoseconds(value * NANOSECONDS_PER_SECOND) /** - * Converts this duration to microseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to microseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMicroseconds: Microseconds get() = Microseconds(value timesExact MICROSECONDS_PER_SECOND) @@ -92,7 +98,9 @@ public value class Seconds( get() = Microseconds(value * MICROSECONDS_PER_SECOND) /** - * Converts this duration to milliseconds. @throws ArithmeticException if overflow occurs + * Converts this duration to milliseconds. + * + * @throws ArithmeticException if overflow occurs */ public val inMilliseconds: Milliseconds get() = Milliseconds(value timesExact MILLISECONDS_PER_SECOND) @@ -201,7 +209,9 @@ public value class Seconds( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Seconds = Seconds(value.negateExact()) @@ -244,13 +254,16 @@ public value class Seconds( public operator fun minus(days: Days): Seconds = this - days.inSeconds /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Seconds = Seconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Seconds { return if (scalar == -1) { @@ -266,13 +279,16 @@ public value class Seconds( public operator fun rem(scalar: Int): Seconds = Seconds(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Seconds = Seconds(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Seconds { return if (scalar == -1L) { @@ -351,7 +367,9 @@ public value class Seconds( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -361,7 +379,9 @@ public value class Seconds( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntSeconds]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntSeconds]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -411,7 +431,9 @@ public val Int.seconds: Seconds get() = Seconds(this) /** - * Multiplies this value by a duration of seconds. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of seconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(seconds: Seconds): Seconds = seconds * this @@ -422,7 +444,9 @@ public val Long.seconds: Seconds get() = Seconds(this) /** - * Multiplies this value by a duration of seconds. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of seconds. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(seconds: Seconds): Seconds = seconds * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Weeks.kt b/core/src/commonMain/generated/io/islandtime/measures/_Weeks.kt index 6316ebf41..0e88df1c6 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Weeks.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Weeks.kt @@ -51,13 +51,17 @@ public value class Weeks( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Weeks get() = Weeks(absExact(value)) /** - * Converts this duration to days. @throws ArithmeticException if overflow occurs + * Converts this duration to days. + * + * @throws ArithmeticException if overflow occurs */ public val inDays: Days get() = Days(value timesExact DAYS_PER_WEEK) @@ -119,7 +123,9 @@ public value class Weeks( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Weeks = Weeks(value.negateExact()) @@ -137,13 +143,16 @@ public value class Weeks( public operator fun minus(weeks: Weeks): Weeks = Weeks(value minusExact weeks.value) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Weeks = Weeks(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Weeks { return if (scalar == -1) { @@ -159,13 +168,16 @@ public value class Weeks( public operator fun rem(scalar: Int): Weeks = Weeks(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Weeks = Weeks(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Weeks { return if (scalar == -1L) { @@ -181,7 +193,9 @@ public value class Weeks( public operator fun rem(scalar: Long): Weeks = Weeks(value % scalar) /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -191,7 +205,9 @@ public value class Weeks( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntWeeks]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntWeeks]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -241,7 +257,9 @@ public val Int.weeks: Weeks get() = Weeks(this) /** - * Multiplies this value by a duration of weeks. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of weeks. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(weeks: Weeks): Weeks = weeks * this @@ -252,6 +270,8 @@ public val Long.weeks: Weeks get() = Weeks(this) /** - * Multiplies this value by a duration of weeks. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of weeks. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(weeks: Weeks): Weeks = weeks * this diff --git a/core/src/commonMain/generated/io/islandtime/measures/_Years.kt b/core/src/commonMain/generated/io/islandtime/measures/_Years.kt index 26a6223fd..e91799557 100644 --- a/core/src/commonMain/generated/io/islandtime/measures/_Years.kt +++ b/core/src/commonMain/generated/io/islandtime/measures/_Years.kt @@ -56,13 +56,17 @@ public value class Years( public val `value`: Long, ) : Comparable { /** - * The absolute value of this duration. @throws ArithmeticException if overflow occurs + * The absolute value of this duration. + * + * @throws ArithmeticException if overflow occurs */ public val absoluteValue: Years get() = Years(absExact(value)) /** - * Converts this duration to months. @throws ArithmeticException if overflow occurs + * Converts this duration to months. + * + * @throws ArithmeticException if overflow occurs */ public val inMonths: Months get() = Months(value timesExact MONTHS_PER_YEAR) @@ -152,7 +156,9 @@ public value class Years( } /** - * Negates this duration. @throws ArithmeticException if overflow occurs + * Negates this duration. + * + * @throws ArithmeticException if overflow occurs */ public operator fun unaryMinus(): Years = Years(value.negateExact()) @@ -178,13 +184,16 @@ public value class Years( public operator fun minus(centuries: Centuries): Years = this - centuries.inYears /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Int): Years = Years(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Int): Years { return if (scalar == -1) { @@ -200,13 +209,16 @@ public value class Years( public operator fun rem(scalar: Int): Years = Years(value % scalar) /** - * Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs + * Multiplies this duration by a scalar value. + * + * @throws ArithmeticException if overflow occurs */ public operator fun times(scalar: Long): Years = Years(value timesExact scalar) /** - * Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs - * or the scalar is zero + * Returns this duration divided by a scalar value. + * + * @throws ArithmeticException if overflow occurs or the scalar is zero */ public operator fun div(scalar: Long): Years { return if (scalar == -1L) { @@ -259,7 +271,9 @@ public value class Years( } /** - * Converts this duration to an `Int` value. @throws ArithmeticException if overflow occurs + * Converts this duration to an `Int` value. + * + * @throws ArithmeticException if overflow occurs */ public fun toInt(): Int = value.toIntExact() @@ -269,7 +283,9 @@ public value class Years( internal fun toIntUnchecked(): Int = value.toInt() /** - * Converts this duration to [IntYears]. @throws ArithmeticException if overflow occurs + * Converts this duration to [IntYears]. + * + * @throws ArithmeticException if overflow occurs */ @Deprecated( message = "The 'Int' class no longer exists.", @@ -319,7 +335,9 @@ public val Int.years: Years get() = Years(this) /** - * Multiplies this value by a duration of years. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of years. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Int.times(years: Years): Years = years * this @@ -330,6 +348,8 @@ public val Long.years: Years get() = Years(this) /** - * Multiplies this value by a duration of years. @throws ArithmeticException if overflow occurs + * Multiplies this value by a duration of years. + * + * @throws ArithmeticException if overflow occurs */ public operator fun Long.times(years: Years): Years = years * this diff --git a/core/src/commonMain/kotlin/io/islandtime/Date.kt b/core/src/commonMain/kotlin/io/islandtime/Date.kt index 3378ba046..b37ce0589 100644 --- a/core/src/commonMain/kotlin/io/islandtime/Date.kt +++ b/core/src/commonMain/kotlin/io/islandtime/Date.kt @@ -311,14 +311,14 @@ class Date( /** * Creates a [Date] from a duration of days relative to the Unix epoch of 1970-01-01. * @param days the number of days relative to the Unix epoch - * @throws DateTimeException if outside of the supported date range + * @throws DateTimeException if outside the supported date range */ fun fromDaysSinceUnixEpoch(days: Days): Date = fromDayOfUnixEpoch(days.value) /** * Creates a [Date] from the day of the Unix epoch. * @param day the day of the Unix epoch - * @throws DateTimeException if outside of the supported date range + * @throws DateTimeException if outside the supported date range */ fun fromDayOfUnixEpoch(day: Long): Date { if (day !in -365243219162L..365241780471L) { @@ -439,7 +439,7 @@ internal inline fun withComponentizedDayOfUnixEpoch( ): T { var zeroDay = day + DAYS_FROM_0000_TO_1970 // find the march-based year - zeroDay -= 60 // adjust to 0000-03-01 so leap day is at end of four year cycle + zeroDay -= 60 // adjust to 0000-03-01 so leap day is at end of four-year cycle var adjust: Long = 0 if (zeroDay < 0) { // adjust negative years to positive for calculation diff --git a/core/src/commonMain/kotlin/io/islandtime/Month.kt b/core/src/commonMain/kotlin/io/islandtime/Month.kt index 4feea1132..0c6efb89b 100644 --- a/core/src/commonMain/kotlin/io/islandtime/Month.kt +++ b/core/src/commonMain/kotlin/io/islandtime/Month.kt @@ -134,8 +134,8 @@ enum class Month { fun lengthIn(year: Int): Days = lastDayIn(year).days /** - * Returns the day of the year that this month's first days falls on. This may vary depending on whether or not the - * year is a leap year. For example, the first day of [MARCH] will be either 60th or 61st day of the year. + * Returns the day of the year that this month's first days falls on. This may vary depending on whether the year is + * a leap year. For example, the first day of [MARCH] will be either 60th or 61st day of the year. * @param year retrieve the day of year number within this year * @return the first day of year number */ @@ -144,8 +144,8 @@ enum class Month { } /** - * Returns the day of the year that this month's last day falls on. This may vary depending on whether or not the - * year is a leap year. For example, the last of [FEBRUARY] will be either 59th or 60th day of the year. + * Returns the day of the year that this month's last day falls on. This may vary depending on whether the year is + * a leap year. For example, the last of [FEBRUARY] will be either 59th or 60th day of the year. * @param year retrieve the day of year number within this year * @return the last day of year number */ diff --git a/core/src/commonMain/kotlin/io/islandtime/Time.kt b/core/src/commonMain/kotlin/io/islandtime/Time.kt index 6259a56b2..227657bf8 100644 --- a/core/src/commonMain/kotlin/io/islandtime/Time.kt +++ b/core/src/commonMain/kotlin/io/islandtime/Time.kt @@ -290,7 +290,7 @@ class Time( * Creates a [Time] from the second of the day and optionally, the number of nanoseconds within that second. * * @param secondOfDay the second of the day - * @param nanosecond the nanosecond of the second, from 0 - 999,999,999 + * @param nanosecond the nanosecond of the second, from 0 to 999,999,999 * @return a new [Time] * @throws DateTimeException if the time is invalid */ diff --git a/core/src/commonMain/kotlin/io/islandtime/WeekDate.kt b/core/src/commonMain/kotlin/io/islandtime/WeekDate.kt index 32153294b..bcbf2542c 100644 --- a/core/src/commonMain/kotlin/io/islandtime/WeekDate.kt +++ b/core/src/commonMain/kotlin/io/islandtime/WeekDate.kt @@ -35,8 +35,8 @@ inline fun Date.toWeekDate(settings: WeekSettings, action: (year: Int, week: /** * Converts this date to a week date representation using the week definition associated with the provided [locale]. * - * Keep in mind that that the system's calendar settings may differ from that of the default locale on some platforms. - * To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + * Keep in mind that the system's calendar settings may differ from that of the default locale on some platforms. To + * respect the system calendar settings, use [WeekSettings.systemDefault] instead. */ inline fun Date.toWeekDate(locale: Locale, action: (year: Int, week: Int, day: Int) -> T): T { contract { callsInPlace(action, InvocationKind.EXACTLY_ONCE) } diff --git a/core/src/commonMain/kotlin/io/islandtime/format/DateTimeTextProvider.kt b/core/src/commonMain/kotlin/io/islandtime/format/DateTimeTextProvider.kt index 3616bb7c0..80044543c 100644 --- a/core/src/commonMain/kotlin/io/islandtime/format/DateTimeTextProvider.kt +++ b/core/src/commonMain/kotlin/io/islandtime/format/DateTimeTextProvider.kt @@ -19,7 +19,7 @@ interface DateTimeTextProvider { * @param style the style of the text * @param locale the locale * @return the localized text or `null` if unavailable - * @throws DateTimeException if the value if out of range for the specified field + * @throws DateTimeException if the value is out of range for the specified field */ fun textFor(field: DateTimeField, value: Long, style: TextStyle, locale: Locale): String? { return when (field) { diff --git a/core/src/commonMain/kotlin/io/islandtime/ranges/DateRange.kt b/core/src/commonMain/kotlin/io/islandtime/ranges/DateRange.kt index 5124861d6..07f07e831 100644 --- a/core/src/commonMain/kotlin/io/islandtime/ranges/DateRange.kt +++ b/core/src/commonMain/kotlin/io/islandtime/ranges/DateRange.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.Serializable /** * An inclusive range of dates. * - * [Date.MIN] and [Date.MAX] are used as sentinels to indicate an unbounded (ie. infinite) start or end. + * [Date.MIN] and [Date.MAX] are used as sentinels to indicate an unbounded (i.e. infinite) start or end. */ @Serializable(with = DateRangeIsoSerializer::class) class DateRange( @@ -68,7 +68,7 @@ class DateRange( val EMPTY: DateRange = DateRange(Date.fromDayOfUnixEpoch(1L), Date.fromDayOfUnixEpoch(0L)) /** - * An unbounded (ie. infinite) range of dates. + * An unbounded (i.e. infinite) range of dates. */ val UNBOUNDED: DateRange = DateRange(Date.MIN, Date.MAX) } @@ -126,7 +126,7 @@ fun String.toDateRange( } /** - * Creates a [DateRange] containing all of the days from this date up to, but not including [to]. + * Creates a [DateRange] containing all the days from this date up to, but not including [to]. */ infix fun Date.until(to: Date): DateRange = DateRange(this, to - 1.days) diff --git a/core/src/commonMain/kotlin/io/islandtime/ranges/DateTimeInterval.kt b/core/src/commonMain/kotlin/io/islandtime/ranges/DateTimeInterval.kt index 98429b515..29f025c68 100644 --- a/core/src/commonMain/kotlin/io/islandtime/ranges/DateTimeInterval.kt +++ b/core/src/commonMain/kotlin/io/islandtime/ranges/DateTimeInterval.kt @@ -12,7 +12,7 @@ import kotlinx.serialization.Serializable /** * An interval between two date-times, assumed to be at the same offset from UTC. * - * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (ie. infinite) start or end. + * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (i.e. infinite) start or end. */ @Serializable(with = DateTimeIntervalIsoSerializer::class) class DateTimeInterval( diff --git a/core/src/commonMain/kotlin/io/islandtime/ranges/InstantInterval.kt b/core/src/commonMain/kotlin/io/islandtime/ranges/InstantInterval.kt index ca194db05..9f5981838 100644 --- a/core/src/commonMain/kotlin/io/islandtime/ranges/InstantInterval.kt +++ b/core/src/commonMain/kotlin/io/islandtime/ranges/InstantInterval.kt @@ -12,7 +12,7 @@ import kotlinx.serialization.Serializable /** * A half-open interval between two instants. * - * [Instant.MIN] and [Instant.MAX] are used as sentinels to indicate an unbounded (ie. infinite) start or end. + * [Instant.MIN] and [Instant.MAX] are used as sentinels to indicate an unbounded (i.e. infinite) start or end. */ @Serializable(with = InstantIntervalIsoSerializer::class) class InstantInterval( diff --git a/core/src/commonMain/kotlin/io/islandtime/ranges/OffsetDateTimeInterval.kt b/core/src/commonMain/kotlin/io/islandtime/ranges/OffsetDateTimeInterval.kt index df2f82913..d35fd3b38 100644 --- a/core/src/commonMain/kotlin/io/islandtime/ranges/OffsetDateTimeInterval.kt +++ b/core/src/commonMain/kotlin/io/islandtime/ranges/OffsetDateTimeInterval.kt @@ -12,7 +12,7 @@ import kotlinx.serialization.Serializable /** * A half-open interval between two offset date-times based on timeline order. * - * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (ie. infinite) start or end. An + * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (i.e. infinite) start or end. An * [OffsetDateTime] with either as the date-time component will be treated accordingly, regardless of the offset. */ @Serializable(with = OffsetDateTimeIntervalIsoSerializer::class) diff --git a/core/src/commonMain/kotlin/io/islandtime/ranges/ZonedDateTimeInterval.kt b/core/src/commonMain/kotlin/io/islandtime/ranges/ZonedDateTimeInterval.kt index 017e3d033..1c34ccfd1 100644 --- a/core/src/commonMain/kotlin/io/islandtime/ranges/ZonedDateTimeInterval.kt +++ b/core/src/commonMain/kotlin/io/islandtime/ranges/ZonedDateTimeInterval.kt @@ -13,7 +13,7 @@ import kotlinx.serialization.Serializable /** * A half-open interval of zoned date-times based on timeline order. * - * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (ie. infinite) start or end. A + * [DateTime.MIN] and [DateTime.MAX] are used as sentinels to indicate an unbounded (i.e. infinite) start or end. A * [ZonedDateTime] with either as the date-time component will be treated accordingly, regardless of the offset or * time zone. */ diff --git a/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/DatePropertiesGenerator.kt b/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/DatePropertiesGenerator.kt index 0f07c27aa..d13855efa 100644 --- a/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/DatePropertiesGenerator.kt +++ b/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/DatePropertiesGenerator.kt @@ -82,8 +82,8 @@ private fun FileBuilder.buildDatePropertiesForClass(receiverClass: DateTimeDescr The ${intervalClass.simpleName} defining the week that this ${receiverClass.simpleName} falls within. The first day of the week will be the default associated with the provided [locale]. - Keep in mind that that the system's calendar settings may differ from that of the default locale on - some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + Keep in mind that the system's calendar settings may differ from that of the default locale on some + platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. """.trimIndent() } @@ -133,8 +133,8 @@ private fun FileBuilder.buildDatePropertiesForClass(receiverClass: DateTimeDescr The week of the month, from 0-6, calculated using the default week definition associated with the provided [locale]. - Keep in mind that that the system's calendar settings may differ from that of the default locale on - some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + Keep in mind that the system's calendar settings may differ from that of the default locale on some + platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. """.trimIndent() } @@ -214,8 +214,8 @@ private fun FileBuilder.buildDatePropertiesForClass(receiverClass: DateTimeDescr To obtain the week number of the week-based year, use [weekOfWeekBasedYear] instead. - Keep in mind that that the system's calendar settings may differ from that of the default locale on - some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + Keep in mind that the system's calendar settings may differ from that of the default locale on some + platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. @see weekOfWeekBasedYear """.trimIndent() @@ -292,8 +292,8 @@ private fun FileBuilder.buildDatePropertiesForClass(receiverClass: DateTimeDescr The week-based year, calculated using the week definition associated with the provided [locale]. This value differs from the regular ISO year when the week number falls in the preceding or following year. - Keep in mind that that the system's calendar settings may differ from that of the default locale on - some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + Keep in mind that the system's calendar settings may differ from that of the default locale on some + platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. @see weekOfWeekBasedYear """.trimIndent() @@ -367,8 +367,8 @@ private fun FileBuilder.buildDatePropertiesForClass(receiverClass: DateTimeDescr The week number of the week-based year, calculated using the week definition associated with the provided [locale]. - Keep in mind that that the system's calendar settings may differ from that of the default locale on - some platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. + Keep in mind that the system's calendar settings may differ from that of the default locale on some + platforms. To respect the system calendar settings, use [WeekSettings.systemDefault] instead. @see weekBasedYear """.trimIndent() diff --git a/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/TemporalUnitGenerator.kt b/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/TemporalUnitGenerator.kt index bfeb3f395..c1f10351a 100644 --- a/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/TemporalUnitGenerator.kt +++ b/tools/code-generator/src/main/kotlin/io/islandtime/codegen/generators/TemporalUnitGenerator.kt @@ -112,6 +112,7 @@ private fun buildTemporalUnitFile(description: TemporalUnitDescription) = file( kdoc { """ The absolute value of this duration. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -200,6 +201,7 @@ private fun buildTemporalUnitFile(description: TemporalUnitDescription) = file( kdoc { """ Negates this duration. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -233,6 +235,7 @@ private fun buildTemporalUnitFile(description: TemporalUnitDescription) = file( kdoc { """ Converts this duration to an `Int` value. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -254,6 +257,7 @@ private fun buildTemporalUnitFile(description: TemporalUnitDescription) = file( kdoc { """ Converts this duration to [${description.deprecatedIntName}]. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -433,6 +437,7 @@ private fun ClassBuilder.buildTimesFunction(scalarPrimitive: KClass<*>, descript kdoc { """ Multiplies this duration by a scalar value. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -453,6 +458,7 @@ private fun ClassBuilder.buildDivFunction(scalarPrimitive: KClass<*>, descriptio kdoc { """ Returns this duration divided by a scalar value. + @throws ArithmeticException if overflow occurs or the scalar is zero """.trimIndent() } @@ -537,6 +543,7 @@ private fun ClassBuilder.buildInSmallerUnitConversionProperties( kdoc { """ Converts this duration to ${conversion.toUnit.lowerPluralName}. + @throws ArithmeticException if overflow occurs """.trimIndent() } @@ -689,6 +696,7 @@ private fun FileBuilder.buildTimesExtensionFunction(scalarPrimitive: KClass<*>, kdoc { """ Multiplies this value by a duration of ${description.lowerPluralName}. + @throws ArithmeticException if overflow occurs """.trimIndent() }