Package net.hebrewcalendar.learning
Class Haftarah
- java.lang.Object
-
- net.hebrewcalendar.learning.Haftarah
-
public final class Haftarah extends Object
Resolves which haftarah to read on the upcoming Shabbat for a given date, respecting the opentorah precedence rules encoded inSpecialReadings.scala:Yom Tov > Special Parsha > Chanukah > Rosh Chodesh > Machar Chodesh > weekly parsha.
The C library carries an independent port of these same rules (hc_haftarah.c) for the Flutter app; the two are kept in step deliberately rather than one calling the other. If you change the precedence here, change it there too. Known gap in both: opentorah'sshabbatAdditionalHaftarah— the extra verses Chabad and Fes append when a Rosh Chodesh or Machar Chodesh haftarah is displaced by a higher-precedence reading — is not applied.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHaftarah.OccasionOccasion labels that mirror opentorah's SpecialReadings objects.static classHaftarah.ResultResult: the occasion driving this haftarah + one or more references.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Haftarah.ResultforDate(LocalDate date, Custom custom, boolean inIsrael)static List<Haftarah.Result>forDay(LocalDate date, Custom custom, boolean inIsrael)All haftarah readings that fall ON this specific date (not the upcoming Shabbat).static LocalDateupcomingShabbat(LocalDate date)Upcoming (or same-day) Shabbat for a Gregorian date.
-
-
-
Method Detail
-
upcomingShabbat
public static LocalDate upcomingShabbat(LocalDate date)
Upcoming (or same-day) Shabbat for a Gregorian date.
-
forDay
public static List<Haftarah.Result> forDay(LocalDate date, Custom custom, boolean inIsrael)
All haftarah readings that fall ON this specific date (not the upcoming Shabbat). Empty list on days without a haftarah.- Shabbat → one Result (weekly or a special-day override)
- Yom Tov weekday → one Result (festival haftarah)
- Yom Kippur → two Results (morning + afternoon)
- Tisha B'Av → two Results (morning + afternoon)
- Other public fasts → one Result (afternoon only)
- Chol HaMoed / regular weekday → empty
-
forDate
public static Haftarah.Result forDate(LocalDate date, Custom custom, boolean inIsrael)
-
-