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

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 interval: Int
Link copied to clipboard
abstract val time: LocalTime
Link copied to clipboard
abstract val type: Frequency.Type

Functions

Link copied to clipboard
abstract fun calcNextOccurrence(from: LocalDate, timeZone: TimeZone = TimeZone.currentSystemDefault(), offset: Int = 0): LocalDateTime

Calculates the next occurrence of the event based on the frequency settings.

Link copied to clipboard
fun calcNextOccurrences(from: LocalDate, count: Int, offset: Int = 0, timeZone: TimeZone = TimeZone.currentSystemDefault()): List<LocalDateTime>

Calculates the next count occurrences of the event based on the frequency settings.

Link copied to clipboard