public class ByDay extends ByRuleAbstract<ByDay.ByDayPair,ByDay>
BYDAY from RFC 5545, iCalendar 3.3.10, page 40
The BYDAY rule part specifies a COMMA-separated list of days of the week; SU indicates Sunday; MO indicates Monday; TU indicates Tuesday; WE indicates Wednesday; TH indicates Thursday; FR indicates Friday; and SA indicates Saturday.
Each BYDAY value can also be preceded by a positive (+n) or negative (-n) integer. If present, this indicates the nth occurrence of a specific day within the MONTHLY or YEARLY "RRULE".
For example, within a MONTHLY rule, +1MO (or simply 1MO) represents the first Monday within the month, whereas -1MO represents the last Monday of the month. The numeric value in a BYDAY rule part with the FREQ rule part set to YEARLY corresponds to an offset within the month when the BYMONTH rule part is present, and corresponds to an offset within the year when the BYWEEKNO or BYMONTH rule parts are present. If an integer modifier is not present, it means all days of this type within the specified frequency. For example, within a MONTHLY rule, MO represents all Mondays within the month. The BYDAY rule part MUST NOT be specified with a numeric value when the FREQ rule part is not set to MONTHLY or YEARLY. Furthermore, the BYDAY rule part MUST NOT be specified with a numeric value with the FREQ rule part set to YEARLY when the BYWEEKNO rule part is specified.
Element value is a ByDayPair that contains a DayOfWeek and an optional ordinal int. if the ordinal int is 0 then it is ignored and all values matching the DayOfWeek are included.
Type | Property and Description |
---|---|
javafx.beans.property.ObjectProperty<java.time.DayOfWeek> |
weekStart
Start of week - default start of week is Monday
|
valueProperty
valueProperty
Modifier and Type | Class and Description |
---|---|
static class |
ByDay.ByDayPair
Contains both the day of the week and an optional positive or negative integer (ordinal).
|
Constructor and Description |
---|
ByDay()
Parse iCalendar compliant list of days of the week.
|
ByDay(ByDay.ByDayPair... byDayPairs) |
ByDay(ByDay source) |
ByDay(java.util.Collection<java.time.DayOfWeek> daysOfWeek)
Constructor that uses
DayofWeek Collection. |
ByDay(java.time.DayOfWeek... daysOfWeek)
Constructor that uses
DayofWeek values without a preceding integer. |
Modifier and Type | Method and Description |
---|---|
boolean |
addDayOfWeek(java.time.DayOfWeek dayOfWeek)
add individual
DayofWeek , without ordinal value, to BYDAY rule |
java.util.List<java.time.DayOfWeek> |
dayOfWeekWithoutOrdinalList()
Return a list of days of the week that don’t have an ordinal (as every FRIDAY)
|
java.time.DayOfWeek |
getWeekStart() |
boolean |
hasOrdinals()
Checks if byDayPairs has ordinal values.
|
static ByDay |
parse(java.lang.String content) |
java.util.List<java.lang.String> |
parseContent(java.lang.String dayPairs)
Parse content line into calendar element.
|
boolean |
removeDayOfWeek(java.time.DayOfWeek dayOfWeek)
remove individual DayofWeek from BYDAY rule
|
boolean |
replaceDayOfWeek(java.time.DayOfWeek originalDayOfWeek,
java.time.DayOfWeek replacemenDayOfWeekt)
Replace individual
DayofWeek in BYDAY rule
If ByDay.ByDayPair contains a non-zero ordinal, the replacement contains the same ordinal value
Note: a zero ordinal means include all matching DayofWeek values |
java.util.stream.Stream<java.time.temporal.Temporal> |
streamRecurrences(java.util.stream.Stream<java.time.temporal.Temporal> inStream,
java.time.temporal.ChronoUnit chronoUnit,
java.time.temporal.Temporal dateTimeStart)
New stream of date/times made after applying rule that either filters out some date/times
or adds additional date/times.
|
java.lang.String |
toContent()
return element name-value pair string separated by an "="
for example:
FREQ=DAILY
|
javafx.beans.property.ObjectProperty<java.time.DayOfWeek> |
weekStartProperty()
Start of week - default start of week is Monday
|
compareTo, equals, errors, hashCode, setValue, setValue, setValue, toString, withValue, withValue
elementType, getParent, getValue, name, setParent, valueProperty, withValue
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChronoUnit
elementType, getValue, valueProperty
public javafx.beans.property.ObjectProperty<java.time.DayOfWeek> weekStartProperty
Start of week - default start of week is Monday
getWeekStart()
public ByDay()
Parse iCalendar compliant list of days of the week. For example 1MO,2TU,4SA
public ByDay(ByDay.ByDayPair... byDayPairs)
public ByDay(ByDay source)
public ByDay(java.time.DayOfWeek... daysOfWeek)
Constructor that uses DayofWeek
values without a preceding integer. All days of the
provided types are included within the specified frequency
public ByDay(java.util.Collection<java.time.DayOfWeek> daysOfWeek)
Constructor that uses DayofWeek
Collection. No ordinals are allowed.
public javafx.beans.property.ObjectProperty<java.time.DayOfWeek> weekStartProperty()
Start of week - default start of week is Monday
getWeekStart()
public java.time.DayOfWeek getWeekStart()
public boolean hasOrdinals()
Checks if byDayPairs has ordinal values. If so returns true, otherwise false
public boolean addDayOfWeek(java.time.DayOfWeek dayOfWeek)
add individual DayofWeek
, without ordinal value, to BYDAY rule
dayOfWeek
- DayofWeek
to add, without ordinalpublic boolean removeDayOfWeek(java.time.DayOfWeek dayOfWeek)
remove individual DayofWeek from BYDAY rule
dayOfWeek
- DayofWeek
to removepublic boolean replaceDayOfWeek(java.time.DayOfWeek originalDayOfWeek, java.time.DayOfWeek replacemenDayOfWeekt)
Replace individual DayofWeek
in BYDAY rule
If ByDay.ByDayPair
contains a non-zero ordinal, the replacement contains the same ordinal value
Note: a zero ordinal means include all matching DayofWeek
values
original
- DayofWeek
to removereplacement
- DayofWeek
to addpublic java.util.List<java.time.DayOfWeek> dayOfWeekWithoutOrdinalList()
Return a list of days of the week that don’t have an ordinal (as every FRIDAY)
public java.lang.String toContent()
RRuleElement
return element name-value pair string separated by an "=" for example: FREQ=DAILY
public java.util.stream.Stream<java.time.temporal.Temporal> streamRecurrences(java.util.stream.Stream<java.time.temporal.Temporal> inStream, java.time.temporal.ChronoUnit chronoUnit, java.time.temporal.Temporal dateTimeStart)
ByRule
New stream of date/times made after applying rule that either filters out some date/times or adds additional date/times.
streamRecurrences
in interface ByRule<javafx.collections.ObservableList<ByDay.ByDayPair>>
streamRecurrences
in class ByRuleAbstract<ByDay.ByDayPair,ByDay>
inStream
- - Current stream to be added to or subtracted fromchronoUnit
- - ChronoUnit of last modification to inStreampublic java.util.List<java.lang.String> parseContent(java.lang.String dayPairs)
VElement
Parse content line into calendar element.
If element contains children VElement.parseContent(String)
is invoked recursively to parse child elements also
dayPairs
- calendar content string to parsepublic static ByDay parse(java.lang.String content)