|
46 | 46 | * @author © Eliyahu Hershfeld 2011 - 2020
|
47 | 47 | */
|
48 | 48 | public class JewishCalendar extends JewishDate {
|
| 49 | + /** The 14th day of Nisan, the day before of Pesach (Passover).*/ |
49 | 50 | public static final int EREV_PESACH = 0;
|
| 51 | + /** The holiday of Pesach (Passover) on the 15th (and 16th out of Israel) day of Nisan.*/ |
50 | 52 | public static final int PESACH = 1;
|
| 53 | + /** Chol Hamoed (interim days) of Pesach (Passover)*/ |
51 | 54 | public static final int CHOL_HAMOED_PESACH = 2;
|
| 55 | + /**Pesach Sheni, the 14th day of Iyar, a minor holiday.*/ |
52 | 56 | public static final int PESACH_SHENI = 3;
|
| 57 | + /**Erev Shavuos (the day before Shavuos), the 5th of Sivan*/ |
53 | 58 | public static final int EREV_SHAVUOS = 4;
|
| 59 | + /**Shavuos (Pentecost), the 6th of Sivan*/ |
54 | 60 | public static final int SHAVUOS = 5;
|
| 61 | + /** The fast of the 17th day of Tamuz*/ |
55 | 62 | public static final int SEVENTEEN_OF_TAMMUZ = 6;
|
| 63 | + /** The fast of the 9th of Av*/ |
56 | 64 | public static final int TISHA_BEAV = 7;
|
| 65 | + /** The 15th day of Av, a minor holiday*/ |
57 | 66 | public static final int TU_BEAV = 8;
|
| 67 | + /**Erev Rosh Hashana (the day before Rosh Hashana), the 29th of Elul*/ |
58 | 68 | public static final int EREV_ROSH_HASHANA = 9;
|
| 69 | + /** Rosh Hashana, the first of Tishrei.*/ |
59 | 70 | public static final int ROSH_HASHANA = 10;
|
| 71 | + /** The fast of Gedalyah, the 3rd of Tishrei.*/ |
60 | 72 | public static final int FAST_OF_GEDALYAH = 11;
|
| 73 | + /** The 9th day of Tishrei, the day before of Yom Kippur.*/ |
61 | 74 | public static final int EREV_YOM_KIPPUR = 12;
|
| 75 | + /** The holiday of Yom Kippur, the 10th day of Tishrei*/ |
62 | 76 | public static final int YOM_KIPPUR = 13;
|
| 77 | + /** The 14th day of Tishrei, the day before of Succos/Sukkos (Tabernacles).*/ |
63 | 78 | public static final int EREV_SUCCOS = 14;
|
| 79 | + /** The holiday of Succos/Sukkos (Tabernacles), the 15th (and 16th out of Israel) day of Tishrei */ |
64 | 80 | public static final int SUCCOS = 15;
|
| 81 | + /** Chol Hamoed (interim days) of Succos/Sukkos (Tabernacles)*/ |
65 | 82 | public static final int CHOL_HAMOED_SUCCOS = 16;
|
| 83 | + /** Hoshana Rabba, the 7th day of Succos/Sukkos that occurs on the 21st of Tishrei. */ |
66 | 84 | public static final int HOSHANA_RABBA = 17;
|
| 85 | + /** Shmini Atzeres, the 8th day of Succos/Sukkos is an independent holiday that occurs on the 22nd of Tishrei. */ |
67 | 86 | public static final int SHEMINI_ATZERES = 18;
|
| 87 | + /** Simchas Torah, the 9th day of Succos/Sukkos, or the second day of Shmini Atzeres that is celebrated |
| 88 | + * {@link #getInIsrael() out of Israel} on the 23rd of Tishrei. |
| 89 | + */ |
68 | 90 | public static final int SIMCHAS_TORAH = 19;
|
69 | 91 | // public static final int EREV_CHANUKAH = 20;// probably remove this
|
| 92 | + /** The holiday of Chanukah. 8 days starting on the 25th day Kislev.*/ |
70 | 93 | public static final int CHANUKAH = 21;
|
| 94 | + /** The fast of the 10th day of Teves.*/ |
71 | 95 | public static final int TENTH_OF_TEVES = 22;
|
| 96 | + /** Tu Bishvat on the 15th day of Shevat, a minor holiday.*/ |
72 | 97 | public static final int TU_BESHVAT = 23;
|
| 98 | + /** The fast of Esther, usually on the 13th day of Adar (or Adar II on leap years). It is earlier on some years.*/ |
73 | 99 | public static final int FAST_OF_ESTHER = 24;
|
| 100 | + /** The holiday of Purim on the 14th day of Adar (or Adar II on leap years).*/ |
74 | 101 | public static final int PURIM = 25;
|
| 102 | + /** The holiday of Shushan Purim on the 15th day of Adar (or Adar II on leap years).*/ |
75 | 103 | public static final int SHUSHAN_PURIM = 26;
|
| 104 | + /** The holiday of Purim Katan on the 14th day of Adar I on a leap year when Purim is on Adar II, a minor holiday.*/ |
76 | 105 | public static final int PURIM_KATAN = 27;
|
| 106 | + /** |
| 107 | + * Rosh Chodesh, the new moon on the first day of the Jewish month, and the 30th day of the previous month in the |
| 108 | + * case of a month with 30 days. |
| 109 | + */ |
77 | 110 | public static final int ROSH_CHODESH = 28;
|
| 111 | + /** Yom HaShoah, Holocaust Remembrance Day, usually held on the 27th of Nisan. If it falls on a Friday, it is moved |
| 112 | + * to the 26th, and if it falls on a Sunday it is moved to the 28th. A {@link #isUseModernHolidays() modern holiday}. |
| 113 | + */ |
78 | 114 | public static final int YOM_HASHOAH = 29;
|
| 115 | + /** |
| 116 | + * Yom HaZikaron, Israeli Memorial Day, held a day before Yom Ha'atzmaut. A {@link #isUseModernHolidays() modern holiday}. |
| 117 | + */ |
79 | 118 | public static final int YOM_HAZIKARON = 30;
|
| 119 | + |
| 120 | + /** Yom Ha'atzmaut, Israel Independence Day, the 5th of Iyar, but if it occurs on a Friday or Saturday, the holiday is |
| 121 | + * moved back to Thursday, the 3rd of 4th of Iyar, and if it falls on a Monday, it is moved forward to Tuesday the |
| 122 | + * 6th of Iyar. A {@link #isUseModernHolidays() modern holiday}.*/ |
80 | 123 | public static final int YOM_HAATZMAUT = 31;
|
| 124 | + /** |
| 125 | + * Yom Yerushalayim or Jerusalem Day, on 28 Iyar. A {@link #isUseModernHolidays() modern holiday}. |
| 126 | + */ |
81 | 127 | public static final int YOM_YERUSHALAYIM = 32;
|
| 128 | + |
| 129 | + /** The 33rd day of the Omer, the 18th of Iyar, a minor holiday.*/ |
82 | 130 | public static final int LAG_BAOMER = 33;
|
| 131 | + |
| 132 | + /** The holiday of Purim Katan on the 15th day of Adar I on a leap year when Purim is on Adar II, a minor holiday.*/ |
83 | 133 | public static final int SHUSHAN_PURIM_KATAN = 34;
|
84 | 134 |
|
| 135 | + /** |
| 136 | + * Is the calendar set to Israel, where some holidays have different rules. |
| 137 | + * @see #getInIsrael() |
| 138 | + * @see #setInIsrael(boolean) |
| 139 | + */ |
85 | 140 | private boolean inIsrael = false;
|
| 141 | + |
| 142 | + /** |
| 143 | + * Is the calendar set to use modern Israeli holidays such as Yom Haatzmaut. |
| 144 | + * @see #isUseModernHolidays() |
| 145 | + * @see #setUseModernHolidays(boolean) |
| 146 | + */ |
86 | 147 | private boolean useModernHolidays = false;
|
87 | 148 |
|
88 | 149 | /**
|
89 |
| - * The {@link #VZOS_HABERACHA} enum exists for consistency, but is not currently used. |
| 150 | + * List of <em>parshiyos</em>. {@link #NONE} indicates a week without a <em>parsha</em>, while the enum for the <em>parsha</em> of |
| 151 | + * {@link #VZOS_HABERACHA} exists for consistency, but is not currently used. |
90 | 152 | */
|
91 | 153 | public static enum Parsha {
|
92 |
| - NONE, BERESHIS, NOACH, LECH_LECHA, VAYERA, CHAYEI_SARA, TOLDOS, VAYETZEI, VAYISHLACH, VAYESHEV, MIKETZ, VAYIGASH, VAYECHI, SHEMOS, VAERA, BO, BESHALACH, YISRO, MISHPATIM, TERUMAH, TETZAVEH, KI_SISA, VAYAKHEL, PEKUDEI, VAYIKRA, TZAV, SHMINI, TAZRIA, METZORA, ACHREI_MOS, KEDOSHIM, EMOR, BEHAR, BECHUKOSAI, BAMIDBAR, NASSO, BEHAALOSCHA, SHLACH, KORACH, CHUKAS, BALAK, PINCHAS, MATOS, MASEI, DEVARIM, VAESCHANAN, EIKEV, REEH, SHOFTIM, KI_SEITZEI, KI_SAVO, NITZAVIM, VAYEILECH, HAAZINU, VZOS_HABERACHA, VAYAKHEL_PEKUDEI, TAZRIA_METZORA, ACHREI_MOS_KEDOSHIM, BEHAR_BECHUKOSAI, CHUKAS_BALAK, MATOS_MASEI, NITZAVIM_VAYEILECH, SHKALIM, ZACHOR, PARA, HACHODESH |
| 154 | + /**NONE A week without any <em>parsha</em> such as <em>Shabbos Chol Hamoed</em> */NONE, |
| 155 | + /**BERESHIS*/BERESHIS, /**NOACH*/NOACH, /**LECH_LECHA*/LECH_LECHA, /**VAYERA*/VAYERA, /**CHAYEI_SARA*/CHAYEI_SARA, /**TOLDOS*/TOLDOS, |
| 156 | + /**VAYETZEI*/VAYETZEI, /**VAYISHLACH*/VAYISHLACH, /**VAYESHEV*/VAYESHEV, /**MIKETZ*/MIKETZ, /**VAYIGASH*/VAYIGASH, /**VAYECHI*/VAYECHI, |
| 157 | + /**SHEMOS*/SHEMOS, /**VAERA*/VAERA, /**BO*/BO, /**BESHALACH*/BESHALACH, /**YISRO*/YISRO, /**MISHPATIM*/MISHPATIM, /**TERUMAH*/TERUMAH, |
| 158 | + /**TETZAVEH*/TETZAVEH, /***KI_SISA*/KI_SISA, /**VAYAKHEL*/VAYAKHEL, /**PEKUDEI*/PEKUDEI, /**VAYIKRA*/VAYIKRA, /**TZAV*/TZAV, /**SHMINI*/SHMINI, |
| 159 | + /**TAZRIA*/TAZRIA, /**METZORA*/METZORA, /**ACHREI_MOS*/ACHREI_MOS, /**KEDOSHIM*/KEDOSHIM, /**EMOR*/EMOR, /**BEHAR*/BEHAR, /**BECHUKOSAI*/BECHUKOSAI, |
| 160 | + /**BAMIDBAR*/BAMIDBAR, /**NASSO*/NASSO, /**BEHAALOSCHA*/BEHAALOSCHA, /**SHLACH*/SHLACH, /**KORACH*/KORACH, /**CHUKAS*/CHUKAS, /**BALAK*/BALAK, |
| 161 | + /**PINCHAS*/PINCHAS, /**MATOS*/MATOS, /**MASEI*/MASEI, /**DEVARIM*/DEVARIM, /**VAESCHANAN*/VAESCHANAN, /**EIKEV*/EIKEV, /**REEH*/REEH, |
| 162 | + /**SHOFTIM*/SHOFTIM, /**KI_SEITZEI*/KI_SEITZEI, /**KI_SAVO*/KI_SAVO, /**NITZAVIM*/NITZAVIM, /**VAYEILECH*/VAYEILECH, /**HAAZINU*/HAAZINU, |
| 163 | + /**VZOS_HABERACHA*/VZOS_HABERACHA, /**The double parsha of Vayakhel & Peudei*/VAYAKHEL_PEKUDEI, /**The double <em>parsha</em> of Tazria |
| 164 | + * & Metzora*/TAZRIA_METZORA,/**The double <em>parsha</em> of Achrei Mos & Kedoshim*/ACHREI_MOS_KEDOSHIM,/**The double <em>parsha</em> |
| 165 | + * of Behar & Bechukosai*/BEHAR_BECHUKOSAI,/**The double <em>parsha</em> of Chukas & Balak*/CHUKAS_BALAK, /**The double |
| 166 | + * <em>parsha</em> of Matos & Masei*/MATOS_MASEI,/**The double <em>parsha</em> of Nitzavim & Vayelech*/NITZAVIM_VAYEILECH, |
| 167 | + /**The special <em>parsha</em> of Shekalim*/SHKALIM, /** The special <em>parsha</em> of Zachor*/ZACHOR, /**The special <em>parsha</em> of |
| 168 | + * Para*/PARA, /** The special <em>parsha</em> of Hachodesh*/HACHODESH |
93 | 169 | };
|
| 170 | + |
| 171 | + /** |
| 172 | + * An array of <em>parshiyos</em> in the 17 possible combinations. |
| 173 | + */ |
94 | 174 | public static final Parsha[][] parshalist = {
|
95 | 175 | {Parsha.NONE, Parsha.VAYEILECH, Parsha.HAAZINU, Parsha.NONE, Parsha.BERESHIS, Parsha.NOACH, Parsha.LECH_LECHA, Parsha.VAYERA, Parsha.CHAYEI_SARA, Parsha.TOLDOS, Parsha.VAYETZEI, Parsha.VAYISHLACH, Parsha.VAYESHEV, Parsha.MIKETZ, Parsha.VAYIGASH, Parsha.VAYECHI, Parsha.SHEMOS, Parsha.VAERA, Parsha.BO, Parsha.BESHALACH, Parsha.YISRO, Parsha.MISHPATIM, Parsha.TERUMAH, Parsha.TETZAVEH, Parsha.KI_SISA, Parsha.VAYAKHEL_PEKUDEI, Parsha.VAYIKRA, Parsha.TZAV, Parsha.NONE, Parsha.SHMINI, Parsha.TAZRIA_METZORA, Parsha.ACHREI_MOS_KEDOSHIM, Parsha.EMOR, Parsha.BEHAR_BECHUKOSAI, Parsha.BAMIDBAR, Parsha.NASSO, Parsha.BEHAALOSCHA, Parsha.SHLACH, Parsha.KORACH, Parsha.CHUKAS, Parsha.BALAK, Parsha.PINCHAS, Parsha.MATOS_MASEI, Parsha.DEVARIM, Parsha.VAESCHANAN, Parsha.EIKEV, Parsha.REEH, Parsha.SHOFTIM, Parsha.KI_SEITZEI, Parsha.KI_SAVO, Parsha.NITZAVIM_VAYEILECH},
|
96 | 176 | {Parsha.NONE, Parsha.VAYEILECH, Parsha.HAAZINU, Parsha.NONE, Parsha.BERESHIS, Parsha.NOACH, Parsha.LECH_LECHA, Parsha.VAYERA, Parsha.CHAYEI_SARA, Parsha.TOLDOS, Parsha.VAYETZEI, Parsha.VAYISHLACH, Parsha.VAYESHEV, Parsha.MIKETZ, Parsha.VAYIGASH, Parsha.VAYECHI, Parsha.SHEMOS, Parsha.VAERA, Parsha.BO, Parsha.BESHALACH, Parsha.YISRO, Parsha.MISHPATIM, Parsha.TERUMAH, Parsha.TETZAVEH, Parsha.KI_SISA, Parsha.VAYAKHEL_PEKUDEI, Parsha.VAYIKRA, Parsha.TZAV, Parsha.NONE, Parsha.SHMINI, Parsha.TAZRIA_METZORA, Parsha.ACHREI_MOS_KEDOSHIM, Parsha.EMOR, Parsha.BEHAR_BECHUKOSAI, Parsha.BAMIDBAR, Parsha.NONE, Parsha.NASSO, Parsha.BEHAALOSCHA, Parsha.SHLACH, Parsha.KORACH, Parsha.CHUKAS_BALAK, Parsha.PINCHAS, Parsha.MATOS_MASEI, Parsha.DEVARIM, Parsha.VAESCHANAN, Parsha.EIKEV, Parsha.REEH, Parsha.SHOFTIM, Parsha.KI_SEITZEI, Parsha.KI_SAVO, Parsha.NITZAVIM_VAYEILECH},
|
|
0 commit comments