KosherJava Zmanim Homepage

net.sourceforge.zmanim
Class ZmanimCalendar

java.lang.Object
  extended by net.sourceforge.zmanim.AstronomicalCalendar
      extended by net.sourceforge.zmanim.ZmanimCalendar
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ComplexZmanimCalendar

public class ZmanimCalendar
extends AstronomicalCalendar

Description: A Java library for calculating zmanim.

The zmanim library is an API is a specialized calendar that can calculate sunrise and sunset and Jewish zmanim (religious times) for prayers and other Jewish religious duties. For a much more extensive list of zmanim use the ComplexZmanimCalendar that extends this class. This class contains the main functionality of the Zmanim library. See documentation for the ComplexZmanimCalendar and AstronomicalCalendar for simple examples on using the API.

Disclaimer:

While I did my best to get accurate results please do not rely on these zmanim for halacha lemaaseh

Version:
1.2
Author:
© Eliyahu Hershfeld 2004 - 2010

Field Summary
protected static double ZENITH_16_POINT_1
          The zenith of 16.1° below geometric zenith (90°).
protected static double ZENITH_8_POINT_5
          The zenith of 8.5° below geometric zenith (90°).
 
Fields inherited from class net.sourceforge.zmanim.AstronomicalCalendar
ASTRONOMICAL_ZENITH, CIVIL_ZENITH, GEOMETRIC_ZENITH, HOUR_MILLIS, MINUTE_MILLIS, NAUTICAL_ZENITH
 
Constructor Summary
ZmanimCalendar()
          Default constructor will set a default GeoLocation.GeoLocation(), a default AstronomicalCalculator and default the calendar to the current date.
ZmanimCalendar(GeoLocation location)
          A constructor that takes a GeoLocation as a parameter.
 
Method Summary
 boolean equals(Object object)
           
 Date getAlos72()
          Method to return alos (dawn) calculated using 72 minutes before sea level sunrise (no adjustment for elevation) based on the time to walk the distance of 4 Mil at 18 minutes a Mil.
 Date getAlosHashachar()
          Returns alos (dawn) based on the time when the sun is 16.1° below the eastern geometric horizon before sunrise.
 Date getCandelLighting()
          A method to return candle lighting time.
 double getCandleLightingOffset()
          A method to get the offset in minutes before sunset that is used in calculating candle lighting time.
 Date getChatzos()
          This method returns chatzos (midday) following the opinion of the GRA that the day for Jewish halachic times start at sunrise and ends at sunset.
 Date getMinchaGedola()
          This method returns the time of mincha gedola.
 Date getMinchaKetana()
          This method returns the time of mincha ketana.
 Date getPlagHamincha()
          This method returns he time of plag hamincha.
 long getShaahZmanisGra()
          Method to return a shaah zmanis ( temporal hour) according to the opinion of the GR"A and the Baal Hatanya.
 long getShaahZmanisMGA()
          Method to return a shaah zmanis (temporal hour) according to the opinion of the MGA.
 Date getSofZmanShmaGRA()
          This method returns the latest zman krias shema (time to say Shema in the morning).
 Date getSofZmanShmaMGA()
          This method returns the latest zman krias shema (time to say Shema in the morning) in the opinion of the MG"A based on alos being 72 minutes before sunrise.
 Date getSofZmanTfilaGRA()
          This method returns the latest zman tefilah (time to pray morning prayers).
 Date getSofZmanTfilaMGA()
          This method returns the latest zman tfila (time to say the morning prayers) in the opinion of the MG"A based on alos being 72 minutes before sunrise.
 Date getSolarMidnight()
          A method that returns "solar" midnight, or the time when the sun is at it's nadir.
 Date getTzais()
          Returns tzais (nightfall) when the sun is 8.5° below the western geometric horizon (90°) after sunset.
 Date getTzais72()
          This method returns the tzais (nightfall) based on the opinion of the Ramba"m and Rabainu Tam that tzais is calculated as the time it takes to walk 4 Mil at 18 minutes a Mil for a total of 72 minutes.
 int hashCode()
           
 void setCandleLightingOffset(double candleLightingOffset)
          A method to set the offset in minutes before sunset that is used in calculating candle lighting time.
 
Methods inherited from class net.sourceforge.zmanim.AstronomicalCalendar
clone, getAstronomicalCalculator, getBeginAstronomicalTwilight, getBeginCivilTwilight, getBeginNauticalTwilight, getCalendar, getDateFromTime, getEndAstronomicalTwilight, getEndCivilTwilight, getEndNauticalTwilight, getGeoLocation, getSeaLevelSunrise, getSeaLevelSunset, getSunrise, getSunriseOffsetByDegrees, getSunriseSolarDipFromOffset, getSunset, getSunsetOffsetByDegrees, getSunsetSolarDipFromOffset, getSunTransit, getTemporalHour, getTemporalHour, getTimeOffset, getTimeOffset, getUTCSeaLevelSunrise, getUTCSeaLevelSunset, getUTCSunrise, getUTCSunset, setAstronomicalCalculator, setCalendar, setGeoLocation, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZENITH_16_POINT_1

protected static final double ZENITH_16_POINT_1
The zenith of 16.1° below geometric zenith (90°). This calculation is used for calculating alos (dawn) and tzais (nightfall) in some opinions. This calculation is based on the calculation that the time between dawn and sunrise (and sunset to nightfall) is the time that is takes to walk 4 mil at 18 minutes a mil (Ramba"m and others). The sun's position at 72 minutes before sunrise in Jerusalem on the equinox is 16.1° below geometric zenith.

See Also:
getAlosHashachar(), ComplexZmanimCalendar.getAlos16Point1Degrees(), ComplexZmanimCalendar.getTzais16Point1Degrees(), ComplexZmanimCalendar.getSofZmanShmaMGA16Point1Degrees(), ComplexZmanimCalendar.getSofZmanTfilaMGA16Point1Degrees(), ComplexZmanimCalendar.getMinchaGedola16Point1Degrees(), ComplexZmanimCalendar.getMinchaKetana16Point1Degrees(), ComplexZmanimCalendar.getPlagHamincha16Point1Degrees(), ComplexZmanimCalendar.getPlagAlos16Point1ToTzaisGeonim7Point083Degrees(), ComplexZmanimCalendar.getSofZmanShmaAlos16Point1ToSunset(), Constant Field Values

ZENITH_8_POINT_5

protected static final double ZENITH_8_POINT_5
The zenith of 8.5° below geometric zenith (90°). This calculation is used for calculating alos (dawn) and tzais (nightfall) in some opinions. This calculation is based on the position of the sun 36 minutes after sunset in Jerusalem on March 16, about 4 days before the equinox, the day that a solar hour is one hour, which is 8.5° below geometric zenith. The Ohr Meir considers this the time that 3 small starts are visible, later than the required 3 medium stars.

See Also:
getTzais(), ComplexZmanimCalendar.getTzaisGeonim8Point5Degrees(), Constant Field Values
Constructor Detail

ZmanimCalendar

public ZmanimCalendar()
Default constructor will set a default GeoLocation.GeoLocation(), a default AstronomicalCalculator and default the calendar to the current date.

See Also:
AstronomicalCalendar.AstronomicalCalendar()

ZmanimCalendar

public ZmanimCalendar(GeoLocation location)
A constructor that takes a GeoLocation as a parameter.

Parameters:
location - the location
Method Detail

getTzais

public Date getTzais()
Returns tzais (nightfall) when the sun is 8.5° below the western geometric horizon (90°) after sunset. For information on the source of this calculation see ZENITH_8_POINT_5.

Returns:
The Date of nightfall.
See Also:
ZENITH_8_POINT_5

getAlosHashachar

public Date getAlosHashachar()
Returns alos (dawn) based on the time when the sun is 16.1° below the eastern geometric horizon before sunrise. For more information the source of 16.1° see ZENITH_16_POINT_1.

Returns:
The Date of dawn.
See Also:
ZENITH_16_POINT_1

getAlos72

public Date getAlos72()
Method to return alos (dawn) calculated using 72 minutes before sea level sunrise (no adjustment for elevation) based on the time to walk the distance of 4 Mil at 18 minutes a Mil. This is based on the opinion of most Rishonim who stated that the time of the Neshef (time between dawn and sunrise) does not vary by the time of year or location but purely depends on the time it takes to walk the distance of 4 Mil.

Returns:
the Date representing the time.

getChatzos

public Date getChatzos()
This method returns chatzos (midday) following the opinion of the GRA that the day for Jewish halachic times start at sunrise and ends at sunset. The returned value is identical to AstronomicalCalendar.getSunTransit()

Returns:
the Date of chatzos.
See Also:
AstronomicalCalendar.getSunTransit()

getSolarMidnight

public Date getSolarMidnight()
A method that returns "solar" midnight, or the time when the sun is at it's nadir.

Note: this method is experimental and might be removed (or moved)

Returns:
the Date of Solar Midnight (chatzos layla).

getSofZmanShmaGRA

public Date getSofZmanShmaGRA()
This method returns the latest zman krias shema (time to say Shema in the morning). This time is 3 shaos zmaniyos (solar hours) after sea level sunrise based on the opinion of the GR"A and the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 3 * getShaahZmanisGra() after sea level sunrise.

Returns:
the Date of the latest zman shema.
See Also:
getShaahZmanisGra()

getSofZmanShmaMGA

public Date getSofZmanShmaMGA()
This method returns the latest zman krias shema (time to say Shema in the morning) in the opinion of the MG"A based on alos being 72 minutes before sunrise. This time is 3 shaos zmaniyos (solar hours) after dawn based on the opinion of the MG"A that the day is calculated from a dawn of 72 minutes before sunrise to nightfall of 72 minutes after sunset. This returns the time of 3 * shaos zmaniyos after dawn.

Returns:
the Date of the latest zman shema.
See Also:
ComplexZmanimCalendar.getShaahZmanis72Minutes(), getAlos72(), ComplexZmanimCalendar.getSofZmanShmaMGA72Minutes()

getTzais72

public Date getTzais72()
This method returns the tzais (nightfall) based on the opinion of the Ramba"m and Rabainu Tam that tzais is calculated as the time it takes to walk 4 Mil at 18 minutes a Mil for a total of 72 minutes. Even for locations above sea level, this is calculated at sea level, since the darkness level is not affected by elevation.

Returns:
the Date representing 72 minutes after sea level sunset.

getCandelLighting

public Date getCandelLighting()
A method to return candle lighting time. This is calculated as getCandleLightingOffset() minutes before sunset. This will return the time for any day of the week, since it can be used to calculate candle lighting time for yom tov (holidays) as well.

Returns:
candle lighting time.
See Also:
getCandleLightingOffset(), setCandleLightingOffset(double)

getSofZmanTfilaGRA

public Date getSofZmanTfilaGRA()
This method returns the latest zman tefilah (time to pray morning prayers). This time is 4 hours into the day based on the opinion of the GR"A and the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 4 * getShaahZmanisGra() after sea level sunrise.

Returns:
the Date of the latest zman tefilah.
See Also:
getShaahZmanisGra()

getSofZmanTfilaMGA

public Date getSofZmanTfilaMGA()
This method returns the latest zman tfila (time to say the morning prayers) in the opinion of the MG"A based on alos being 72 minutes before sunrise. This time is 4 shaos zmaniyos (temporal hours) after dawn based on the opinion of the MG"A that the day is calculated from a dawn of 72 minutes before sunrise to nightfall of 72 minutes after sunset. This returns the time of 4 * getShaahZmanisMGA() after dawn.

Returns:
the Date of the latest zman tfila.
See Also:
getShaahZmanisMGA(), getAlos72()

getMinchaGedola

public Date getMinchaGedola()
This method returns the time of mincha gedola. Mincha gedola is the earliest time one can pray mincha. The Ramba"m is of the opinion that it is better to delay mincha until mincha ketana while the Ra"sh, Tur, GR"A and others are of the opinion that mincha can be prayed lechatchila starting at mincha gedola. This is calculated as 6.5 sea level solar hours after sea level sunrise. This calculation is calculated based on the opinion of the GR"A and the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5 getShaahZmanisGra() after sea level sunrise.

Returns:
the Date of the time of mincha gedola.
See Also:
getShaahZmanisGra(), getMinchaKetana()

getMinchaKetana

public Date getMinchaKetana()
This method returns the time of mincha ketana. This is the perfered earliest time to pray mincha in the opinion of the Ramba"m and others. For more information on this see the documentation on mincha gedola. This is calculated as 9.5 sea level solar hours after sea level sunrise. This calculation is calculated based on the opinion of the GR"A and the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 9.5 * getShaahZmanisGra() after sea level sunrise.

Returns:
the Date of the time of mincha gedola.
See Also:
getShaahZmanisGra(), getMinchaGedola()

getPlagHamincha

public Date getPlagHamincha()
This method returns he time of plag hamincha. This is calculated as 10.75 hours after sunrise. This calculation is calculated based on the opinion of the GR"A and the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 10.75 * getShaahZmanisGra() after sea level sunrise.

Returns:
the Date of the time of plag hamincha.

getShaahZmanisGra

public long getShaahZmanisGra()
Method to return a shaah zmanis ( temporal hour) according to the opinion of the GR"A and the Baal Hatanya. This calculation divides the day based on the opinion of the GR"A and the Baal Hatanya that the day runs from sunrise to sunset. The calculations are based on a day from sea level sunrise to sea level sunset. The day is split into 12 equal parts each part with each one being a shaah zmanis. This method is similar to AstronomicalCalendar.getTemporalHour(), but all calculations are based on a sealevel sunrise and sunset. For additional information, see Zmanim Kehilchasam, 2nd Edition by Rabbi Dovid Yehuda Burstein, Jerusalem, 2007.

Returns:
the long millisecond length of a shaah zmanis.
See Also:
AstronomicalCalendar.getTemporalHour(Date, Date)

getShaahZmanisMGA

public long getShaahZmanisMGA()
Method to return a shaah zmanis (temporal hour) according to the opinion of the MGA. This calculation divides the day based on the opinion of the MGA that the day runs from dawn to dusk (for sof zman krias shema and tfila). Dawn for this calculation is 72 minutes before sunrise and dusk is 72 minutes after sunset. This day is split into 12 equal parts with each part being a shaah zmanis. Alternate mothods of calculating a shaah zmanis are available in the subclass ComplexZmanimCalendar.

Returns:
the long millisecond length of a shaah zmanis.

equals

public boolean equals(Object object)
Overrides:
equals in class AstronomicalCalendar
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class AstronomicalCalendar
See Also:
Object.hashCode()

getCandleLightingOffset

public double getCandleLightingOffset()
A method to get the offset in minutes before sunset that is used in calculating candle lighting time. The default time used is 18 minutes before sunset. Some calendars use 15 minutes, while the custom in Jerusalem is to use a 40 minute offset. Please check the local custom for candel lighting time.

Returns:
Returns the candle lighting offset to set in minutes..
See Also:
getCandelLighting()

setCandleLightingOffset

public void setCandleLightingOffset(double candleLightingOffset)
A method to set the offset in minutes before sunset that is used in calculating candle lighting time. The default time used is 18 minutes before sunset. Some calendars use 15 minutes, while the custom in Jerusalem is to use a 40 minute offset.

Parameters:
candleLightingOffset - The candle lighting offset to set in minutes.
See Also:
getCandelLighting()

KosherJava Zmanim Homepage

Copyright © 2004 - 2010 Eliyahu Hershfeld. All Rights Reserved. Released under the GPL 2 license