Skip to content

Commit

Permalink
YomiCalculator - add default constructor to avoid warnings on recent …
Browse files Browse the repository at this point in the history
…JDKs

- add default constructor to avoid warnings on recent JDKs
- Minor whitespace and documentation changes
  • Loading branch information
KosherJava authored Jan 1, 2025
1 parent da7f3b7 commit 84472a6
Showing 1 changed file with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Zmanim Java API
* Copyright (C) 2011-2020 Eliyahu Hershfeld
* Copyright (C) 2011-2025 Eliyahu Hershfeld
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
Expand All @@ -23,7 +23,7 @@
* use the {@link YerushalmiYomiCalculator}. The library may cover Mishna Yomi etc. at some point in the future.
*
* @author © Bob Newell (original C code)
* @author © Eliyahu Hershfeld 2011 - 2020
* @author © Eliyahu Hershfeld 2011 - 2025
*/
public class YomiCalculator {

Expand All @@ -43,6 +43,13 @@ public class YomiCalculator {
* @see #getDafYomiBavli(JewishCalendar) for details.
*/
private static final int shekalimJulianChangeDay = getJulianDay(shekalimChangeDay);

/**
* Default constructor.
*/
public YomiCalculator() {
// nothing here
}

/**
* Returns the <a href="http://en.wikipedia.org/wiki/Daf_yomi">Daf Yomi</a> <a
Expand All @@ -52,7 +59,7 @@ public class YomiCalculator {
* that a change in length of the cycle was instituted starting in the eighth Daf Yomi cycle beginning on June 24,
* 1975. The Daf Yomi Bavli cycle has a single masechta of the Talmud Yerushalmi - Shekalim as part of the cycle.
* Unlike the Bavli where the number of daf per masechta was standardized since the original <a
* href="http://en.wikipedia.org/wiki/Daniel_Bomberg">Bomberg Edition</a> published from 1520 to 1523, there is no
* href="http://en.wikipedia.org/wiki/Daniel_Bomberg">Bomberg Edition</a> published from 1520 - 1523, there is no
* uniform page length in the Yerushalmi. The early cycles had the Yerushalmi Shekalim length of 13 days following the
* <a href=
* "https://he.wikipedia.org/wiki/%D7%93%D7%A4%D7%95%D7%A1_%D7%A1%D7%9C%D7%90%D7%95%D7%95%D7%99%D7%98%D7%90">Slavuta/Zhytomyr</a>
Expand All @@ -66,7 +73,7 @@ public class YomiCalculator {
* @return the {@link Daf}.
*
* @throws IllegalArgumentException
* if the date is prior to the September 11, 1923, start date of the first Daf Yomi cycle
* if the date is prior to the September 11, 1923, the start date of the first Daf Yomi cycle.
*/
public static Daf getDafYomiBavli(JewishCalendar jewishCalendar) {
/*
Expand Down Expand Up @@ -103,24 +110,25 @@ public static Daf getDafYomiBavli(JewishCalendar jewishCalendar) {
if (cycleNo <= 7) {
blattPerMasechta[4] = 13;
}

// Finally find the daf.
for (int i : blattPerMasechta) {
masechta++;
total = total + i - 1;
if (dafNo < total) {
blatt = 1 + i - (total - dafNo);
// Fiddle with the weird ones near the end.
if (masechta == 36) {
blatt += 21;
} else if (masechta == 37) {
blatt += 24;
} else if (masechta == 38) {
blatt += 32;
}
dafYomi = new Daf(masechta, blatt);
break;
}
}
for (int i : blattPerMasechta) {
masechta++;
total = total + i - 1;
if (dafNo < total) {
blatt = 1 + i - (total - dafNo);
// Fiddle with the weird ones near the end.
if (masechta == 36) {
blatt += 21;
} else if (masechta == 37) {
blatt += 24;
} else if (masechta == 38) {
blatt += 32;
}
dafYomi = new Daf(masechta, blatt);
break;
}
}

return dafYomi;
}
Expand Down

0 comments on commit 84472a6

Please sign in to comment.