LunarPhaseSequence

class LunarPhaseSequence(start: Instant, limit: Duration = 365.days, requestedLunarPhases: List<LunarPhase.Primary> = LunarPhase.Primary.all, reverse: Boolean = false) : Sequence<LunarEvent.PhaseEvent>

Sequence representing all LunarEvent.PhaseEvents supported by Kastro. The sequence will be ordered by LunarEvent.time with times farthest in the future being later in the Sequence. As implied by being a Sequence

As implied by being a Sequence values will be lazily calculated so setting a large or even infinite limit is acceptable.

Parameters

start

Time representing the beginning of the sequence

limit

Point at which the sequence will end. If you wish for an infinite sequence simply put Duration.INFINITE for limit. Calculations are done lazily so requesting an infinite sequence is not harmful. Limit only exists to allow certain logical checks such as if you wanted to know if there will be any event in the next hour you could use limit and then check if the resulting sequence is empty. Defaults to 365 days.

requestedLunarPhases

List of LunarPhase.Primary events to be included in the sequence. Providing only the phases you are interested in can save computation resources. Defaults to LunarPhase.Primary.all.

reverse

Whether the sequence should advance in reverse chronological order. By default, this is false

Constructors

Link copied to clipboard
constructor(start: Instant, limit: Duration = 365.days, requestedLunarPhases: List<LunarPhase.Primary> = LunarPhase.Primary.all, reverse: Boolean = false)

Functions

Link copied to clipboard
open operator override fun iterator(): Iterator<LunarEvent.PhaseEvent>