001    /*
002     * Zmanim Java API
003     * Copyright (C) 2004-2008 Eliyahu Hershfeld
004     *
005     * This program is free software; you can redistribute it and/or modify it under the terms of the
006     * GNU General Public License as published by the Free Software Foundation; either version 2 of the
007     * License, or (at your option) any later version.
008     *
009     * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
010     * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011     * General Public License for more details.
012     *
013     * You should have received a copy of the GNU General Public License along with this program; if
014     * not, write to the Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA
015     * 02111-1307, USA or connect to: http://www.fsf.org/copyleft/gpl.html
016     */
017    package net.sourceforge.zmanim;
018    
019    import java.util.Date;
020    
021    import net.sourceforge.zmanim.util.AstronomicalCalculator;
022    import net.sourceforge.zmanim.util.GeoLocation;
023    
024    /**
025     * This class extends ZmanimCalendar and provides many more zmanim than
026     * available in the ZmanimCalendar. The basis for most zmanim in this class are
027     * from the <em>sefer</em> <b>Yisroel Vehazmanim</b> by <b>Rabbi Yisroel
028     * Dovid Harfenes</b>. <br />
029     * For an example of the number of different <em>zmanim</em> made available by
030     * this class, there are methods to return 12 different calculations for
031     * <em>alos</em> (dawn) available in this class. The real power of this API is
032     * the ease in calculating <em>zmanim</em> that are not part of the API. The
033     * methods for doing <em>zmanim</em> calculations not present in this or it's
034     * superclass the {@link ZmanimCalendar} are contained in the
035     * {@link AstronomicalCalendar}, the base class of the calendars in our API
036     * since they are generic methods for calculating time based on degrees or time
037     * before or after {@link #getSunrise sunrise} and {@link #getSunset sunset} and
038     * are of interest for calculation beyond <em>zmanim</em> calculations. Here
039     * are some examples: <br />
040     * First create the Calendar for the location you would like to calculate:
041     * 
042     * <pre>
043     * String locationName = &quot;Lakewood, NJ&quot;;
044     * double latitude = 40.0828; //Lakewood, NJ
045     * double longitude = -74.2094; //Lakewood, NJ
046     * //the String parameter in getTimeZone() has to be a valid timezone listed in {@link java.util.TimeZone#getAvailableIDs()}
047     * TimeZone timeZone = TimeZone.getTimeZone(&quot;America/New_York&quot;);
048     * GeoLocation location = new GeoLocation(locationName, latitude, longitude,
049     *              timeZone);
050     * ComplexZmanimCalendar czc = new ComplexZmanimCalendar(location);
051     * </pre>
052     * 
053     * Note: For locations such as Israel where the beginning and end of daylight
054     * savings time can fluctuate from year to year create a
055     * {@link java.util.SimpleTimeZone} with the known start and end of DST. <br />
056     * To get alos calculated as 14&deg; below the horizon (as calculated in the
057     * calendars published in Montreal) use:
058     * 
059     * <pre>
060     * Date alos14 = czc.getSunriseOffsetByDegrees(14);
061     * </pre>
062     * 
063     * To get <em>mincha gedola</em> calculated based on the MGA using a <em>shaah
064     * zmanis</em>
065     * based on the day starting 16.1&deg; below the horizon (and ending 16.1&deg;
066     * after sunset the following calculation can be used:
067     * 
068     * <pre>
069     * Date minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc
070     *              .getShaahZmanis16Point1Degrees() * 6.5);
071     * </pre>
072     * 
073     * A little more complex example would be calculating <em>plag hamincha</em>
074     * based on a shaah zmanis that was not present in this class. While a drop more
075     * complex it is still rather easy. For example if you wanted to calculate
076     * <em>plag</em> based on the day starting 12&deg; before sunrise and ending
077     * 12&deg; after sunset as calculated in the calendars in Manchester, England
078     * (there is nothing that would prevent your calculating the day using sunrise
079     * and sunset offsets that are not identical degrees, but this would lead to
080     * chatzos being a time other than the {@link #getSunTransit() solar transit}
081     * (solar midday)). The steps involved would be to first calculate the
082     * <em>shaah zmanis</em> and than use that time in milliseconds to calculate
083     * 10.75 hours after sunrise starting at 12&deg; before sunset
084     * 
085     * <pre>
086     * long shaahZmanis = czc.getSolarHour(czc.getSunriseOffsetByDegrees(12), czc
087     *              .getSunriseOffsetByDegrees(12));
088     * Date plag = getTimeOffset(czc.getSunriseOffsetByDegrees(12),
089     *              shaahZmanis * 10.75);
090     * </pre>
091     * 
092     * <h2>Disclaimer:</h2>
093     * While I did my best to get accurate results please do not rely on these
094     * zmanim for <em>halacha lemaaseh</em>
095     * 
096     * @author &copy; Eliyahu Hershfeld 2004 - 2008
097     * @version 1.1
098     */
099    public class ComplexZmanimCalendar extends ZmanimCalendar {
100            private static final long serialVersionUID = 1;
101    
102            /**
103             * The zenith of 3.7&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
104             * (90&deg;). This calculation is used for calculating <em>tzais</em>
105             * (nightfall) according to some opinions. This calculation is based on the
106             * opinion of the Geonim that <em>tzais</em> is the time it takes to walk
107             * 3/4 of a Mil at 18 minutes a Mil, or 13.5 minutes after sunset. The sun
108             * is 3.7&deg below {@link #GEOMETRIC_ZENITH geometric zenith} at this time
109             * in Jerusalem on March 16, about 4 days before the equinox, the day that a
110             * solar hour is one hour.
111             * 
112             * TODO AT see #getTzaisGeonim3Point7Degrees()
113             */
114            protected static final double ZENITH_3_POINT_7 = GEOMETRIC_ZENITH + 3.7;
115    
116            /**
117             * The zenith of 5.95&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
118             * (90&deg;). This calculation is used for calculating <em>tzais</em>
119             * (nightfall) according to some opinions. This calculation is based on the
120             * position of the sun 24 minutes after sunset in Jerusalem on March 16,
121             * about 4 days before the equinox, the day that a solar hour is one hour,
122             * which calculates to 5.95&deg; below
123             * {@link #GEOMETRIC_ZENITH geometric zenith}
124             * 
125             * @see #getTzaisGeonim5Point95Degrees()
126             */
127            protected static final double ZENITH_5_POINT_95 = GEOMETRIC_ZENITH + 5.95;
128    
129            /**
130             * The zenith of 7.083&deg; below
131             * {@link #GEOMETRIC_ZENITH  geometric zenith} (90&deg;). This is often
132             * referred to as 7&deg;5' or 7&deg; and 5 minutes. This calculation is used
133             * for calculating <em>alos</em> (dawn) and <em>tzais</em> (nightfall)
134             * according to some opinions. This calculation is based on the position of
135             * the sun 30 minutes after sunset in Jerusalem on March 16,
136             * about 4 days before the equinox, the day that a solar hour is one hour, which
137             * calculates to 7.0833333&deg; below
138             * {@link #GEOMETRIC_ZENITH geometric zenith}. This is time some opinions
139             * consider dark enough for 3 stars to be visible. This is the opinion of
140             * the Shu"t Melamed Leho'il, Shu"t Binyan Tziyon, Tenuvas Sadeh and very
141             * close to the time of the Mekor Chesed on the Sefer chasidim.
142             * 
143             * @see #getTzaisGeonim7Point083Degrees()
144             * @see #getBainHasmashosRT13Point5MinutesBefore7Point083Degrees()
145             */
146            protected static final double ZENITH_7_POINT_083 = GEOMETRIC_ZENITH + 7
147                            + (5 / 60);
148    
149            /**
150             * The zenith of 10.2&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
151             * (90&deg;). This calculation is used for calculating <em>misheyakir</em>
152             * according to some opinions. This calculation is based on the position of
153             * the sun 45 minutes before {@link #getSunrise sunrise} in Jerusalem on March 16,
154             * about 4 days before the equinox, the day that a solar hour is one hour which calculates to 10.2&deg; below
155             * {@link #GEOMETRIC_ZENITH geometric zenith}
156             * 
157             * @see #getMisheyakir10Point2Degrees()
158             */
159            protected static final double ZENITH_10_POINT_2 = GEOMETRIC_ZENITH + 10.2;
160    
161            /**
162             * The zenith of 11&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
163             * (90&deg;). This calculation is used for calculating <em>misheyakir</em>
164             * according to some opinions. This calculation is based on the position of
165             * the sun 48 minutes before {@link #getSunrise sunrise} in Jerusalem on March 16,
166             * about 4 days before the equinox, the day that a solar hour is one hour which calculates to 11&deg; below
167             * {@link #GEOMETRIC_ZENITH geometric zenith}
168             * 
169             * @see #getMisheyakir11Degrees()
170             */
171            protected static final double ZENITH_11_DEGREES = GEOMETRIC_ZENITH + 11;
172    
173            /**
174             * The zenith of 11.5&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
175             * (90&deg;). This calculation is used for calculating <em>misheyakir</em>
176             * according to some opinions. This calculation is based on the position of
177             * the sun 52 minutes before {@link #getSunrise sunrise} in Jerusalem on March 16,
178             * about 4 days before the equinox, the day that a solar hour is one hour which calculates to 11.5&deg; below
179             * {@link #GEOMETRIC_ZENITH geometric zenith}
180             * 
181             * @see #getMisheyakir11Point5Degrees()
182             */
183            protected static final double ZENITH_11_POINT_5 = GEOMETRIC_ZENITH + 11.5;
184    
185            /**
186             * The zenith of 13&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
187             * (90&deg;). This calculation is used for calculating
188             * <em>Rabainu Tam's bain hashmashos</em> according to some opinions.
189             * 
190             * @see #getBainHasmashosRT13Degrees
191             */
192            protected static final double ZENITH_13_DEGREES = GEOMETRIC_ZENITH + 13;
193    
194            /**
195             * The zenith of 19.8&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
196             * (90&deg;). This calculation is used for calculating <em>alos</em>
197             * (dawn) and <em>tzais</em> (nightfall) according to some opinions. This
198             * calculation is based on the position of the sun 90 minutes after sunset
199             * in Jerusalem on March 16,
200             * about 4 days before the equinox, the day that a solar hour is one hour which calculates to 19.8&deg; below
201             * {@link #GEOMETRIC_ZENITH geometric zenith}
202             * 
203             * @see #getTzais19Point8Degrees()
204             * @see #getAlos19Point8Degrees()
205             * @see #getAlos90()
206             * @see #getTzais90()
207             */
208            protected static final double ZENITH_19_POINT_8 = GEOMETRIC_ZENITH + 19.8;
209    
210            /**
211             * The zenith of 26&deg; below {@link #GEOMETRIC_ZENITH  geometric zenith}
212             * (90&deg;). This calculation is used for calculating <em>alos</em>
213             * (dawn) and <em>tzais</em> (nightfall) according to some opinions. This
214             * calculation is based on the position of the sun
215             * {@link #getAlos120() 120 minutes} after sunset in Jerusalem on March 16,
216             * about 4 days before the equinox, the day that a solar hour is one hour which calculates to 26&deg; below
217             * {@link #GEOMETRIC_ZENITH geometric zenith}
218             * 
219             * @see #getAlos26Degrees()
220             * @see #getTzais26Degrees()
221             * @see #getAlos120()
222             * @see #getTzais120()
223             */
224            protected static final double ZENITH_26_DEGREES = GEOMETRIC_ZENITH + 26.0;
225    
226            public ComplexZmanimCalendar(GeoLocation location) {
227                    super(location);
228            }
229    
230            /**
231             * Default constructor will set a default {@link GeoLocation#GeoLocation()},
232             * a default
233             * {@link AstronomicalCalculator#getDefault() AstronomicalCalculator} and
234             * default the calendar to the current date.
235             * 
236             * @see AstronomicalCalendar#AstronomicalCalendar()
237             */
238            public ComplexZmanimCalendar() {
239                    super();
240            }
241    
242            /**
243             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
244             * using a 19.8&deg; dip. This calculation divides the day based on the
245             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
246             * calculation is when the sun is 19.8&deg; below the eastern geometric
247             * horizon before sunrise. Dusk for this is when the sun is 19.8&deg; below
248             * the western geometric horizon after sunset. This day is split into 12
249             * equal parts with each part being a <em>shaah zmanis</em>.
250             * 
251             * @return the <code>long</code> millisecond length of a
252             *         <em>shaah zmanis</em>.
253             */
254            public long getShaahZmanis19Point8Degrees() {
255                    return getTemporalHour(getAlos19Point8Degrees(),
256                                    getTzais19Point8Degrees());
257            }
258    
259            /**
260             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
261             * using a 18&deg; dip. This calculation divides the day based on the
262             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
263             * calculation is when the sun is 18&deg; below the eastern geometric
264             * horizon before sunrise. Dusk for this is when the sun is 18&deg; below
265             * the western geometric horizon after sunset. This day is split into 12
266             * equal parts with each part being a <em>shaah zmanis</em>.
267             * 
268             * @return the <code>long</code> millisecond length of a
269             *         <em>shaah zmanis</em>.
270             */
271            public long getShaahZmanis18Degrees() {
272                    return getTemporalHour(getAlos18Degrees(), getTzais18Degrees());
273            }
274    
275            /**
276             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
277             * using a dip of 26&deg;. This calculation divides the day based on the
278             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
279             * calculation is when the sun is {@link #getAlos26Degrees() 26&deg;} below
280             * the eastern geometric horizon before sunrise. Dusk for this is when the
281             * sun is {@link #getTzais26Degrees() 26&deg;} below the western geometric
282             * horizon after sunset. This day is split into 12 equal parts with each
283             * part being a <em>shaah zmanis</em>.
284             * 
285             * @return the <code>long</code> millisecond length of a
286             *         <em>shaah zmanis</em>.
287             */
288            public long getShaahZmanis26Degrees() {
289                    return getTemporalHour(getAlos26Degrees(), getTzais26Degrees());
290            }
291    
292            /**
293             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
294             * using a dip of 16.1&deg;. This calculation divides the day based on the
295             * opinion that the day runs from dawn to dusk. Dawn for this calculation is
296             * when the sun is 16.1&deg; below the eastern geometric horizon before
297             * sunrise and dusk is when the sun is 16.1&deg; below the western geometric
298             * horizon after sunset. This day is split into 12 equal parts with each
299             * part being a <em>shaah zmanis</em>.
300             * 
301             * @return the <code>long</code> millisecond length of a
302             *         <em>shaah zmanis</em>.
303             * @see #getAlos16Point1Degrees()
304             * @see #getTzais16Point1Degrees()
305             * @see #getSofZmanShmaMGA16Point1Degrees()
306             * @see #getSofZmanTfilaMGA16Point1Degrees()
307             * @see #getMinchaGedola16Point1Degrees()
308             * @see #getMinchaKetana16Point1Degrees()
309             * @see #getPlagHamincha16Point1Degrees()
310             */
311    
312            public long getShaahZmanis16Point1Degrees() {
313                    return getTemporalHour(getAlos16Point1Degrees(),
314                                    getTzais16Point1Degrees());
315            }
316    
317            /**
318             * Method to return a <em>shaah zmanis</em> (solar hour) according to the
319             * opinion of the MGA. This calculation divides the day based on the opinion
320             * of the <em>MGA</em> that the day runs from dawn to dusk. Dawn for this
321             * calculation is 60 minutes before sunrise and dusk is 60 minutes after
322             * sunset. This day is split into 12 equal parts with each part being a
323             * <em>shaah zmanis</em>. Alternate mothods of calculating a
324             * <em>shaah zmanis</em> are available in the subclass
325             * {@link ComplexZmanimCalendar}
326             * 
327             * @return the <code>long</code> millisecond length of a
328             *         <em>shaah zmanis</em>.
329             */
330            public long getShaahZmanis60Minutes() {
331                    return getTemporalHour(getAlos60(), getTzais60());
332            }
333    
334            /**
335             * Method to return a <em>shaah zmanis</em> (solar hour) according to the
336             * opinion of the MGA. This calculation divides the day based on the opinion
337             * of the <em>MGA</em> that the day runs from dawn to dusk. Dawn for this
338             * calculation is 72 minutes before sunrise and dusk is 72 minutes after
339             * sunset. This day is split into 12 equal parts with each part being a
340             * <em>shaah zmanis</em>. Alternate mothods of calculating a
341             * <em>shaah zmanis</em> are available in the subclass
342             * {@link ComplexZmanimCalendar}
343             * 
344             * @return the <code>long</code> millisecond length of a
345             *         <em>shaah zmanis</em>.
346             */
347            public long getShaahZmanis72Minutes() {
348                    return getShaahZmanisMGA();
349            }
350    
351            /**
352             * Method to return a <em>shaah zmanis</em> (temporal hour) according to
353             * the opinion of the MGA based on <em>alos</em> being
354             * {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before
355             * {@link #getSunrise() sunrise}. This calculation divides the day based on
356             * the opinion of the <em>MGA</em> that the day runs from dawn to dusk.
357             * Dawn for this calculation is 72 minutes <em>zmaniyos</em> before
358             * sunrise and dusk is 72 minutes <em>zmaniyos</em> after sunset. This day
359             * is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
360             * This is identical to 1/10th of the day from {@link #getSunrise() sunrise}
361             * to {@link #getSunset() sunset}.
362             * 
363             * @return the <code>long</code> millisecond length of a
364             *         <em>shaah zmanis</em>.
365             * @see #getAlos72Zmanis()
366             * @see #getTzais72Zmanis()
367             */
368            public long getShaahZmanis72MinutesZmanis() {
369                    return getTemporalHour(getAlos72Zmanis(), getTzais72Zmanis());
370            }
371    
372            /**
373             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
374             * using a dip of 90 minutes. This calculation divides the day based on the
375             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
376             * calculation is 90 minutes before sunrise and dusk is 90 minutes after
377             * sunset. This day is split into 12 equal parts with each part being a
378             * <em>shaah zmanis</em>.
379             * 
380             * @return the <code>long</code> millisecond length of a
381             *         <em>shaah zmanis</em>.
382             */
383            public long getShaahZmanis90Minutes() {
384                    return getTemporalHour(getAlos90(), getTzais90());
385            }
386    
387            /**
388             * Method to return a <em>shaah zmanis</em> (temporal hour) according to
389             * the opinion of the MGA based on <em>alos</em> being
390             * {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before
391             * {@link #getSunrise() sunrise}. This calculation divides the day based on
392             * the opinion of the <em>MGA</em> that the day runs from dawn to dusk.
393             * Dawn for this calculation is 90 minutes <em>zmaniyos</em> before
394             * sunrise and dusk is 90 minutes <em>zmaniyos</em> after sunset. This day
395             * is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
396             * This is identical to 1/8th of the day from {@link #getSunrise() sunrise}
397             * to {@link #getSunset() sunset}.
398             * 
399             * @return the <code>long</code> millisecond length of a
400             *         <em>shaah zmanis</em>.
401             * @see #getAlos90Zmanis()
402             * @see #getTzais90Zmanis()
403             */
404            public long getShaahZmanis90MinutesZmanis() {
405                    return getTemporalHour(getAlos90Zmanis(), getTzais90Zmanis());
406            }
407    
408            /**
409             * Method to return a <em>shaah zmanis</em> (temporal hour) according to
410             * the opinion of the MGA based on <em>alos</em> being
411             * {@link #getAlos96Zmanis() 96} minutes <em>zmaniyos</em> before
412             * {@link #getSunrise() sunrise}. This calculation divides the day based on
413             * the opinion of the <em>MGA</em> that the day runs from dawn to dusk.
414             * Dawn for this calculation is 96 minutes <em>zmaniyos</em> before
415             * sunrise and dusk is 96 minutes <em>zmaniyos</em> after sunset. This day
416             * is split into 12 equal parts with each part being a <em>shaah zmanis</em>.
417             * This is identical to 1/7.5th of the day from
418             * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
419             * 
420             * @return the <code>long</code> millisecond length of a
421             *         <em>shaah zmanis</em>.
422             * @see #getAlos96Zmanis()
423             * @see #getTzais96Zmanis()
424             */
425            public long getShaahZmanis96MinutesZmanis() {
426                    return getTemporalHour(getAlos96Zmanis(), getTzais96Zmanis());
427            }
428    
429            /**
430             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
431             * using a dip of 96 minutes. This calculation divides the day based on the
432             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
433             * calculation is 96 minutes before sunrise and dusk is 96 minutes after
434             * sunset. This day is split into 12 equal parts with each part being a
435             * <em>shaah zmanis</em>.
436             * 
437             * @return the <code>long</code> millisecond length of a
438             *         <em>shaah zmanis</em>.
439             */
440            public long getShaahZmanis96Minutes() {
441                    return getTemporalHour(getAlos96(), getTzais96());
442            }
443    
444            /**
445             * Method to return a <em>shaah zmanis</em> (temporal hour) calculated
446             * using a dip of 120 minutes. This calculation divides the day based on the
447             * opinion of the MGA that the day runs from dawn to dusk. Dawn for this
448             * calculation is 120 minutes before sunrise and dusk is 120 minutes after
449             * sunset. This day is split into 12 equal parts with each part being a
450             * <em>shaah zmanis</em>.
451             * 
452             * @return the <code>long</code> millisecond length of a
453             *         <em>shaah zmanis</em>.
454             */
455            public long getShaahZmanis120Minutes() {
456                    return getTemporalHour(getAlos120(), getTzais120());
457            }
458    
459            /**
460             * Method to return a <em>shaah zmanis</em> (temporal hour) according to
461             * the opinion of the MGA based on <em>alos</em> being
462             * {@link #getAlos120Zmanis() 120} minutes <em>zmaniyos</em> before
463             * {@link #getSunrise() sunrise}. This calculation divides the day based on
464             * the opinion of the <em>MGA</em> that the day runs from dawn to dusk.
465             * Dawn for this calculation is 120 minutes <em>zmaniyos</em> before
466             * sunrise and dusk is 120 minutes <em>zmaniyos</em> after sunset. This
467             * day is split into 12 equal parts with each part being a
468             * <em>shaah zmanis</em>. This is identical to 1/6th of the day from
469             * {@link #getSunrise() sunrise} to {@link #getSunset() sunset}.
470             * 
471             * @return the <code>long</code> millisecond length of a
472             *         <em>shaah zmanis</em>.
473             * @see #getAlos120Zmanis()
474             * @see #getTzais120Zmanis()
475             */
476            public long getShaahZmanis120MinutesZmanis() {
477                    return getTemporalHour(getAlos120Zmanis(), getTzais120Zmanis());
478            }
479    
480            /**
481             * This method returns the time of <em>plag hamincha</em>. This is
482             * calculated as 10.75 hours after {@link #getAlos96Zmanis() dawn}. The
483             * formula used is:<br/> 10.75 * {@link #getShaahZmanis96MinutesZmanis()}
484             * after {@link #getAlos96Zmanis() dawn}.
485             * 
486             * @return the <code>Date</code> of the time of <em>plag hamincha</em>.
487             */
488            public Date getPlagHamincha120MinutesZmanis() {
489                    return getTimeOffset(getAlos120Zmanis(),
490                                    getShaahZmanis120MinutesZmanis() * 10.75);
491            }
492    
493            /**
494             * This method returns the time of <em>plag hamincha</em>. This is
495             * calculated as 10.75 hours after {@link #getAlos72() dawn}. The formula
496             * used is:<br/> 10.75 *{@link #getShaahZmanis72Minutes()} after
497             * {@link #getAlos72()}.
498             * 
499             * @return the <code>Date</code> of the time of <em>plag hamincha</em>.
500             */
501            public Date getPlagHamincha120Minutes() {
502                    return getTimeOffset(getAlos120(), getShaahZmanis120Minutes() * 10.75);
503            }
504    
505            /**
506             * Method to return <em>alos</em> (dawn) calculated using 60 minutes
507             * before {@link #getSeaLevelSunrise() sea level sunrise} on the time to
508             * walk the distance of 4 <em>Mil</em> at 15 minutes a <em>Mil</em>.
509             * This is based on the opinion of most <em>Rishonim</em> who stated that
510             * the time of the <em>Neshef</em> (time between dawn and sunrise) does
511             * not vary by the time of year or location but purely depends on the time
512             * it takes to walk the distance of 4 <em>Mil</em>.
513             * 
514             * @return the <code>Date</code> representing the time.
515             */
516            public Date getAlos60() {
517                    return getTimeOffset(getSeaLevelSunrise(), -60 * MINUTE_MILLIS);
518            }
519    
520            /**
521             * Method to return <em>alos</em> (dawn) calculated using 72 minutes
522             * <em>zmaniyos</em>( <em>GR"A</em> and the <em>Baal Hatanya</em>)
523             * or 1/10th of the day before sea level sunrise. This is based on an 18
524             * minute <em>Mil</em> so the time for 4 <em>Mil</em> is 72 minutes
525             * which is 1/10th of a day (12 * 60 = 720) based on the day starting at
526             * {@link #getSeaLevelSunrise() sea level sunrise} and ending at {@link #getSeaLevelSunset() sea level sunset}.
527             * The actual alculation is {@link #getSeaLevelSunrise()}- (
528             * {@link #getShaahZmanisGra()} * 1.2). This calculation is used in the
529             * calendars published by
530             * <em>Hisachdus Harabanim D'Artzos Habris Ve'Kanada</em>
531             * 
532             * @return the <code>Date</code> representing the time.
533             * @see #getShaahZmanisGra()
534             */
535            public Date getAlos72Zmanis() {
536                    long shaahZmanis = getShaahZmanisGra();
537                    if (shaahZmanis == Long.MIN_VALUE) {
538                            return null;
539                    }
540                    return getTimeOffset(getSeaLevelSunrise(), (long) (shaahZmanis * -1.2));
541            }
542    
543            /**
544             * Method to return <em>alos</em> (dawn) calculated using 96 minutes
545             * before {@link #getSeaLevelSunrise() sea level sunrise} based on the time
546             * to walk the distance of 4 <em>Mil</em> at 24 minutes a <em>Mil</em>.
547             * This is based on the opinion of most <em>Rishonim</em> who stated that
548             * the time of the <em>Neshef</em> (time between dawn and sunrise) does
549             * not vary by the time of year or location but purely depends on the time
550             * it takes to walk the distance of 4 <em>Mil</em>.
551             * 
552             * @return the <code>Date</code> representing the time.
553             */
554            public Date getAlos96() {
555                    return getTimeOffset(getSeaLevelSunrise(), -96 * MINUTE_MILLIS);
556            }
557    
558            /**
559             * Method to return <em>alos</em> (dawn) calculated using 90 minutes
560             * <em>zmaniyos</em>( <em>GR"A</em> and the <em>Baal Hatanya</em>)
561             * or 1/8th of the day before sea level sunrise. This is based on a 22.5
562             * minute <em>Mil</em> so the time for 4 <em>Mil</em> is 90 minutes
563             * which is 1/8th of a day (12 * 60 = 720) /8 =90 based on the day starting
564             * at {@link #getSunrise() sunrise} and ending at
565             * {@link #getSunset() sunset}. The actual calculation is
566             * {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 1.5).
567             * 
568             * @return the <code>Date</code> representing the time.
569             * @see #getShaahZmanisGra()
570             */
571            public Date getAlos90Zmanis() {
572                    long shaahZmanis = getShaahZmanisGra();
573                    if (shaahZmanis == Long.MIN_VALUE) {
574                            return null;
575                    }
576                    return getTimeOffset(getSeaLevelSunrise(), (long) (shaahZmanis * -1.5));
577            }
578    
579            /**
580             * Method to return <em>alos</em> (dawn) calculated using 90 minutes
581             * <em>zmaniyos</em>( <em>GR"A</em> and the <em>Baal Hatanya</em>)
582             * or 1/8th of the day before sea level sunrise. This is based on a 24
583             * minute <em>Mil</em> so the time for 4 <em>Mil</em> is 90 minutes
584             * which is 1/7.5th of a day (12 * 60 = 720) / 7.5 =96 based on the day
585             * starting at {@link #getSunrise() sunrise} and ending at
586             * {@link #getSunset() sunset}. The actual calculation is
587             * {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 1.6).
588             * 
589             * @return the <code>Date</code> representing the time.
590             * @see #getShaahZmanisGra()
591             */
592            public Date getAlos96Zmanis() {
593                    long shaahZmanis = getShaahZmanisGra();
594                    if (shaahZmanis == Long.MIN_VALUE) {
595                            return null;
596                    }
597                    return getTimeOffset(getSeaLevelSunrise(), (long) (shaahZmanis * -1.6));
598            }
599    
600            /**
601             * Method to return <em>alos</em> (dawn) calculated using 90 minutes
602             * before {@link #getSeaLevelSunrise() sea level sunrise} on the time to
603             * walk the distance of 4 <em>Mil</em> at 22.5 minutes a <em>Mil</em>.
604             * This is based on the opinion of most <em>Rishonim</em> who stated that
605             * the time of the <em>Neshef</em> (time between dawn and sunrise) does
606             * not vary by the time of year or location but purely depends on the time
607             * it takes to walk the distance of 4 <em>Mil</em>.
608             * 
609             * @return the <code>Date</code> representing the time.
610             */
611            public Date getAlos90() {
612                    return getTimeOffset(getSeaLevelSunrise(), -90 * MINUTE_MILLIS);
613            }
614    
615            /**
616             * Method to return <em>alos</em> (dawn) calculated using 120 minutes
617             * before {@link #getSeaLevelSunrise() sea level sunrise} (no adjustment for
618             * elevation is made) based on the time to walk the distance of 5
619             * <em>Mil</em>( <em>Ula</em>) at 24 minutes a <em>Mil</em>. This
620             * is based on the opinion of most <em>Rishonim</em> who stated that the
621             * time of the <em>Neshef</em> (time between dawn and sunrise) does not
622             * vary by the time of year or location but purely depends on the time it
623             * takes to walk the distance of 5 <em>Mil</em>(<em>Ula</em>).
624             * 
625             * @return the <code>Date</code> representing the time.
626             */
627            public Date getAlos120() {
628                    return getTimeOffset(getSeaLevelSunrise(), -120 * MINUTE_MILLIS);
629            }
630    
631            /**
632             * Method to return <em>alos</em> (dawn) calculated using 120 minutes
633             * <em>zmaniyos</em>( <em>GR"A</em> and the <em>Baal Hatanya</em>)
634             * or 1/6th of the day before sea level sunrise. This is based on a 24
635             * minute <em>Mil</em> so the time for 5 <em>Mil</em> is 120 minutes
636             * which is 1/6th of a day (12 * 60 = 720) / 6 =120 based on the day
637             * starting at {@link #getSunrise() sunrise} and ending at
638             * {@link #getSunset() sunset}. The actual calculation is
639             * {@link #getSunrise()} - ({@link #getShaahZmanisGra()} * 2).
640             * 
641             * @return the <code>Date</code> representing the time.
642             * @see #getShaahZmanisGra()
643             */
644            public Date getAlos120Zmanis() {
645                    long shaahZmanis = getShaahZmanisGra();
646                    if (shaahZmanis == Long.MIN_VALUE) {
647                            return null;
648                    }
649                    return getTimeOffset(getSeaLevelSunrise(), shaahZmanis * -2);
650            }
651    
652            /**
653             * Method to return <em>alos</em> (dawn) calculated when the sun is
654             * {@link #ZENITH_26_DEGREES 26&deg;} below the eastern geometric horizon
655             * before sunrise. This calculation is based on the same calculation of
656             * {@link #getAlos120() 120 minutes} but uses a degree based calculation
657             * instead of 120 exact minutes. This calculation is based on the position
658             * of the sun 120 minutes before sunrise in Jerusalem in the equinox which
659             * calculates to 26&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
660             * 
661             * @return the <code>Date</code> representing <em>alos</em>.
662             * @see #ZENITH_26_DEGREES
663             * @see #getAlos120()
664             * @see #getTzais120()
665             */
666            public Date getAlos26Degrees() {
667                    return getSunriseOffsetByDegrees(ZENITH_26_DEGREES);
668            }
669    
670            /**
671             * to return <em>alos</em> (dawn) calculated when the sun is
672             * {@link #ASTRONOMICAL_ZENITH 18&deg;} below the eastern geometric horizon
673             * before sunrise.
674             * 
675             * @return the <code>Date</code> representing <em>alos</em>.
676             * @see #ASTRONOMICAL_ZENITH
677             */
678            public Date getAlos18Degrees() {
679                    return getSunriseOffsetByDegrees(ASTRONOMICAL_ZENITH);
680            }
681    
682            /**
683             * Method to return <em>alos</em> (dawn) calculated when the sun is
684             * {@link #ZENITH_19_POINT_8 19.8&deg;} below the eastern geometric horizon
685             * before sunrise. This calculation is based on the same calculation of
686             * {@link #getAlos90() 90 minutes} but uses a degree based calculation
687             * instead of 90 exact minutes. This calculation is based on the position of
688             * the sun 90 minutes before sunrise in Jerusalem in the equinox which
689             * calculates to 19.8&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
690             * 
691             * @return the <code>Date</code> representing <em>alos</em>.
692             * @see #ZENITH_19_POINT_8
693             * @see #getAlos90()
694             */
695            public Date getAlos19Point8Degrees() {
696                    return getSunriseOffsetByDegrees(ZENITH_19_POINT_8);
697            }
698    
699            /**
700             * Method to return <em>alos</em> (dawn) calculated when the sun is
701             * {@link #ZENITH_16_POINT_1 16.1&deg;} below the eastern geometric horizon
702             * before sunrise. This calculation is based on the same calculation of
703             * {@link #getAlos72() 72 minutes} but uses a degree based calculation
704             * instead of 72 exact minutes. This calculation is based on the position of
705             * the sun 72 minutes before sunrise in Jerusalem in the equinox which
706             * calculates to 16.1&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}.
707             * 
708             * @return the <code>Date</code> representing <em>alos</em>.
709             * @see #ZENITH_16_POINT_1
710             * @see #getAlos72()
711             */
712            public Date getAlos16Point1Degrees() {
713                    return getSunriseOffsetByDegrees(ZENITH_16_POINT_1);
714            }
715    
716            /**
717             * This method returns <em>misheyakir</em> based on the position of the
718             * sun when it is {@link #ZENITH_11_DEGREES 11.5&deg;} below
719             * {@link #GEOMETRIC_ZENITH  geometric zenith} (90&deg;). This calculation
720             * is used for calculating <em>misheyakir</em> according to some opinions.
721             * This calculation is based on the position of the sun 52 minutes before
722             * {@link #getSunrise sunrise}in Jerusalem in the equinox which calculates
723             * to 11.5&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
724             * 
725             * @see #ZENITH_11_POINT_5
726             */
727            public Date getMisheyakir11Point5Degrees() {
728                    return getSunriseOffsetByDegrees(ZENITH_11_POINT_5);
729            }
730    
731            /**
732             * This method returns <em>misheyakir</em> based on the position of the
733             * sun when it is {@link #ZENITH_11_DEGREES 11&deg;} below
734             * {@link #GEOMETRIC_ZENITH  geometric zenith} (90&deg;). This calculation
735             * is used for calculating <em>misheyakir</em> according to some opinions.
736             * This calculation is based on the position of the sun 48 minutes before
737             * {@link #getSunrise sunrise}in Jerusalem in the equinox which calculates
738             * to 11&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
739             * 
740             * @see #ZENITH_11_DEGREES
741             */
742            public Date getMisheyakir11Degrees() {
743                    return getSunriseOffsetByDegrees(ZENITH_11_DEGREES);
744            }
745    
746            /**
747             * This method returns <em>misheyakir</em> based on the position of the
748             * sun when it is {@link #ZENITH_10_POINT_2 10.2&deg;} below
749             * {@link #GEOMETRIC_ZENITH  geometric zenith} (90&deg;). This calculation
750             * is used for calculating <em>misheyakir</em> according to some opinions.
751             * This calculation is based on the position of the sun 45 minutes before
752             * {@link #getSunrise sunrise} in Jerusalem in the equinox which calculates
753             * to 10.2&deg; below {@link #GEOMETRIC_ZENITH geometric zenith}
754             * 
755             * @see #ZENITH_10_POINT_2
756             */
757            public Date getMisheyakir10Point2Degrees() {
758                    return getSunriseOffsetByDegrees(ZENITH_10_POINT_2);
759            }
760    
761            /**
762             * This method returns the latest <em>zman krias shema</em> (time to say
763             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
764             * <em>alos</em> being {@link #getAlos19Point8Degrees()() 19.8&deg;}
765             * before {@link #getSunrise() sunrise}. This time is 3
766             * <em>{@link #getShaahZmanis19Point8Degrees() shaos zmaniyos}</em> (solar
767             * hours) after {@link #getAlos19Point8Degrees() dawn} based on the opinion
768             * of the <em>MG"A</em> that the day is calculated from dawn to nightfall
769             * with both being 19.8&deg; below sunrise or sunset. This returns the time
770             * of 3 *{@link #getShaahZmanis19Point8Degrees()} after
771             * {@link #getAlos19Point8Degrees() dawn}.
772             * 
773             * @return the <code>Date</code> of the latest zman shema.
774             * @see #getShaahZmanis19Point8Degrees()
775             * @see #getAlos19Point8Degrees()
776             */
777            public Date getSofZmanShmaMGA19Point8Degrees() {
778                    return getTimeOffset(getAlos19Point8Degrees(),
779                                    getShaahZmanis19Point8Degrees() * 3);
780            }
781    
782            /**
783             * This method returns the latest <em>zman krias shema</em> (time to say
784             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
785             * <em>alos</em> being {@link #getAlos16Point1Degrees()() 16.1&deg;}
786             * before {@link #getSunrise() sunrise}. This time is 3
787             * <em>{@link #getShaahZmanis16Point1Degrees() shaos zmaniyos}</em> (solar
788             * hours) after {@link #getAlos16Point1Degrees() dawn} based on the opinion
789             * of the <em>MG"A</em> that the day is calculated from dawn to nightfall
790             * with both being 16.1&deg; below sunrise or sunset. This returns the time
791             * of 3 *{@link #getShaahZmanis16Point1Degrees()} after
792             * {@link #getAlos16Point1Degrees() dawn}.
793             * 
794             * @return the <code>Date</code> of the latest zman shema.
795             * @see #getShaahZmanis16Point1Degrees()
796             * @see #getAlos16Point1Degrees()
797             */
798            public Date getSofZmanShmaMGA16Point1Degrees() {
799                    return getTimeOffset(getAlos16Point1Degrees(),
800                                    getShaahZmanis16Point1Degrees() * 3);
801            }
802    
803            /**
804             * This method returns the latest <em>zman krias shema</em> (time to say
805             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
806             * <em>alos</em> being {@link #getAlos72() 72} minutes before
807             * {@link #getSunrise() sunrise}. This time is 3
808             * <em>{@link #getShaahZmanis72Minutes() shaos zmaniyos}</em> (solar
809             * hours) after {@link #getAlos72() dawn} based on the opinion of the
810             * <em>MG"A</em> that the day is calculated from a
811             * {@link #getAlos72() dawn} of 72 minutes before sunrise to
812             * {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns
813             * the time of 3 * {@link #getShaahZmanis72Minutes()} after
814             * {@link #getAlos72() dawn}. This class returns an identical time to
815             * {@link #getSofZmanShmaMGA()} and is repeated here for clarity.
816             * 
817             * @return the <code>Date</code> of the latest zman shema.
818             * @see #getShaahZmanis72Minutes()
819             * @see #getAlos72()
820             * @see #getSofZmanShmaMGA()
821             */
822            public Date getSofZmanShmaMGA72Minutes() {
823                    return getSofZmanShmaMGA();
824            }
825    
826            /**
827             * This method returns the latest <em>zman krias shema</em> (time to say
828             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
829             * <em>alos</em> being {@link #getAlos72Zmanis() 72} minutes
830             * <em>zmaniyos</em>, or 1/10th of teh day before {@link #getSunrise() sunrise}. This time is 3
831             * <em>{@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos}</em> (solar
832             * hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of the
833             * <em>MG"A</em> that the day is calculated from a
834             * {@link #getAlos72Zmanis() dawn} of 72 minutes <em>zmaniyos</em>, or 1/10th of the day before
835             * {@link #getSeaLevelSunrise() sea level sunrise} to {@link #getTzais72Zmanis() nightfall} of 72 minutes
836             * <em>zmaniyos</em> after {@link #getSeaLevelSunset() sea level sunset}. This returns the time of 3 *
837             * {@link #getShaahZmanis72MinutesZmanis()} after
838             * {@link #getAlos72Zmanis() dawn}.
839             * 
840             * @return the <code>Date</code> of the latest zman shema.
841             * @see #getShaahZmanis72MinutesZmanis()
842             * @see #getAlos72Zmanis()
843             */
844            public Date getSofZmanShmaMGA72MinutesZmanis() {
845                    return getTimeOffset(getAlos72Zmanis(),
846                                    getShaahZmanis72MinutesZmanis() * 3);
847            }
848    
849            /**
850             * This method returns the latest <em>zman krias shema</em> (time to say
851             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
852             * <em>alos</em> being {@link #getAlos90() 90} minutes before
853             * {@link #getSunrise() sunrise}. This time is 3
854             * <em>{@link #getShaahZmanis90Minutes() shaos zmaniyos}</em> (solar
855             * hours) after {@link #getAlos90() dawn} based on the opinion of the
856             * <em>MG"A</em> that the day is calculated from a
857             * {@link #getAlos90() dawn} of 90 minutes before sunrise to
858             * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns
859             * the time of 3 * {@link #getShaahZmanis90Minutes()} after
860             * {@link #getAlos90() dawn}.
861             * 
862             * @return the <code>Date</code> of the latest zman shema.
863             * @see #getShaahZmanis90Minutes()
864             * @see #getAlos90()
865             */
866            public Date getSofZmanShmaMGA90Minutes() {
867                    return getTimeOffset(getAlos90(), getShaahZmanis90Minutes() * 3);
868            }
869    
870            /**
871             * This method returns the latest <em>zman krias shema</em> (time to say
872             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
873             * <em>alos</em> being {@link #getAlos90Zmanis() 90} minutes
874             * <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is 3
875             * <em>{@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos}</em> (solar
876             * hours) after {@link #getAlos90Zmanis() dawn} based on the opinion of the
877             * <em>MG"A</em> that the day is calculated from a
878             * {@link #getAlos90Zmanis() dawn} of 90 minutes <em>zmaniyos</em> before
879             * sunrise to {@link #getTzais90Zmanis() nightfall} of 90 minutes
880             * <em>zmaniyos</em> after sunset. This returns the time of 3 *
881             * {@link #getShaahZmanis90MinutesZmanis()} after
882             * {@link #getAlos90Zmanis() dawn}.
883             * 
884             * @return the <code>Date</code> of the latest zman shema.
885             * @see #getShaahZmanis90MinutesZmanis()
886             * @see #getAlos90Zmanis()
887             */
888            public Date getSofZmanShmaMGA90MinutesZmanis() {
889                    return getTimeOffset(getAlos90Zmanis(),
890                                    getShaahZmanis90MinutesZmanis() * 3);
891            }
892    
893            /**
894             * This method returns the latest <em>zman krias shema</em> (time to say
895             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
896             * <em>alos</em> being {@link #getAlos96() 96} minutes before
897             * {@link #getSunrise() sunrise}. This time is 3
898             * <em>{@link #getShaahZmanis96Minutes() shaos zmaniyos}</em> (solar
899             * hours) after {@link #getAlos96() dawn} based on the opinion of the
900             * <em>MG"A</em> that the day is calculated from a
901             * {@link #getAlos96() dawn} of 96 minutes before sunrise to
902             * {@link #getTzais96() nightfall} of 96 minutes after sunset. This returns
903             * the time of 3 * {@link #getShaahZmanis96Minutes()} after
904             * {@link #getAlos96() dawn}.
905             * 
906             * @return the <code>Date</code> of the latest zman shema.
907             * @see #getShaahZmanis96Minutes()
908             * @see #getAlos96()
909             */
910            public Date getSofZmanShmaMGA96Minutes() {
911                    return getTimeOffset(getAlos96(), getShaahZmanis96Minutes() * 3);
912            }
913    
914            /**
915             * This method returns the latest <em>zman krias shema</em> (time to say
916             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
917             * <em>alos</em> being {@link #getAlos90Zmanis() 96} minutes
918             * <em>zmaniyos</em> before {@link #getSunrise() sunrise}. This time is 3
919             * <em>{@link #getShaahZmanis96MinutesZmanis() shaos zmaniyos}</em> (solar
920             * hours) after {@link #getAlos96Zmanis() dawn} based on the opinion of the
921             * <em>MG"A</em> that the day is calculated from a
922             * {@link #getAlos96Zmanis() dawn} of 96 minutes <em>zmaniyos</em> before
923             * sunrise to {@link #getTzais90Zmanis() nightfall} of 96 minutes
924             * <em>zmaniyos</em> after sunset. This returns the time of 3 *
925             * {@link #getShaahZmanis96MinutesZmanis()} after
926             * {@link #getAlos96Zmanis() dawn}.
927             * 
928             * @return the <code>Date</code> of the latest zman shema.
929             * @see #getShaahZmanis96MinutesZmanis()
930             * @see #getAlos96Zmanis()
931             */
932            public Date getSofZmanShmaMGA96MinutesZmanis() {
933                    return getTimeOffset(getAlos96Zmanis(),
934                                    getShaahZmanis96MinutesZmanis() * 3);
935            }
936    
937            /**
938             * This method returns the latest <em>zman krias shema</em> (time to say
939             * Shema in the morning) calculated as 3 hours before
940             * {@link ZmanimCalendar#getChatzos()}. This is the opinion of the
941             * <em>Shach</em> in the
942             * <em>Nekudas Hakesef (Yora Deah 184), Shevus Yaakov, Chasan Sofer</em>
943             * and others.This returns the time of 3 hours before
944             * {@link ZmanimCalendar#getChatzos()}.
945             * 
946             * @return the <code>Date</code> of the latest zman shema.
947             * @see ZmanimCalendar#getChatzos()
948             * @see #getSofZmanTfila2HoursBeforeChatzos()
949             */
950            public Date getSofZmanShma3HoursBeforeChatzos() {
951                    return getTimeOffset(getChatzos(), -180 * MINUTE_MILLIS);
952            }
953    
954            /**
955             * This method returns the latest <em>zman krias shema</em> (time to say
956             * Shema in the morning) in the opinion of the <em>MG"A</em> based on
957             * <em>alos</em> being {@link #getAlos120() 120} minutes before
958             * {@link #getSunrise() sunrise}. This time is 3
959             * <em>{@link #getShaahZmanis120Minutes() shaos zmaniyos}</em> (solar
960             * hours) after {@link #getAlos120() dawn} based on the opinion of the
961             * <em>MG"A</em> that the day is calculated from a
962             * {@link #getAlos120() dawn} of 120 minutes before sunrise to
963             * {@link #getTzais120() nightfall} of 120 minutes after sunset. This
964             * returns the time of 3 *{@link #getShaahZmanis120Minutes()} after
965             * {@link #getAlos120() dawn}.
966             * 
967             * @return the <code>Date</code> of the latest zman shema.
968             * @see #getShaahZmanis120Minutes()
969             * @see #getAlos120()
970             */
971            public Date getSofZmanShmaMGA120Minutes() {
972                    return getTimeOffset(getAlos120(), getShaahZmanis120Minutes() * 3);
973            }
974    
975            /**
976             * This method returns the latest <em>zman krias shema</em> (time to say
977             * Shema in the morning) based on the opinion that the day starts at
978             * <em>{@link #getAlos16Point1Degrees() alos 16.1&deg;}</em> and ends at
979             * {@link #getSunset() sunset}. 3 shaos zmaniyos are calculated based on
980             * this day and added to {@link #getAlos16Point1Degrees() alos}to reach
981             * this time. This time is 3 <em>shaos zmaniyos</em> (solar hours) after
982             * {@link #getAlos16Point1Degrees() dawn} based on the opinion that the day
983             * is calculated from a {@link #getAlos16Point1Degrees() alos 16.1&deg;} to
984             * {@link #getSunset() sunset}.<br />
985             * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at
986             * midday.
987             * 
988             * @return the <code>Date</code> of the latest zman shema based on this
989             *         day.
990             * @see #getAlos16Point1Degrees()
991             * @see #getSunset()
992             */
993            public Date getSofZmanShmaAlos16Point1ToSunset() {
994                    long shaahZmanis = getTemporalHour(getAlos16Point1Degrees(),
995                                    getSunset());
996                    return getTimeOffset(getAlos16Point1Degrees(), shaahZmanis * 3);
997            }
998    
999            /**
1000             * This method returns the latest <em>zman krias shema</em> (time to say
1001             * Shema in the morning) based on the opinion that the day starts at
1002             * <em>{@link #getAlos16Point1Degrees() alos 16.1&deg;}</em> and ends at
1003             * {@link #getTzaisGeonim7Point083Degrees() tzais 7.083&deg;}. 3
1004             * <em>shaos zmaniyos</em> are calculated based on this day and added to
1005             * {@link #getAlos16Point1Degrees() alos} to reach this time. This time is 3
1006             * <em>shaos zmaniyos</em> (temporal hours) after
1007             * {@link #getAlos16Point1Degrees() alos 16.1&deg;} based on the opinion
1008             * that the day is calculated from a
1009             * {@link #getAlos16Point1Degrees() alos 16.1&deg;} to
1010             * <em>{@link #getTzaisGeonim7Point083Degrees() tzais 7.083&deg;}</em>.<br />
1011             * <b>Note: </b> Based on this calculation <em>chatzos</em> will not be at
1012             * midday.
1013             * 
1014             * @return the <code>Date</code> of the latest zman shema based on this
1015             *         day.
1016             * @see #getAlos16Point1Degrees()
1017             * @see #getTzaisGeonim7Point083Degrees()
1018             */
1019            public Date getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees() {
1020                    long shaahZmanis = getTemporalHour(getAlos16Point1Degrees(),
1021                                    getTzaisGeonim7Point083Degrees());
1022                    return getTimeOffset(getAlos16Point1Degrees(), shaahZmanis * 3);
1023            }
1024    
1025            public Date getSofZmanShmaKolEliyahu() {
1026                    Date chatzos = getFixedLocalChatzos();
1027                    if (chatzos == null || getSunrise() == null) {
1028                            return null;
1029                    }
1030                    long diff = (chatzos.getTime() - getSunrise().getTime()) / 2;
1031                    return getTimeOffset(chatzos, -diff);
1032            }
1033    
1034            /**
1035             * This method returns the latest <em>zman tfila</em> (time to say the
1036             * morning prayers) in the opinion of the <em>MG"A</em> based on
1037             * <em>alos</em> being {@link #getAlos19Point8Degrees()() 19.8&deg;}
1038             * before {@link #getSunrise() sunrise}. This time is 4
1039             * <em>{@link #getShaahZmanis19Point8Degrees() shaos zmaniyos}</em> (solar
1040             * hours) after {@link #getAlos19Point8Degrees() dawn} based on the opinion
1041             * of the <em>MG"A</em> that the day is calculated from dawn to nightfall
1042             * with both being 19.8&deg; below sunrise or sunset. This returns the time
1043             * of 4 *{@link #getShaahZmanis19Point8Degrees()} after
1044             * {@link #getAlos19Point8Degrees() dawn}.
1045             * 
1046             * @return the <code>Date</code> of the latest zman shema.
1047             * 
1048             * @see #getShaahZmanis19Point8Degrees()
1049             * @see #getAlos19Point8Degrees()
1050             */
1051            public Date getSofZmanTfilaMGA19Point8Degrees() {
1052                    return getTimeOffset(getAlos19Point8Degrees(),
1053                                    getShaahZmanis19Point8Degrees() * 4);
1054            }
1055    
1056            /**
1057             * This method returns the latest <em>zman tfila</em> (time to say the
1058             * morning prayers) in the opinion of the <em>MG"A</em> based on
1059             * <em>alos</em> being {@link #getAlos19Point8Degrees()() 16.1&deg;}
1060             * before {@link #getSunrise() sunrise}. This time is 4
1061             * <em>{@link #getShaahZmanis16Point1Degrees() shaos zmaniyos}</em> (solar
1062             * hours) after {@link #getAlos16Point1Degrees() dawn} based on the opinion
1063             * of the <em>MG"A</em> that the day is calculated from dawn to nightfall
1064             * with both being 16.1&deg; below sunrise or sunset. This returns the time
1065             * of 4 *{@link #getShaahZmanis16Point1Degrees()} after
1066             * {@link #getAlos16Point1Degrees() dawn}.
1067             * 
1068             * @return the <code>Date</code> of the latest zman shema.
1069             * 
1070             * @see #getShaahZmanis16Point1Degrees()
1071             * @see #getAlos16Point1Degrees()
1072             */
1073            public Date getSofZmanTfilaMGA16Point1Degrees() {
1074                    return getTimeOffset(getAlos16Point1Degrees(),
1075                                    getShaahZmanis16Point1Degrees() * 4);
1076            }
1077    
1078            /**
1079             * This method returns the latest <em>zman tfila</em> (time to say the
1080             * morning prayers) in the opinion of the <em>MG"A</em> based on
1081             * <em>alos</em> being {@link #getAlos72() 72} minutes before
1082             * {@link #getSunrise() sunrise}. This time is 4
1083             * <em>{@link #getShaahZmanis72Minutes() shaos zmaniyos}</em> (solar
1084             * hours) after {@link #getAlos72() dawn} based on the opinion of the
1085             * <em>MG"A</em> that the day is calculated from a
1086             * {@link #getAlos72() dawn} of 72 minutes before sunrise to
1087             * {@link #getTzais72() nightfall} of 72 minutes after sunset. This returns
1088             * the time of 4 * {@link #getShaahZmanis72Minutes()} after
1089             * {@link #getAlos72() dawn}. This class returns an identical time to
1090             * {@link #getSofZmanTfilaMGA()} and is repeated here for clarity.
1091             * 
1092             * @return the <code>Date</code> of the latest zman tfila.
1093             * @see #getShaahZmanis72Minutes()
1094             * @see #getAlos72()
1095             * @see #getSofZmanShmaMGA()
1096             */
1097            public Date getSofZmanTfilaMGA72Minutes() {
1098                    return getSofZmanTfilaMGA();
1099            }
1100    
1101            /**
1102             * This method returns the latest <em>zman tfila</em> (time to the morning
1103             * prayers) in the opinion of the <em>MG"A</em> based on <em>alos</em>
1104             * being {@link #getAlos72Zmanis() 72} minutes <em>zmaniyos</em> before
1105             * {@link #getSunrise() sunrise}. This time is 4
1106             * <em>{@link #getShaahZmanis72MinutesZmanis() shaos zmaniyos}</em> (solar
1107             * hours) after {@link #getAlos72Zmanis() dawn} based on the opinion of the
1108             * <em>MG"A</em> that the day is calculated from a
1109             * {@link #getAlos72Zmanis() dawn} of 72 minutes <em>zmaniyos</em> before
1110             * sunrise to {@link #getTzais72Zmanis() nightfall} of 72 minutes
1111             * <em>zmaniyos</em> after sunset. This returns the time of 4 *
1112             * {@link #getShaahZmanis72MinutesZmanis()} after
1113             * {@link #getAlos72Zmanis() dawn}.
1114             * 
1115             * @return the <code>Date</code> of the latest zman shema.
1116             * @see #getShaahZmanis72MinutesZmanis()
1117             * @see #getAlos72Zmanis()
1118             */
1119            public Date getSofZmanTfilaMGA72MinutesZmanis() {
1120                    return getTimeOffset(getAlos72Zmanis(),
1121                                    getShaahZmanis72MinutesZmanis() * 4);
1122            }
1123    
1124            /**
1125             * This method returns the latest <em>zman tfila</em> (time to say the
1126             * morning prayers) in the opinion of the <em>MG"A</em> based on
1127             * <em>alos</em> being {@link #getAlos90() 90} minutes before
1128             * {@link #getSunrise() sunrise}. This time is 4
1129             * <em>{@link #getShaahZmanis90Minutes() shaos zmaniyos}</em> (solar
1130             * hours) after {@link #getAlos90() dawn} based on the opinion of the
1131             * <em>MG"A</em> that the day is calculated from a
1132             * {@link #getAlos90() dawn} of 90 minutes before sunrise to
1133             * {@link #getTzais90() nightfall} of 90 minutes after sunset. This returns
1134             * the time of 4 * {@link #getShaahZmanis90Minutes()} after
1135             * {@link #getAlos90() dawn}.
1136             * 
1137             * @return the <code>Date</code> of the latest zman tfila.
1138             * @see #getShaahZmanis90Minutes()
1139             * @see #getAlos90()
1140             */
1141            public Date getSofZmanTfilaMGA90Minutes() {
1142                    return getTimeOffset(getAlos90(), getShaahZmanis90Minutes() * 4);
1143            }
1144    
1145            /**
1146             * This method returns the latest <em>zman tfila</em> (time to the morning
1147             * prayers) in the opinion of the <em>MG"A</em> based on <em>alos</em>
1148             * being {@link #getAlos90Zmanis() 90} minutes <em>zmaniyos</em> before
1149             * {@link #getSunrise() sunrise}. This time is 4
1150             * <em>{@link #getShaahZmanis90MinutesZmanis() shaos zmaniyos}</em> (solar
1151             * hours) after {@link #getAlos90Zmanis() dawn} based on the opinion of the
1152             * <em>MG"A</em> that the day is calculated from a
1153             * {@link #getAlos90Zmanis() dawn} of 90 minutes <em>zmaniyos</em> before
1154             * sunrise to {@link #getTzais90Zmanis() nightfall} of 90 minutes
1155             * <em>zmaniyos</em> after sunset. This returns the time of 4 *
1156             * {@link #getShaahZmanis90MinutesZmanis()} after
1157             * {@link #getAlos90Zmanis() dawn}.
1158             * 
1159             * @return the <code>Date</code> of the latest zman shema.
1160             * @see #getShaahZmanis90MinutesZmanis()
1161             * @see #getAlos90Zmanis()
1162             */
1163            public Date getSofZmanTfilaMGA90MinutesZmanis() {
1164                    return getTimeOffset(getAlos90Zmanis(),
1165                                    getShaahZmanis90MinutesZmanis() * 4);
1166            }
1167    
1168            /**
1169             * This method returns the latest <em>zman tfila</em> (time to say the
1170             * morning prayers) in