|
32 | 32 | * href="http://en.wikipedia.org/wiki/Hillel_II">Hillel II's (Hakatan's</a>) calendar (4119 in the Jewish Calendar / 359
|
33 | 33 | * CE Julian as recorded by <a href="http://en.wikipedia.org/wiki/Hai_Gaon">Rav Hai Gaon</a>) would be just an
|
34 | 34 | * approximation.
|
35 |
| - * |
| 35 | + * |
36 | 36 | * This open source Java code was written by <a href="http://www.facebook.com/avromf">Avrom Finkelstien</a> from his C++
|
37 | 37 | * code. It was refactored to fit the KosherJava Zmanim API with simplification of the code, enhancements and some bug
|
38 | 38 | * fixing.
|
39 |
| - * |
| 39 | + * |
40 | 40 | * Some of Avrom's original C++ code was translated from
|
41 | 41 | * <a href="https://web.archive.org/web/20120124134148/http://emr.cs.uiuc.edu/~reingold/calendar.C">C/C++ code</a> in
|
42 | 42 | * <a href="http://www.calendarists.com">Calendrical Calculations</a> by Nachum Dershowitz and Edward M.
|
43 | 43 | * Reingold, Software-- Practice & Experience, vol. 20, no. 9 (September, 1990), pp. 899- 928. Any method with the mark
|
44 | 44 | * "ND+ER" indicates that the method was taken from this source with minor modifications.
|
45 |
| - * |
| 45 | + * |
46 | 46 | * If you are looking for a class that implements a Jewish calendar version of the Calendar class, one is available from
|
47 | 47 | * the <a href="http://site.icu-project.org/" >ICU (International Components for Unicode)</a> project, formerly part of
|
48 | 48 | * IBM's DeveloperWorks.
|
@@ -153,7 +153,7 @@ public class JewishDate implements Comparable<JewishDate>, Cloneable {
|
153 | 153 | /** The number of <em>chalakim</em> (1080) in an hour.*/
|
154 | 154 | private static final int CHALAKIM_PER_HOUR = 1080;
|
155 | 155 | /** The number of <em>chalakim</em> (25,920) in a 24-hour day .*/
|
156 |
| - private static final int CHALAKIM_PER_DAY = 25920; // 24 * 1080 |
| 156 | + private static final long CHALAKIM_PER_DAY = 25920; // 24 * 1080 |
157 | 157 | /** The number of <em>chalakim</em> in an average Jewish month. A month has 29 days, 12 hours and 793
|
158 | 158 | * <em>chalakim</em> (44 minutes and 3.3 seconds) for a total of 765,433 <em>chalakim</em>*/
|
159 | 159 | private static final long CHALAKIM_PER_MONTH = 765433; // (29 * 24 + 12) * 1080 + 793
|
@@ -460,8 +460,8 @@ private static int getLastMonthOfJewishYear(int year) {
|
460 | 460 | */
|
461 | 461 | public static int getJewishCalendarElapsedDays(int year) {
|
462 | 462 | long chalakimSince = getChalakimSinceMoladTohu(year, TISHREI);
|
463 |
| - int moladDay = (int) (chalakimSince / (long) CHALAKIM_PER_DAY); |
464 |
| - int moladParts = (int) (chalakimSince - moladDay * (long) CHALAKIM_PER_DAY); |
| 463 | + int moladDay = (int) (chalakimSince / CHALAKIM_PER_DAY); |
| 464 | + int moladParts = (int) (chalakimSince - moladDay * CHALAKIM_PER_DAY); |
465 | 465 | // delay Rosh Hashana for the 4 dechiyos
|
466 | 466 | return addDechiyos(year, moladDay, moladParts);
|
467 | 467 | }
|
@@ -533,7 +533,7 @@ private static long getChalakimSinceMoladTohu(int year, int month) {
|
533 | 533 | * Returns the number of <em>chalakim</em> (parts - 1080 to the hour) from the original hypothetical <em>Molad Tohu</em>
|
534 | 534 | * to the Jewish year and month that this Object is set to.
|
535 | 535 | *
|
536 |
| - * @return the number of <em>chalakim</em> (parts - 1080 to the hour) from the original hypothetical <em>Molad Tohu</em> |
| 536 | + * @return the number of <em>chalakim</em> (parts - 1080 to the hour) from the original hypothetical <em>Molad Tohu</em> |
537 | 537 | */
|
538 | 538 | public long getChalakimSinceMoladTohu() {
|
539 | 539 | return getChalakimSinceMoladTohu(jewishYear, jewishMonth);
|
@@ -888,8 +888,8 @@ private static int moladToAbsDate(long chalakim) {
|
888 | 888 | */
|
889 | 889 | public JewishDate(long molad) {
|
890 | 890 | absDateToDate(moladToAbsDate(molad));
|
891 |
| - int conjunctionDay = (int) (molad / (long) CHALAKIM_PER_DAY); |
892 |
| - int conjunctionParts = (int) (molad - conjunctionDay * (long) CHALAKIM_PER_DAY); |
| 891 | + int conjunctionDay = (int) (molad / CHALAKIM_PER_DAY); |
| 892 | + int conjunctionParts = (int) (molad - conjunctionDay * CHALAKIM_PER_DAY); |
893 | 893 | setMoladTime(conjunctionParts);
|
894 | 894 | }
|
895 | 895 |
|
@@ -1293,7 +1293,7 @@ public void forward(int field, int amount) {
|
1293 | 1293 |
|
1294 | 1294 | /**
|
1295 | 1295 | * Forward the Jewish date by the number of months passed in.
|
1296 |
| - * FIXME: Deal with forwarding a date such as 30 Nissan by a month. 30 Iyar does not exist. This should be dealt with similar to |
| 1296 | + * FIXME: Deal with forwarding a date such as 30 Nissan by a month. 30 Iyar does not exist. This should be dealt with similar to |
1297 | 1297 | * the way that the Java Calendar behaves (not that simple since there is a difference between add() or roll().
|
1298 | 1298 | *
|
1299 | 1299 | * @throws IllegalArgumentException if the amount is less than 1
|
|
0 commit comments