Frequency

sealed class Frequency

Represents different frequency types for scheduling events.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Daily(val time: LocalTime, val interval: Int) : Frequency

Daily frequency at a specific time.

Link copied to clipboard
data class Monthly(val dayOfMonth: Int, val time: LocalTime, val interval: Int) : Frequency

Monthly frequency on a specific day and time.

Link copied to clipboard
Link copied to clipboard

Represents the types of frequency intervals available for scheduling events.

Link copied to clipboard
data class Weekly(val dayOfWeek: DayOfWeek, val time: LocalTime, val interval: Int) : Frequency

Weekly frequency on a specific day and time.

Link copied to clipboard
data class Yearly(val month: Month, val dayOfMonth: Int, val time: LocalTime, val interval: Int) : Frequency

Yearly frequency on a specific month, day, and time.

Properties

Link copied to clipboard
abstract val duration: DateTimePeriod

Calendar period between occurrences. Month and year periods depend on the date they are applied to.

Link copied to clipboard
abstract val interval: Int
Link copied to clipboard
abstract val time: LocalTime
Link copied to clipboard
abstract val type: Frequency.Type

Functions

Link copied to clipboard
fun calcNextOccurrence(timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDateTime

Calculates the next occurrence after the current time.

abstract fun calcNextOccurrence(after: LocalDateTime, timeZone: TimeZone = TimeZone.currentSystemDefault()): LocalDateTime

Calculates the first occurrence strictly after after, based on the frequency settings.

Link copied to clipboard