Class MonthDaySpecialDay<C extends ICalendar<C>>

  • All Implemented Interfaces:
    SpecialDay<C>

    public class MonthDaySpecialDay<C extends ICalendar<C>>
    extends AbstractRecurringSpecialDay<C>
    Represents a holiday that occurs yearly on the same date. It is initialized with month and day.
    • Constructor Detail

      • MonthDaySpecialDay

        public MonthDaySpecialDay​(C calendar,
                                  String name,
                                  int month,
                                  int day)
        Parameters:
        month - month. This can be negative to indicate the count of months from end of year, e.g. month -1 is the last month of the year. This can be useful for Hebrew year, which has variable number of months, e.g. Purim is always in the last month before Nisan, which can be either ADAR or ADAR_2. 0 can be used to indicate ANY month, e.g. month=0, day=1 will match first day of every month.
        day - day of month. This can be negative to indicate the count of days from end of month, e.g. -1 will indicate the LAST day of month. day=0 can be used to match ANY day of the month, e.g. month=4, day = 0 will match the entire April in Gregorian calendar.
    • Method Detail

      • getDayOfMonth

        public final int getDayOfMonth()
      • getMonth

        public final int getMonth()
      • matches

        public boolean matches​(IDate<C> date)
        Parameters:
        date - date to compare
        Returns:
        true if and only if this holiday occurs on the given date